/picolibc-latest/test/ |
D | testcases.c | 3 * as a part of the printf test suite developed by 92 result |= test(__LINE__, "0", "%.7g", printf_float(0.0)); 93 result |= test(__LINE__, "0.33", "%.*f", 2, printf_float(0.33333333)); 96 result |= test(__LINE__, "foo", "%.3s", "foobar"); 97 result |= test(__LINE__, " 00004", "%10.5d", 4); 98 result |= test(__LINE__, " 42", "% d", 42); 100 result |= test(__LINE__, "-42", "% d", -42); 102 result |= test(__LINE__, " 42", "% 5d", 42); 103 result |= test(__LINE__, " -42", "% 5d", -42); 104 result |= test(__LINE__, " 42", "% 15d", 42); [all …]
|
D | CMakeLists.txt | 54 test-funopen 55 test-strtod 56 test-strchr 57 test-memset 58 test-put 59 test-efcvt 60 test-fma 61 test-sprintf-percent-n 64 test-memcpy_s 65 test-memset_s [all …]
|
D | meson.build | 40 'test-strchr', 41 'test-memset', 'test-put', 42 'test-raise', 43 'test-sprintf-percent-n', 44 'test-ctype', 50 'test-efcvt', 51 'test-fma', 52 'test-strtod', 70 'test-vfscanf-percent-a', 75 plain_tests_common += 'test-atomic' [all …]
|
D | math_errhandling_tests.c | 83 #define TEST(n,v,ex,er) { .func = makemathname(cat2(test_, n)), .name = str(n), .value = (v), .exce… macro 819 TEST(acos_2, (FLOAT_T) NAN, FE_INVALID, EDOM), 820 TEST(acos_qnan, (FLOAT_T) NAN, 0, 0), 821 TEST(acos_snan, (FLOAT_T) NAN, FE_INVALID, 0), 822 TEST(acos_inf, (FLOAT_T) NAN, FE_INVALID, EDOM), 823 TEST(acos_minf, (FLOAT_T) NAN, FE_INVALID, EDOM), 825 TEST(acosh_half, (FLOAT_T)NAN, FE_INVALID, EDOM), 826 TEST(acosh_qnan, (FLOAT_T)NAN, 0, 0), 827 TEST(acosh_snan, (FLOAT_T)NAN, FE_INVALID, 0), 828 TEST(acosh_inf, (FLOAT_T)INFINITY, 0, 0), [all …]
|
D | test-ctype.c | 44 #define TEST(name) do { \ macro 75 TEST(alnum); in main() 76 TEST(alpha); in main() 77 TEST(blank); in main() 78 TEST(cntrl); in main() 79 TEST(digit); in main() 80 TEST(graph); in main() 81 TEST(lower); in main() 82 TEST(print); in main() 83 TEST(punct); in main() [all …]
|
D | test-strnlen_s.c | 57 printf("Test %d Failed: %s\n", test_id, msg); \ 60 printf("Test %d Passed: %s\n", test_id, msg); \ 72 printf("Test %d Failed: Error msg is incorrect\n", test_id); in test_handler_called() 79 printf("Test %d Failed: Error msg is incorrect\n", test_id); in test_handler_called() 86 printf("Test %d Failed: Error msg is incorrect\n", test_id); in test_handler_called() 110 // Test case 1: Normal length in main() 116 // Test case 2: Length with exact buffer size in main() 123 // Test case 3: Length with insufficient buffer in main() 130 // Test case 4: Length of empty string in main() 136 // Test case 5: Length with Null string in main() [all …]
|
D | test-strerror_s.c | 57 printf("Test %d Failed: %s\n", test_id, msg); \ 60 printf("Test %d Passed: %s\n", test_id, msg); \ 72 printf("Test %d Failed: Error msg is incorrect\n", test_id); in test_handler_called() 79 printf("Test %d Failed: Error msg is incorrect\n", test_id); in test_handler_called() 86 printf("Test %d Failed: Error msg is incorrect\n", test_id); in test_handler_called() 111 // Test case 1: Normal error message in main() 119 // Test case 2: Buffer too small in main() 125 // Test case 3: Null Destination Pointer in main() 131 // Test case 4: Zero-length Buffer in main() 138 // Test case 5: Unknown error code in main()
|
D | test-strncat_s.c | 57 printf("Test %d Failed: %s\n", test_id, msg); \ 60 printf("Test %d Passed: %s\n", test_id, msg); \ 72 printf("Test %d Failed: Error msg is incorrect\n", test_id); in test_handler_called() 79 printf("Test %d Failed: Error msg is incorrect\n", test_id); in test_handler_called() 86 printf("Test %d Failed: Error msg is incorrect\n", test_id); in test_handler_called() 112 // Test case 1: Normal Concatenation in main() 121 // Test case 2: Concatenation with insufficient buffer in main() 130 // Test case 3: Null pointers in main() 139 // Test case 4: Concatenation of empty source string in main() 150 // Test case 5: Concatenation with empty destination string in main() [all …]
|
D | time-tests.c | 98 puts("Test t1 failed."); in main() 109 puts("Test t2 failed."); in main() 143 puts("Test t3 failed."); in main() 154 puts("Test t4 failed."); in main() 159 // Test the first non-negative time_t value of 0, in main() 176 puts("Test t5 failed."); in main() 181 // Test the last time_t value of 0x7FFFFFFF before the 32-bit signed integer overflow, in main() 195 struct tm dtForTimegm7 = dtForTimegm6; // Reuse the date for the next test. in main() 204 puts("Test t6 failed."); in main() 209 // Test the next time_t value of 0x80000000 right after in main() [all …]
|
D | test-memcpy_s.c | 57 printf("Test %d Failed: %s\n", test_id, msg); \ 60 printf("Test %d Passed: %s\n", test_id, msg); \ 72 printf("Test %d Failed: Error msg is incorrect\n", test_id); in test_handler_called() 79 printf("Test %d Failed: Error msg is incorrect\n", test_id); in test_handler_called() 86 printf("Test %d Failed: Error msg is incorrect\n", test_id); in test_handler_called() 112 // Test case 1: Normal copy in main() 120 // Test case 2: Copy with insufficient destination size in main() 128 // Test case 3: Copy with Null destination in main() 134 // Test case 4: Copy with Null source in main() 140 // Test case 5: Copy with zero length in main()
|
D | test-memmove_s.c | 57 printf("Test %d Failed: %s\n", test_id, msg); \ 60 printf("Test %d Passed: %s\n", test_id, msg); \ 72 printf("Test %d Failed: Error msg is incorrect\n", test_id); in test_handler_called() 79 printf("Test %d Failed: Error msg is incorrect\n", test_id); in test_handler_called() 86 printf("Test %d Failed: Error msg is incorrect\n", test_id); in test_handler_called() 111 // Test case 1: Normal move in main() 119 // Test case 2: Move with insufficient destination size in main() 127 // Test case 3: Move with Null destination in main() 133 // Test case 4: Move with Null source in main() 139 // Test case 5: Move with zero length in main()
|
D | test-sprintf_s.c | 57 printf("Test %d Failed: %s\n", test_id, msg); \ 60 printf("Test %d Passed: %s\n", test_id, msg); \ 72 printf("Test %d Failed: Error msg is incorrect\n", test_id); in test_handler_called() 79 printf("Test %d Failed: Error msg is incorrect\n", test_id); in test_handler_called() 86 printf("Test %d Failed: Error msg is incorrect\n", test_id); in test_handler_called() 111 // Test case 1: Normal formatting in main() 120 // Test case 2: Formatting with buffer overflow in main() 127 // Test case 3: Formatting with Null buffer in main() 134 // Test case 4: Formatting with Null format string in main() 142 // Test case 5: Empty format string in main()
|
D | test-strcat_s.c | 57 printf("Test %d Failed: %s\n", test_id, msg); \ 60 printf("Test %d Passed: %s\n", test_id, msg); \ 72 printf("Test %d Failed: Error msg is incorrect\n", test_id); in test_handler_called() 79 printf("Test %d Failed: Error msg is incorrect\n", test_id); in test_handler_called() 86 printf("Test %d Failed: Error msg is incorrect\n", test_id); in test_handler_called() 112 // Test case 1: Normal Concatenation in main() 120 // Test case 2: Concatenation with insufficient buffer in main() 128 // Test case 3: Null pointers in main() 137 // Test case 4: Concatenation of empty source string in main() 148 // Test case 5: Concatenation with empty destination string in main()
|
D | test-strcpy_s.c | 57 printf("Test %d Failed: %s\n", test_id, msg); \ 60 printf("Test %d Passed: %s\n", test_id, msg); \ 72 printf("Test %d Failed: Error msg is incorrect\n", test_id); in test_handler_called() 79 printf("Test %d Failed: Error msg is incorrect\n", test_id); in test_handler_called() 86 printf("Test %d Failed: Error msg is incorrect\n", test_id); in test_handler_called() 112 // Test case 1: Normal copy in main() 120 // Test case 2: Copy with insufficient buffer in main() 127 // Test case 3: Null pointers in main() 136 // Test case 4: Copy of empty string in main() 144 // Test case 5: Copy to empty buffer in main()
|
D | test-strncpy_s.c | 57 printf("Test %d Failed: %s\n", test_id, msg); \ 60 printf("Test %d Passed: %s\n", test_id, msg); \ 72 printf("Test %d Failed: Error msg is incorrect\n", test_id); in test_handler_called() 79 printf("Test %d Failed: Error msg is incorrect\n", test_id); in test_handler_called() 86 printf("Test %d Failed: Error msg is incorrect\n", test_id); in test_handler_called() 112 // Test case 1: Normal copy in main() 120 // Test case 2: Copy with insufficient buffer in main() 127 // Test case 3: Null pointers in main() 136 // Test case 4: Copy of empty string in main() 144 // Test case 5: Copy with zero Characters in main()
|
/picolibc-latest/.github/ |
D | do-linux | 4 "$HERE"/do-test arm "$@" 5 "$HERE"/do-test cortex-a9 "$@" 9 "$HERE"/do-test-noopt native "$@" 10 "$HERE"/do-test-noopt native-m32 "$@" 11 "$HERE"/do-test aarch64 "$@" 13 "$HERE"/do-test-noopt i386 "$@" 14 "$HERE"/do-test m68k-unknown-elf "$@" 15 "$HERE"/do-test msp430-unknown-elf "$@" 16 "$HERE"/do-test sh-unknown-elf "$@" 18 "$HERE"/do-test-noopt x86_64 "$@" [all …]
|
D | do-zephyr | 4 "$HERE"/do-zephyr-test aarch64-zephyr "$@" 5 "$HERE"/do-zephyr-test arc "$@" 6 "$HERE"/do-zephyr-test arc64 "$@" 8 "$HERE"/do-zephyr-test mips-zephyr "$@" 9 "$HERE"/do-zephyr-test nios2 "$@" 10 "$HERE"/do-zephyr-test sparc-zephyr "$@" 11 "$HERE"/do-zephyr-test x86_64-zephyr "$@"
|
/picolibc-latest/test/libc-testsuite/ |
D | sscanf.c | 31 #define TEST(r, f, x, m) ( \ macro 44 TEST(i, sscanf(# x, "%lf", &d), 1, "got %d fields, expected %d"), \ 45 TEST(t, d, (double)x, "%a != %a") ) 48 TEST(i, sscanf(v, "%lf", &d), 1, "got %d fields, expected %d"), \ 49 TEST(t, d, (double)x, "%a != %a") ) 95 TEST(i, sscanf("hello, world\n", "%s %s", a, b), 2, "only %d fields, expected %d"); in test_sscanf() 102 TEST(i, sscanf("hello, world\n", "%6c %5c%c", a, b, c), 3, "only %d fields, expected %d"); in test_sscanf() 107 TEST(i, sscanf("hello, world\n", "%[hel]%s", a, b), 2, "only %d fields, expected %d"); in test_sscanf() 111 TEST(i, sscanf("hello, world\n", "%[hel] %s", a, b), 2, "only %d fields, expected %d"); in test_sscanf() 115 TEST(i, sscanf("elloworld", "%1[abcdefg]%s", a, b), 2, "only %d fields, expected %d"); in test_sscanf() [all …]
|
D | string.c | 28 * f = function call to test (or any expression) 39 #define TEST(r, f, x, m) do { \ macro 64 TEST(s, strcpy(b, c), b, "wrong return %p != %p"); in test_string() 66 TEST(s, strcpy(b+1, c), b+1, "wrong return %p != %p"); in test_string() 68 TEST(s, strcpy(b+2, c), b+2, "wrong return %p != %p"); in test_string() 70 TEST(s, strcpy(b+3, c), b+3, "wrong return %p != %p"); in test_string() 73 TEST(s, strcpy(b+1, c+1), b+1, "wrong return %p != %p"); in test_string() 75 TEST(s, strcpy(b+2, c+2), b+2, "wrong return %p != %p"); in test_string() 77 TEST(s, strcpy(b+3, c+3), b+3, "wrong return %p != %p"); in test_string() 80 TEST(s, memset(b, 'x', sizeof b), b, "wrong return %p != %p"); in test_string() [all …]
|
D | strtol.c | 29 * f = function call to test (or any expression) 39 #define TEST(r, f, x, m) ( \ macro 60 TEST(l, atol("2147483647"), 2147483647L, "max 32bit signed %ld != %ld"); in test_strtol() 62 TEST(l, strtol("2147483647", 0, 0), 2147483647L, "max 32bit signed %ld != %ld"); in test_strtol() 63 TEST(ul, strtoul("4294967295", 0, 0), 4294967295UL, "max 32bit unsigned %lu != %lu"); in test_strtol() 67 TEST(l, strtol(s="2147483648", &c, 0), 2147483647L, "uncaught overflow %ld != %ld"); in test_strtol() 71 TEST(l, strtol(s="-2147483649", &c, 0), -2147483647L-1, "uncaught overflow %ld != %ld"); in test_strtol() 75 TEST(ul, strtoul(s="4294967296", &c, 0), 4294967295UL, "uncaught overflow %lu != %lu"); in test_strtol() 79 TEST(ul, strtoul(s="-1", &c, 0), -1UL, "rejected negative %lu != %lu"); in test_strtol() 83 TEST(ul, strtoul(s="-2", &c, 0), -2UL, "rejected negative %lu != %lu"); in test_strtol() [all …]
|
D | snprintf.c | 40 #define TEST(r, f, x, m) ( \ macro 83 /* hex: test alt form and case */ 88 /* octal: test alt form */ 173 TEST(i, snprintf(0, 0, "%ld", 123456l), 6, "length returned %d != %d"); in test_snprintf() 174 TEST(i, snprintf(0, 0, "%.4s", "hello"), 4, "length returned %d != %d"); in test_snprintf() 175 TEST(i, snprintf(b, 0, "%.0s", "goodbye"), 0, "length returned %d != %d"); in test_snprintf() 178 TEST(i, snprintf(b, 4, "%ld", 123456l), 6, "length returned %d != %d"); in test_snprintf() 180 TEST(i, b[5], 'x', "buffer overrun"); in test_snprintf() 184 /* Perform ascii arithmetic to test printing tiny doubles */ in test_snprintf() 185 TEST(i, snprintf(b, sizeof b, "%.1022f", 0x1p-1021), 1024, "%d != %d"); in test_snprintf() [all …]
|
D | dirname.c | 30 #define TEST(p, b) do { \ macro 51 TEST("", "."); in test_dirname() 52 TEST("/usr/lib", "/usr"); in test_dirname() 53 TEST("/usr/", "/"); in test_dirname() 54 TEST("usr", "."); in test_dirname() 55 TEST("/", "/"); in test_dirname() 56 TEST("///", "/"); in test_dirname() 57 TEST(".", "."); in test_dirname() 58 TEST("..", "."); in test_dirname()
|
D | basename.c | 30 #define TEST(p, b) do { \ macro 51 TEST("", "."); in test_basename() 52 TEST("/usr/lib", "lib"); in test_basename() 53 TEST("/usr/", "usr"); in test_basename() 54 TEST("/", "/"); in test_basename() 55 TEST("///", "/"); in test_basename() 56 TEST("//usr//lib//", "lib"); in test_basename()
|
/picolibc-latest/scripts/ |
D | test-picolibc | 8 #test=echo 18 $test rm -rf $DIR 19 $test mkdir -p $DIR 20 $test cd $DIR 26 $test ../../scripts/do-$arch-configure $options 27 $test ninja test install 31 $test rm -rf $DIR 32 $test mkdir -p $DIR 33 $test cd $DIR 39 $test ../../scripts/do-$arch-configure $reloptions [all …]
|
/picolibc-latest/newlib/testsuite/newlib.search/ |
D | hsearchtest.c | 33 * Test program for hsearch() et al. 41 #define TEST(e) ((e) ? (void)0 : testfail(__FILE__, __LINE__, #e)) macro 47 fprintf(stderr, "TEST FAILED: %s: file %s, line %ld\n", in testfail() 61 TEST(created_ok); in main() 70 TEST(e.key != NULL); in main() 73 TEST(ep != NULL); in main() 74 TEST(strcmp(ep->key, ch) == 0); in main() 75 TEST((int) (uintptr_t)ep->data == i); in main() 85 TEST(ep != NULL); in main() 86 TEST(strcmp(ep->key, ch) == 0); in main() [all …]
|