Lines Matching +full:verify +full:- +full:formatting

4  * SPDX-License-Identifier: Apache-2.0
96 /* We can't determine at build-time whether int is 64-bit, so assume
138 /* This has to be more than 255 so we can test over-sized widths. */
158 int idx = outbuf->idx - ((outbuf->idx == outbuf->size) ? 1 : 0); in outbuf_null_terminate()
160 outbuf->buf[idx] = 0; in outbuf_null_terminate()
168 if (buf->idx < buf->size) { in out()
169 buf->buf[buf->idx++] = (char)(unsigned char)c; in out()
253 CBPRINTF_STATIC_PACKAGE(&package[PKG_ALIGN_OFFSET], _len - 1, \
256 zassert_equal(st_pkg_rv, -ENOSPC); \
297 printf("%s:%u for '%s'\n", ctx->file, ctx->line, ctx->expected); in prf_failed()
298 printf("in: %s\nat: %*c%s\n", ctx->got, in prf_failed()
299 (unsigned int)(cp - ctx->got), '>', ctx->expected); in prf_failed()
350 int len = (int)(str - buf); in prf_check()
389 while (spaces-- > 0) { in ZTEST()
419 TEST_PRF(&rc, "/%6s/%-6s/%2s/", s, s, s); in ZTEST()
454 int min = -1234567890; in ZTEST()
457 long long svll2 = -2LL; in ZTEST()
462 PRF_CHECK("-1234567890/1876543210", rc); in ZTEST()
469 PRF_CHECK("-722/-14614", rc); in ZTEST()
472 PRF_CHECK("46/-22", rc); in ZTEST()
479 PRF_CHECK("-1234567890/1876543210/4000000000/", rc); in ZTEST()
484 TEST_PRF(&rc, "/%lld/%lld/%lld/%llu/", svll, -svll, svll2, uvll); in ZTEST()
486 PRF_CHECK("/34621422135410688/-34621422135410688/-2/4000000000/", rc); in ZTEST()
490 PRF_CHECK("/ERR/ERR/-2/4000000000/", rc); in ZTEST()
497 PRF_CHECK("-1234567890/1876543210", rc); in ZTEST()
499 PRF_CHECK("-1234567890/1876543210", rc); in ZTEST()
511 PRF_CHECK("-1234567890/1876543210", rc); in ZTEST()
520 PRF_CHECK("-1234567890/-1234567890/1876543210", rc); in ZTEST()
541 TEST_PRF(&rc, "/%d/%-d/%+d/% d/", in ZTEST()
546 TEST_PRF(&rc, "/%1d/%4d/%-4d/%04d/%15d/%-15d/", in ZTEST()
556 sv = -sv; in ZTEST()
557 TEST_PRF(&rc, "/%d/%-d/%+d/% d/", in ZTEST()
559 PRF_CHECK("/-123/-123/-123/-123/", rc); in ZTEST()
561 TEST_PRF(&rc, "/%1d/%6d/%-6d/%06d/%13d/%-13d/", in ZTEST()
563 PRF_CHECK("/-123/ -123/-123 /-00123/" in ZTEST()
564 " -123/-123 /", rc); in ZTEST()
567 PRF_CHECK("/-000123/ -0123/", rc); in ZTEST()
575 rc = rawprf("/%#d/% +d/%-04d/%06.4d/", sv, sv, sv, sv); in ZTEST()
654 TEST_PRF(&rc, "/%x/%-x/%#x/", in ZTEST()
659 TEST_PRF(&rc, "/%1x/%4x/%-4x/%04x/%#15x/%-15x/", in ZTEST()
725 dv = 1E-3; in ZTEST()
727 PRF_CHECK("1.000e-03", rc); in ZTEST()
729 dv = 1E-3; in ZTEST()
759 dv = -INFINITY; in ZTEST()
763 PRF_CHECK("-inf.f -INF.F -inf.e -INF.E " in ZTEST()
764 "-inf.g -INF.g -inf.a -INF.A", rc); in ZTEST()
766 PRF_CHECK("-inf.f -INF.F -inf.e -INF.E " in ZTEST()
767 "-inf.g -INF.g %a.a %A.A", rc); in ZTEST()
784 PRF_CHECK("0x1p-1022 2.225074e-308", rc); in ZTEST()
786 PRF_CHECK("%a 2.225074e-308", rc); in ZTEST()
792 PRF_CHECK("0x0.4p-1022 5.562685e-309", rc); in ZTEST()
794 PRF_CHECK("%a 5.562685e-309", rc); in ZTEST()
802 dv = 0x1.0p-3; in ZTEST()
806 dv = 0x1.0p-4; in ZTEST()
810 dv = 0x1.8p-4; in ZTEST()
814 dv = 0x1.cp-4; in ZTEST()
818 dv = 0x1.9999999800000p-7; in ZTEST()
822 dv = 0x1.9999999ffffffp-8; in ZTEST()
830 dv = 0x1.fffffffffffffp-1022; in ZTEST()
832 PRF_CHECK("4.450147717014402e-308", rc); in ZTEST()
834 dv = 0x1.ffffffffffffep-1022; in ZTEST()
836 PRF_CHECK("4.450147717014402e-308", rc); in ZTEST()
838 dv = 0x1.ffffffffffffdp-1022; in ZTEST()
840 PRF_CHECK("4.450147717014401e-308", rc); in ZTEST()
842 dv = 0x1.0000000000001p-1022; in ZTEST()
844 PRF_CHECK("2.225073858507202e-308", rc); in ZTEST()
846 dv = 0x1p-1022; in ZTEST()
848 PRF_CHECK("2.225073858507201e-308", rc); in ZTEST()
850 dv = 0x0.fffffffffffffp-1022; in ZTEST()
852 PRF_CHECK("2.225073858507201e-308", rc); in ZTEST()
854 dv = 0x0.0000000000001p-1022; in ZTEST()
856 PRF_CHECK("4.940656458412465e-324", rc); in ZTEST()
858 dv = 0x1.1fa182c40c60dp-1019; in ZTEST()
860 PRF_CHECK("2e-307", rc); in ZTEST()
943 dv = -dv; in ZTEST()
945 PRF_CHECK("/-1.23/-1.23/-1.23/", rc); in ZTEST()
951 rc = prf(NULL, "% .380f", 0x1p-400); in ZTEST()
961 TEST_PRF(&rc, "/%3c/%-3c/", 'a', 'a'); in ZTEST()
964 TEST_PRF(&rc, "/%*c/%*c/", 3, 'a', -3, 'a'); in ZTEST()
992 -3, dv); in ZTEST()
1075 rc = rawprf("/%-12p/", ptr); in ZTEST()
1080 rc = rawprf("/%-12p/", NULL); in ZTEST()
1102 return -42; in out_e42()
1115 size_t const len = sizeof(lbuf) - 1U; in ZTEST()
1141 zassert_equal(rc, -42, "rc %d", rc); in ZTEST()
1155 /* Verify we can calculate length without storing */ in ZTEST()
1164 /* Verify we get same length when storing. Pass buffer which may be in ZTEST()
1170 /* Verify we get an error if can't store */ in ZTEST()
1171 len -= 1; in ZTEST()
1173 zassert_equal(rc, -ENOSPC); in ZTEST()
1222 zassert_equal(desc0->desc.ro_str_cnt, 0); in ZTEST()
1223 zassert_equal(desc1->desc.ro_str_cnt, 2); in ZTEST()
1247 /* Test for validating conversion to fully self-contained package. */
1292 err = cbprintf_fsc_package(package, len, fsc_package, fsc_len - 1); in ZTEST()
1293 zassert_equal(err, -ENOSPC); in ZTEST()
1328 /* This only checks error conditions. Formatting is checked in ZTEST()
1334 zassert_equal(rc, -EINVAL); in ZTEST()
1369 _Pragma("GCC diagnostic ignored \"-Wpointer-arith\"") in ZTEST()
1432 _Pragma("GCC diagnostic ignored \"-Wpointer-arith\"") in ZTEST()