28 static void help(std::ostream &o) { o <<
"No help available for this command yet"; }
29 static void usage(
const std::string&
name, std::ostream &o) { o <<
name <<
": Not implemented yet"; }
45 struct Test_##F : public TestCase { Test_##F(int argc, char **argv) : TestCase(argc, argv) {} void test() { F(); } }; \
46 ToolFactory<Test_##F> test_##F(std::string("Test_") + #F);
48 #define TEST_FIXTURE(F, T) \
49 struct Test_##F##_##T : public F, public odc::tool::test::TestCase \
51 Test_##F##_##T(int argc, char **argv) : F(), odc::tool::test::TestCase(argc, argv) {} \
54 odc::tool::ToolFactory<Test_##F##_##T> test_##F##_##T(std::string("Test_") + #F + std::string("_") + #T); \
55 void Test_##F##_##T::test()
58 struct Test_##T : public odc::tool::test::TestCase \
60 Test_##T(int argc, char **argv) : odc::tool::test::TestCase(argc, argv) {} \
63 odc::tool::ToolFactory<Test_##T> test_##T(std::string("Test_") + #T); \
66 #define SIMPLE_TEST(name) \
67 struct Test_##name : public odc::tool::test::TestCase \
69 Test_##name(int argc, char **argv) : odc::tool::test::TestCase(argc, argv) {} \
70 void setUp() { ::setUp(); } \
71 void tearDown() { ::tearDown(); } \
72 void test() { ::test(); } \
74 odc::tool::ToolFactory<Test_##name> test_##name(std::string("Test_") + #name);
76 #define CHECK(expected) ASSERT(expected)
77 #define CHECK_EQUAL(expected, actual) ASSERT((expected) == (actual))
79 template <
typename Expected,
typename Actual>
84 equal &= (expected[
i] == actual[
i]);
88 #define CHECK_ARRAY_EQUAL(expected, actual, count) \
89 ASSERT(odc::tool::test::CheckArrayEqual(expected, actual, count))
static void count(void *counter, const double *data, size_t n)