SST/macro
|
#include <vector>
#include <iostream>
#include <string.h>
#include <sprockit/test/output.h>
#include <sprockit/test/equality.h>
#include <sprockit/test/container.h>
#include <sprockit/test/fxn.h>
#include <sprockit/spkt_string.h>
Go to the source code of this file.
Classes | |
class | TestCase |
class | TestCase_impl< T > |
class | UnitTest |
class | AssertEqual< T, A > |
class | AssertEqual< T, T > |
class | AssertEqual< std::vector< T >, A > |
class | AssertEqual< std::vector< T >, std::vector< T > > |
class | ExceptionTestCase |
Macros | |
#define | THIS_FILE truncate_file(__FILE__) |
#define | SPROCKIT_RUN_TEST(fxn, unit_tester, ...) |
#define | SPROCKIT_RUN_TEST_NO_ARGS(fxn, unit_tester) |
#define | assertThrows(test_set, descr, exc, fxn) assertThrows_impl<exc>(test_set, descr, THIS_FILE, __LINE__, #exc, fxn) |
#define | assertEqual(test_set, descr, ...) _assertEqual(test_set, descr, THIS_FILE, __LINE__, __VA_ARGS__) |
#define | assertNotEqual(test_set, descr, ...) _assertNotEqual(test_set, descr, THIS_FILE, __LINE__, __VA_ARGS__) |
#define | assertTrue(test_set, descr, ...) _assertTrue(test_set, descr, THIS_FILE, __LINE__, __VA_ARGS__) |
#define | assertFalse(test_set, descr, ...) _assertFalse(test_set, descr, THIS_FILE, __LINE__, __VA_ARGS__) |
Functions | |
const char * | truncate_file (const char *file) |
void | _assertFalse (UnitTest &test_set, const char *descr, const char *file, int line, bool test) |
void | _assertTrue (UnitTest &test_set, const char *descr, const char *file, int line, bool test) |
template<class T , class A > | |
void | _assertEqual (UnitTest &test_set, const char *descr, const char *file, int line, const T &test, const A &asserted, bool should_be_equal) |
template<class T , class A > | |
void | _assertEqual (UnitTest &test_set, const char *descr, const char *file, int line, const T &test, const A &assert1, const A &assert2, bool should_be_equal) |
template<class T , class A > | |
void | _assertEqual (UnitTest &test_set, const char *descr, const char *file, int line, const T &test, const A &assert1, const A &assert2, const A &assert3, bool should_be_equal) |
template<class T , class A > | |
void | _assertEqual (UnitTest &test_set, const char *descr, const char *file, int line, const T &test, const A &assert1, const A &assert2, const A &assert3, const A &assert4, bool should_be_equal) |
template<class T , class A > | |
void | _assertEqual (UnitTest &test_set, const char *descr, const char *file, int line, const T &test, const A &assert1, const A &assert2, const A &assert3, const A &assert4, const A &assert5, bool should_be_equal) |
template<class T , class A > | |
void | _assertEqual (UnitTest &test_set, const char *descr, const char *file, int line, const T &test, const A &assert1, const A &assert2, const A &assert3, const A &assert4, const A &assert5, const A &assert6, bool should_be_equal) |
template<class T , class A > | |
void | _assertEqual (UnitTest &test_set, const char *descr, const char *file, int line, const T &test, const A &asserted) |
template<class T , class A > | |
void | _assertEqual (UnitTest &test_set, const char *descr, const char *file, int line, const T &test, const A &assert1, const A &assert2) |
template<class T , class A > | |
void | _assertEqual (UnitTest &test_set, const char *descr, const char *file, int line, const T &test, const A &assert1, const A &assert2, const A &assert3) |
template<class T , class A > | |
void | _assertEqual (UnitTest &test_set, const char *descr, const char *file, int line, const T &test, const A &assert1, const A &assert2, const A &assert3, const A &assert4) |
template<class T , class A > | |
void | _assertEqual (UnitTest &test_set, const char *descr, const char *file, int line, const T &test, const A &assert1, const A &assert2, const A &assert3, const A &assert4, const A &assert5) |
template<class T , class A > | |
void | _assertEqual (UnitTest &test_set, const char *descr, const char *file, int line, const T &test, const A &assert1, const A &assert2, const A &assert3, const A &assert4, const A &assert5, const A &assert6) |
template<class T , class A > | |
void | _assertNotEqual (UnitTest &test_set, const char *descr, const char *file, int line, const T &test, const A &asserted) |
template<class T , class A > | |
void | _assertNotEqual (UnitTest &test_set, const char *descr, const char *file, int line, const T &test, const A &assert1, const A &assert2) |
template<class T , class A > | |
void | _assertNotEqual (UnitTest &test_set, const char *descr, const char *file, int line, const T &test, const A &assert1, const A &assert2, const A &assert3) |
template<class T , class A > | |
void | _assertNotEqual (UnitTest &test_set, const char *descr, const char *file, int line, const T &test, const A &assert1, const A &assert2, const A &assert3, const A &assert4) |
template<class T , class A > | |
void | _assertNotEqual (UnitTest &test_set, const char *descr, const char *file, int line, const T &test, const A &assert1, const A &assert2, const A &assert3, const A &assert4, const A &assert5) |
template<class T , class A > | |
void | _assertNotEqual (UnitTest &test_set, const char *descr, const char *file, int line, const T &test, const A &assert1, const A &assert2, const A &assert3, const A &assert4, const A &assert5, const A &assert6) |
template<class Exc > | |
void | assertThrows_impl (UnitTest &test_set, const char *descr, const char *file, int line, const char *exc, TestFxn *fxn) |
#define assertEqual | ( | test_set, | |
descr, | |||
... | |||
) | _assertEqual(test_set, descr, THIS_FILE, __LINE__, __VA_ARGS__) |
#define assertFalse | ( | test_set, | |
descr, | |||
... | |||
) | _assertFalse(test_set, descr, THIS_FILE, __LINE__, __VA_ARGS__) |
#define assertNotEqual | ( | test_set, | |
descr, | |||
... | |||
) | _assertNotEqual(test_set, descr, THIS_FILE, __LINE__, __VA_ARGS__) |
#define assertThrows | ( | test_set, | |
descr, | |||
exc, | |||
fxn | |||
) | assertThrows_impl<exc>(test_set, descr, THIS_FILE, __LINE__, #exc, fxn) |
#define assertTrue | ( | test_set, | |
descr, | |||
... | |||
) | _assertTrue(test_set, descr, THIS_FILE, __LINE__, __VA_ARGS__) |
#define SPROCKIT_RUN_TEST | ( | fxn, | |
unit_tester, | |||
... | |||
) |
#define SPROCKIT_RUN_TEST_NO_ARGS | ( | fxn, | |
unit_tester | |||
) |
#define THIS_FILE truncate_file(__FILE__) |
void _assertEqual | ( | UnitTest & | test_set, |
const char * | descr, | ||
const char * | file, | ||
int | line, | ||
const T & | test, | ||
const A & | asserted, | ||
bool | should_be_equal | ||
) |
Definition at line 195 of file test.h.
References AssertEqual< T, A >::add_test().
Referenced by _assertEqual(), and _assertNotEqual().
void _assertEqual | ( | UnitTest & | test_set, |
const char * | descr, | ||
const char * | file, | ||
int | line, | ||
const T & | test, | ||
const A & | assert1, | ||
const A & | assert2, | ||
bool | should_be_equal | ||
) |
Definition at line 208 of file test.h.
References AssertEqual< T, A >::add_test(), and ContainerAppend< C, A >::append().
void _assertEqual | ( | UnitTest & | test_set, |
const char * | descr, | ||
const char * | file, | ||
int | line, | ||
const T & | test, | ||
const A & | assert1, | ||
const A & | assert2, | ||
const A & | assert3, | ||
bool | should_be_equal | ||
) |
Definition at line 225 of file test.h.
References AssertEqual< T, A >::add_test(), and ContainerAppend< C, A >::append().
void _assertEqual | ( | UnitTest & | test_set, |
const char * | descr, | ||
const char * | file, | ||
int | line, | ||
const T & | test, | ||
const A & | assert1, | ||
const A & | assert2, | ||
const A & | assert3, | ||
const A & | assert4, | ||
bool | should_be_equal | ||
) |
Definition at line 244 of file test.h.
References AssertEqual< T, A >::add_test(), and ContainerAppend< C, A >::append().
void _assertEqual | ( | UnitTest & | test_set, |
const char * | descr, | ||
const char * | file, | ||
int | line, | ||
const T & | test, | ||
const A & | assert1, | ||
const A & | assert2, | ||
const A & | assert3, | ||
const A & | assert4, | ||
const A & | assert5, | ||
bool | should_be_equal | ||
) |
Definition at line 265 of file test.h.
References AssertEqual< T, A >::add_test(), and ContainerAppend< C, A >::append().
void _assertEqual | ( | UnitTest & | test_set, |
const char * | descr, | ||
const char * | file, | ||
int | line, | ||
const T & | test, | ||
const A & | assert1, | ||
const A & | assert2, | ||
const A & | assert3, | ||
const A & | assert4, | ||
const A & | assert5, | ||
const A & | assert6, | ||
bool | should_be_equal | ||
) |
Definition at line 288 of file test.h.
References AssertEqual< T, A >::add_test(), and ContainerAppend< C, A >::append().
void _assertEqual | ( | UnitTest & | test_set, |
const char * | descr, | ||
const char * | file, | ||
int | line, | ||
const T & | test, | ||
const A & | asserted | ||
) |
Definition at line 313 of file test.h.
References _assertEqual().
void _assertEqual | ( | UnitTest & | test_set, |
const char * | descr, | ||
const char * | file, | ||
int | line, | ||
const T & | test, | ||
const A & | assert1, | ||
const A & | assert2 | ||
) |
Definition at line 324 of file test.h.
References _assertEqual().
void _assertEqual | ( | UnitTest & | test_set, |
const char * | descr, | ||
const char * | file, | ||
int | line, | ||
const T & | test, | ||
const A & | assert1, | ||
const A & | assert2, | ||
const A & | assert3 | ||
) |
Definition at line 336 of file test.h.
References _assertEqual().
void _assertEqual | ( | UnitTest & | test_set, |
const char * | descr, | ||
const char * | file, | ||
int | line, | ||
const T & | test, | ||
const A & | assert1, | ||
const A & | assert2, | ||
const A & | assert3, | ||
const A & | assert4 | ||
) |
Definition at line 350 of file test.h.
References _assertEqual().
void _assertEqual | ( | UnitTest & | test_set, |
const char * | descr, | ||
const char * | file, | ||
int | line, | ||
const T & | test, | ||
const A & | assert1, | ||
const A & | assert2, | ||
const A & | assert3, | ||
const A & | assert4, | ||
const A & | assert5 | ||
) |
Definition at line 365 of file test.h.
References _assertEqual().
void _assertEqual | ( | UnitTest & | test_set, |
const char * | descr, | ||
const char * | file, | ||
int | line, | ||
const T & | test, | ||
const A & | assert1, | ||
const A & | assert2, | ||
const A & | assert3, | ||
const A & | assert4, | ||
const A & | assert5, | ||
const A & | assert6 | ||
) |
Definition at line 381 of file test.h.
References _assertEqual().
void _assertFalse | ( | UnitTest & | test_set, |
const char * | descr, | ||
const char * | file, | ||
int | line, | ||
bool | test | ||
) |
void _assertNotEqual | ( | UnitTest & | test_set, |
const char * | descr, | ||
const char * | file, | ||
int | line, | ||
const T & | test, | ||
const A & | asserted | ||
) |
Definition at line 398 of file test.h.
References _assertEqual().
void _assertNotEqual | ( | UnitTest & | test_set, |
const char * | descr, | ||
const char * | file, | ||
int | line, | ||
const T & | test, | ||
const A & | assert1, | ||
const A & | assert2 | ||
) |
Definition at line 409 of file test.h.
References _assertEqual().
void _assertNotEqual | ( | UnitTest & | test_set, |
const char * | descr, | ||
const char * | file, | ||
int | line, | ||
const T & | test, | ||
const A & | assert1, | ||
const A & | assert2, | ||
const A & | assert3 | ||
) |
Definition at line 421 of file test.h.
References _assertEqual().
void _assertNotEqual | ( | UnitTest & | test_set, |
const char * | descr, | ||
const char * | file, | ||
int | line, | ||
const T & | test, | ||
const A & | assert1, | ||
const A & | assert2, | ||
const A & | assert3, | ||
const A & | assert4 | ||
) |
Definition at line 435 of file test.h.
References _assertEqual().
void _assertNotEqual | ( | UnitTest & | test_set, |
const char * | descr, | ||
const char * | file, | ||
int | line, | ||
const T & | test, | ||
const A & | assert1, | ||
const A & | assert2, | ||
const A & | assert3, | ||
const A & | assert4, | ||
const A & | assert5 | ||
) |
Definition at line 450 of file test.h.
References _assertEqual().
void _assertNotEqual | ( | UnitTest & | test_set, |
const char * | descr, | ||
const char * | file, | ||
int | line, | ||
const T & | test, | ||
const A & | assert1, | ||
const A & | assert2, | ||
const A & | assert3, | ||
const A & | assert4, | ||
const A & | assert5, | ||
const A & | assert6 | ||
) |
Definition at line 466 of file test.h.
References _assertEqual().
void _assertTrue | ( | UnitTest & | test_set, |
const char * | descr, | ||
const char * | file, | ||
int | line, | ||
bool | test | ||
) |
void assertThrows_impl | ( | UnitTest & | test_set, |
const char * | descr, | ||
const char * | file, | ||
int | line, | ||
const char * | exc, | ||
TestFxn * | fxn | ||
) |
Definition at line 545 of file test.h.
References UnitTest::append(), and TestFxn::run().
const char* truncate_file | ( | const char * | file | ) |