Lines Matching refs:test

46 #include "nolibc-test-linkage.h"
52 /* will be used to test initialization of environ */
55 /* will be used to test initialization of argv */
58 /* will be used to test initialization of argc */
61 /* will be used by some test cases as readable file, please don't write it */
68 struct test {
69 const char *name; /* test name */
624 /* declare tests based on line numbers. There must be exactly one test per line. */
626 case __LINE__: llen += printf("%d %s", test, #name);
643 int test;
656 for (test = min; test >= 0 && test <= max; test++) {
660 * test numbers.
662 switch (test + __LINE__ + 1) {
940 int test;
957 for (test = min; test >= 0 && test <= max; test++) {
961 * test numbers.
963 switch (test + __LINE__ + 1) {
1049 int test;
1052 for (test = min; test >= 0 && test <= max; test++) {
1056 * Add some more chars after the \0, to test functions that overwrite the buffer set
1064 * test numbers.
1066 switch (test + __LINE__ + 1) {
1080 CASE_TEST(strlcat_0); EXPECT_STRBUFEQ(1, strlcat(buf, "bar", 0), buf, 3, "test"); break;
1081 CASE_TEST(strlcat_1); EXPECT_STRBUFEQ(1, strlcat(buf, "bar", 1), buf, 4, "test"); break;
1082 CASE_TEST(strlcat_5); EXPECT_STRBUFEQ(1, strlcat(buf, "bar", 5), buf, 7, "test"); break;
1086 CASE_TEST(strlcpy_0); EXPECT_STRBUFEQ(1, strlcpy(buf, "bar", 0), buf, 3, "test"); break;
1207 int test;
1210 for (test = min; test >= 0 && test <= max; test++) {
1214 * test numbers.
1216 switch (test + __LINE__ + 1) {
1357 /* This is the definition of known test names, with their functions */
1358 static const struct test test_names[] = {
1368 static int is_setting_valid(char *test)
1373 if (!test)
1376 test_len = strlen(test);
1383 if (strncmp(test, test_names[idx].name, len) != 0)
1386 delimiter = test[len];
1404 char *test;
1421 * series of test names and optional ranges:
1424 test = argv[1];
1425 if (!is_setting_valid(test))
1426 test = getenv("NOLIBC_TEST");
1428 if (is_setting_valid(test)) {
1432 comma = strchr(test, ',');
1436 colon = strchr(test, ':');
1441 if (strcmp(test, test_names[idx].name) == 0)
1446 /* The test was named, it will be called at least
1473 /* now's time to call the test */
1474 printf("Running test '%s'\n", test_names[idx].name);
1477 printf("Errors during this test: %d\n\n", err);
1480 printf("Ignoring unknown test name '%s'\n", test);
1482 test = comma;
1483 } while (test && *test);
1485 /* no test mentioned, run everything */
1487 printf("Running test '%s'\n", test_names[idx].name);
1490 printf("Errors during this test: %d\n\n", err);