IODA Bundle
TestCase.h File Reference
#include "Tool.h"
#include "ToolFactory.h"
Include dependency graph for TestCase.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

class  odc::tool::test::TestCase
 

Namespaces

 odc
 
 odc::tool
 
 odc::tool::test
 

Macros

#define TESTCASE(F)
 
#define TEST_FIXTURE(F, T)
 
#define TEST(T)
 
#define SIMPLE_TEST(name)
 
#define CHECK(expected)   ASSERT(expected)
 
#define CHECK_EQUAL(expected, actual)   ASSERT((expected) == (actual))
 
#define CHECK_ARRAY_EQUAL(expected, actual, count)   ASSERT(odc::tool::test::CheckArrayEqual(expected, actual, count))
 

Typedefs

typedef std::vector< TestCase * > odc::tool::test::TestCases
 

Functions

template<typename Expected , typename Actual >
bool odc::tool::test::CheckArrayEqual (const Expected &expected, const Actual &actual, const int count)
 

Detailed Description

Author
Piotr Kuchta, ECMWF, Feb 2009

Definition in file TestCase.h.

Macro Definition Documentation

◆ CHECK

#define CHECK (   expected)    ASSERT(expected)

Definition at line 76 of file TestCase.h.

◆ CHECK_ARRAY_EQUAL

#define CHECK_ARRAY_EQUAL (   expected,
  actual,
  count 
)    ASSERT(odc::tool::test::CheckArrayEqual(expected, actual, count))

Definition at line 88 of file TestCase.h.

◆ CHECK_EQUAL

#define CHECK_EQUAL (   expected,
  actual 
)    ASSERT((expected) == (actual))

Definition at line 77 of file TestCase.h.

◆ SIMPLE_TEST

#define SIMPLE_TEST (   name)
Value:
struct Test_##name : public odc::tool::test::TestCase \
{ \
Test_##name(int argc, char **argv) : odc::tool::test::TestCase(argc, argv) {} \
void setUp() { ::setUp(); } \
void tearDown() { ::tearDown(); } \
void test() { ::test(); } \
}; \
odc::tool::ToolFactory<Test_##name> test_##name(std::string("Test_") + #name);
std::string name()
Definition: Tool.h:34
virtual void test()
Definition: TestCase.cc:42
virtual void setUp()
Definition: TestCase.cc:41
virtual void tearDown()
Definition: TestCase.cc:43
Definition: ColumnInfo.h:23

Definition at line 66 of file TestCase.h.

◆ TEST

#define TEST (   T)
Value:
struct Test_##T : public odc::tool::test::TestCase \
{ \
Test_##T(int argc, char **argv) : odc::tool::test::TestCase(argc, argv) {} \
void test(); \
}; \
odc::tool::ToolFactory<Test_##T> test_##T(std::string("Test_") + #T); \
void Test_##T::test()
program test

Definition at line 57 of file TestCase.h.

◆ TEST_FIXTURE

#define TEST_FIXTURE (   F,
 
)
Value:
struct Test_##F##_##T : public F, public odc::tool::test::TestCase \
{ \
Test_##F##_##T(int argc, char **argv) : F(), odc::tool::test::TestCase(argc, argv) {} \
void test(); \
}; \
odc::tool::ToolFactory<Test_##F##_##T> test_##F##_##T(std::string("Test_") + #F + std::string("_") + #T); \
void Test_##F##_##T::test()

Definition at line 48 of file TestCase.h.

◆ TESTCASE

#define TESTCASE (   F)
Value:
struct Test_##F : public TestCase { Test_##F(int argc, char **argv) : TestCase(argc, argv) {} void test() { F(); } }; \
ToolFactory<Test_##F> test_##F(std::string("Test_") + #F);

Definition at line 44 of file TestCase.h.