diff options
Diffstat (limited to 'cpp/001test')
-rw-r--r-- | cpp/001test | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/cpp/001test b/cpp/001test index 92cbe9cf..12352de1 100644 --- a/cpp/001test +++ b/cpp/001test @@ -64,13 +64,17 @@ if (argc > 2 && is_equal(argv[1], "test")) { void run_tests() { time_t t; time(&t); cerr << "C tests: " << ctime(&t); - for (unsigned long i=0; i < sizeof(Tests)/sizeof(Tests[0]); ++i) { + for (size_t i=0; i < sizeof(Tests)/sizeof(Tests[0]); ++i) { run_test(i); } // End Tests } -void run_test(int i) { +void run_test(size_t i) { + if (i >= sizeof(Tests)/sizeof(Tests[0])) { + cerr << "no test " << i << '\n'; + return; + } setup(); // End Test Setup (*Tests[i])(); |