Elm
1.0
ELM is a library providing generic data structures, OS-independent interface, plugins and XML.
|
Classes | |
class | elm::BitVector |
class | elm::HashKey< T > |
class | elm::Initializer< T > |
class | elm::MessageException |
class | elm::Option< T > |
class | elm::Pair< T1, T2 > |
class | elm::Ref< T > |
class | elm::TestCase |
class | elm::TestSet |
class | elm::VarArg |
class | elm::Version |
class | elm::Exception |
Macros | |
#define | STRONG_TYPE(N, T) OTAWA_STRONG_TYPE(N, T) |
#define | CHECK_BEGIN(name) ELM_CHECK_BEGIN(name) |
#define | TEST_BEGIN(name) ELM_TEST_BEGIN(name) |
#define | TEST_END ELM_TEST_END |
#define | CHECK(tst) ELM_CHECK(tst) |
#define | CHECK_END ELM_CHECK_END |
#define | ELM_CHECK_BEGIN(name) { elm::TestCase __case(name); __case.prepare(); |
#define | ELM_CHECK(tst) __case.check(__FILE__, __LINE__, #tst, tst) |
#define | ELM_CHECK_END __case.complete(); } |
#define | ELM_CHECK_EQUAL(res, ref) __case.check_equal(__FILE__, __LINE__, #res " == " #ref, res, ref) |
#define | CHECK_EQUAL(res, ref) ELM_CHECK_EQUAL(res, ref) |
This module contains classes providing miscalleneous services.
Other classes provides base classes to a unified exception system:
Some classes makes easier the management of structured values:
Finally, some classes provides facilities to handle references:
#define CHECK | ( | tst | ) | ELM_CHECK(tst) |
See ELM_CHECK.
test | Test to check. |
ELM_CHECK, REQUIRE, CHECK_EQUAL, CHECK_EXCEPTION, FAIL_ON_EXCEPTION
#define CHECK_BEGIN | ( | name | ) | ELM_CHECK_BEGIN(name) |
This is the first statement of a unit test case. Usually, a unit test case is structured as below:
This statement display a state header, each CHECK displays a check status line and TEST_END a summary of the full test case. A test case defines also an environment like in C blocks { ... }.
name | Name of the test case (string). |
#define CHECK_END ELM_CHECK_END |
#define CHECK_EQUAL | ( | res, | |
ref | |||
) | ELM_CHECK_EQUAL(res, ref) |
See ELM_CHECK_EQUAL.
#define ELM_CHECK | ( | tst | ) | __case.check(__FILE__, __LINE__, #tst, tst) |
Same as CHECK.
#define ELM_CHECK_BEGIN | ( | name | ) | { elm::TestCase __case(name); __case.prepare(); |
Same as CHECK_BEGIN.
#define ELM_CHECK_END __case.complete(); } |
Same as CHECK_END
#define ELM_CHECK_EQUAL | ( | res, | |
ref | |||
) | __case.check_equal(__FILE__, __LINE__, #res " == " #ref, res, ref) |
Test if the result of a test is equal to a reference value.
res | Result of the test. |
ref | Reference value. |
CHECK, REQUIRE, CHECK_EXCEPTION, FAIL_ON_EXCEPTION
#define STRONG_TYPE | ( | N, | |
T | |||
) | OTAWA_STRONG_TYPE(N, T) |
As type defined with "typedef" command just create aliases to types, they cannot be used to resolve overloading. To circumvent this problem, this macro provide a wrapper around the defined type that is usable as the original type and that provide overload facilities.
This class is usually replace this kind of declaration:
by :
N | Name of the new type. |
T | Encapsulated type. |
#define TEST_BEGIN | ( | name | ) | ELM_TEST_BEGIN(name) |
This macro is used to create and to record an integrated test case. Following the macro must be inserted the checked tests with macros based on CHECK and the test must be ended by the macro TEST_END.
test | Name of the test (must be unquoted !). |
#define TEST_END ELM_TEST_END |
End a test declared with TEST_BEGIN.