ADTF
3.18.2
|
Copyright © Audi Electronics Venture GmbH. More...
Go to the source code of this file.
Namespaces | |
A_UTILS_NS | |
ADTF A_UTIL Namespace - Within adtf this is used as adtf::util or adtf_util. | |
Macros | |
#define | __a_utils_test_assert(_msg, _expr) _assert((_expr), __FILE__, __LINE__) |
This macro creates an assertion if the expression fails using the given message. More... | |
#define | __a_utils_test_report(_msg) _assert(false, __FILE__, __LINE__) |
This macro creates an assertion using the given message. More... | |
#define | __a_utils_test_log(_msg) printf("%s(%d) %s\n", __FILE__, __LINE__, A_UTILS_NS::cString(_msg).GetPtr()) |
This macro logs the given message to the standard output. More... | |
#define | __a_utils_log_test_fail(_msg, _expr, _umsg) |
Logs a failed test and trows an exception. More... | |
#define | __a_utils_log_test_succ(_msg, _expr, _umsg) |
Logs a successful test. More... | |
#define | __a_utils_log_test(_msg, _expr) |
This macro. More... | |
#define | __a_utils_log_test_ext(_msg, _expr, _umsg) |
This macro. More... | |
#define | __a_utils_test(_expr) __a_utils_log_test("test failed: (" #_expr ")", (_expr)) |
This macro checks if the return value of the expression is true (bool) More... | |
#define | __a_utils_test_err(_expr) __a_utils_log_test("bad case test failed: (" #_expr ")", (!(_expr))) |
This macro checks if the return value of the expression is false (bool). More... | |
#define | __a_utils_test_result(_expr) |
This macro checks the return value of the expression for equality to ERR_NOERROR (tResult) To report the result the __a_utils_log_test macro is used. More... | |
#define | __a_utils_test_err_result(_expr) __a_utils_log_test("bad case test failed: IS_FAILED(" #_expr ")", (IS_FAILED(_expr))) |
This macro checks the return value of the expression for inequality to ERR_NOERROR (tResult) To report the result the __a_utils_log_test macro is used. More... | |
#define | __a_utils_test_pointer(_ptr) __a_utils_log_test("test failed: (" #_ptr " != nullptr)", ((_ptr)!=nullptr)) |
This macro checks the pointer to inequality to nullptr To report the result the __a_utils_log_test macro is used. More... | |
#define | __a_utils_test_pointer_null(_ptr) __a_utils_log_test("bad case test failed: (" #_ptr " != nullptr)", ((_ptr)==nullptr)) |
This macro checks the pointer to equality to nullptr To report the result the __a_utils_log_test macro is used. More... | |
#define | __a_utils_test_ext(_expr, _msg) __a_utils_log_test_ext("test failed: (" #_expr ")", (_expr), (_msg)) |
The same as __a_utils_test with an additional message To report the result the __a_utils_log_test_ext macro is used. More... | |
#define | __a_utils_test_err_ext(_expr, _msg) __a_utils_log_test_ext("bad case test failed: (" #_expr ")", (!(_expr)), (_msg)) |
The same as __a_utils_test_err with an additional message. More... | |
#define | __a_utils_test_result_ext(_expr, _msg) |
The same as __a_utils_test_result with an additional message. More... | |
#define | __a_utils_test_err_result_ext(_expr, _msg) __a_utils_log_test_ext("bad case test failed: IS_FAILED(" #_expr ")", (IS_FAILED(_expr)), (_msg)) |
The same as __a_utils_test_err_result with an additional message. More... | |
#define | __a_utils_test_pointer_ext(_ptr, _msg) __a_utils_log_test_ext("test failed: (" #_ptr " != nullptr)", ((_ptr)!=nullptr), (_msg)) |
The same as __a_utils_test_pointer with an additional message. More... | |
#define | __a_utils_test_pointer_null_ext(_ptr, _msg) __a_utils_log_test_ext("bad case test failed: (" #_ptr " != nullptr)", ((_ptr)==nullptr), (_msg)) |
The same as __a_utils_test_pointer_null with an additional message. More... | |
#define | __a_utils_test_file_exists(_filename) __a_utils_test_ext(A_UTILS_NS::cFileSystem::Exists(_filename), _filename + A_UTILS_NS::cString(" does not exist")); |
The macro checks if the given file with the filename does exist. More... | |
#define | DECLARE_TESTER_FRIEND(_tester, _whitebox) |
This macro declares a new class base on class /a _whitebox which is friend of class /a _tester. More... | |
#define | __a_utils_test_friend(_whitebox) _testable_##_whitebox |
This macro defines the name of the whitebox test class based on class /a _whitebox. | |
#define | RETURN_TEST_NOERROR |
This macro returns value if test is OK. More... | |
#define | RETURN_TEST_ERROR(_code) |
This macro returns _code if test failes. More... | |
#define | DECLARE_TESTER_CLASS(_classname) class _classname : public ITester |
This macro has to be used to declare a new tester class. More... | |
#define | BEGIN_TESTER_MAP(_classname) |
This macro creates the tester map. More... | |
#define | DECLARE_TESTER_FUNCTION(_func) |
This macro defines a test that will be executed. More... | |
#define | END_TESTER_MAP() |
This macro closes the tester map. More... | |
#define | DECLARE_TESTER_CLASS(_classname) class _classname : public ITester |
This macro has to be used to declare a new tester class. More... | |
#define | IMPLEMENT_TESTER_CLASS(_classname, _id, _title, _desc, _req) |
This macro implements a conrete test class / test group. More... | |
#define __a_utils_log_test | ( | _msg, | |
_expr | |||
) |
This macro.
[in] | _msg | Additional information which will be logged |
[in] | _expr | The expression which will be executed |
Definition at line 333 of file testmacros.h.
#define __a_utils_log_test_ext | ( | _msg, | |
_expr, | |||
_umsg | |||
) |
This macro.
[in] | _msg | Additional information which will be logged |
[in] | _expr | The expression which will be executed |
[in] | _umsg | User defined message |
Definition at line 351 of file testmacros.h.
#define __a_utils_log_test_fail | ( | _msg, | |
_expr, | |||
_umsg | |||
) |
Logs a failed test and trows an exception.
[in] | _msg | Additional information which will be logged |
[in] | _expr | The expression which failed |
[in] | _umsg | Additional message that is logged (can be nullptr) |
Definition at line 309 of file testmacros.h.
#define __a_utils_log_test_succ | ( | _msg, | |
_expr, | |||
_umsg | |||
) |
Logs a successful test.
[in] | _msg | Additional information which will be logged |
[in] | _expr | The expression which failed |
[in] | _umsg | Additional message that is logged (can be nullptr) |
Definition at line 321 of file testmacros.h.
#define __a_utils_test | ( | _expr | ) | __a_utils_log_test("test failed: (" #_expr ")", (_expr)) |
This macro checks if the return value of the expression is true (bool)
[in] | _expr | The expression which will be executed |
Definition at line 368 of file testmacros.h.
#define __a_utils_test_assert | ( | _msg, | |
_expr | |||
) | _assert((_expr), __FILE__, __LINE__) |
This macro creates an assertion if the expression fails using the given message.
[in] | _msg | Additional information which will be logged |
[in] | _expr | The expression which will be executed |
Definition at line 66 of file testmacros.h.
#define __a_utils_test_err | ( | _expr | ) | __a_utils_log_test("bad case test failed: (" #_expr ")", (!(_expr))) |
This macro checks if the return value of the expression is false (bool).
To report the result the __a_utils_log_test macro is used.
[in] | _expr | The expression which will be executed |
Definition at line 379 of file testmacros.h.
#define __a_utils_test_err_ext | ( | _expr, | |
_msg | |||
) | __a_utils_log_test_ext("bad case test failed: (" #_expr ")", (!(_expr)), (_msg)) |
The same as __a_utils_test_err with an additional message.
[in] | _expr | The expression which will be executed |
[in] | _msg | Additional information which will be logged |
Definition at line 457 of file testmacros.h.
#define __a_utils_test_err_result | ( | _expr | ) | __a_utils_log_test("bad case test failed: IS_FAILED(" #_expr ")", (IS_FAILED(_expr))) |
This macro checks the return value of the expression for inequality to ERR_NOERROR (tResult) To report the result the __a_utils_log_test macro is used.
[in] | _expr | The expression which will be executed |
Definition at line 412 of file testmacros.h.
#define __a_utils_test_err_result_ext | ( | _expr, | |
_msg | |||
) | __a_utils_log_test_ext("bad case test failed: IS_FAILED(" #_expr ")", (IS_FAILED(_expr)), (_msg)) |
The same as __a_utils_test_err_result with an additional message.
[in] | _expr | The expression which will be executed |
[in] | _msg | Additional information which will be logged |
Definition at line 490 of file testmacros.h.
#define __a_utils_test_ext | ( | _expr, | |
_msg | |||
) | __a_utils_log_test_ext("test failed: (" #_expr ")", (_expr), (_msg)) |
The same as __a_utils_test with an additional message To report the result the __a_utils_log_test_ext macro is used.
[in] | _expr | The expression which will be executed |
[in] | _msg | Additional information which will be logged |
Definition at line 446 of file testmacros.h.
#define __a_utils_test_file_exists | ( | _filename | ) | __a_utils_test_ext(A_UTILS_NS::cFileSystem::Exists(_filename), _filename + A_UTILS_NS::cString(" does not exist")); |
The macro checks if the given file with the filename does exist.
To report the result the __a_utils_test_ext macro is used.
[in] | _filename | The filename which will be checked |
Definition at line 523 of file testmacros.h.
#define __a_utils_test_log | ( | _msg | ) | printf("%s(%d) %s\n", __FILE__, __LINE__, A_UTILS_NS::cString(_msg).GetPtr()) |
This macro logs the given message to the standard output.
[in] | _msg | Additional information which will be logged |
Definition at line 86 of file testmacros.h.
#define __a_utils_test_pointer | ( | _ptr | ) | __a_utils_log_test("test failed: (" #_ptr " != nullptr)", ((_ptr)!=nullptr)) |
This macro checks the pointer to inequality to nullptr To report the result the __a_utils_log_test macro is used.
[in] | _ptr | The pointer which will be checked |
Definition at line 423 of file testmacros.h.
#define __a_utils_test_pointer_ext | ( | _ptr, | |
_msg | |||
) | __a_utils_log_test_ext("test failed: (" #_ptr " != nullptr)", ((_ptr)!=nullptr), (_msg)) |
The same as __a_utils_test_pointer with an additional message.
[in] | _ptr | The pointer which will be checked |
[in] | _msg | Additional information which will be logged |
Definition at line 501 of file testmacros.h.
#define __a_utils_test_pointer_null | ( | _ptr | ) | __a_utils_log_test("bad case test failed: (" #_ptr " != nullptr)", ((_ptr)==nullptr)) |
This macro checks the pointer to equality to nullptr To report the result the __a_utils_log_test macro is used.
[in] | _ptr | The pointer which will be checked |
Definition at line 434 of file testmacros.h.
#define __a_utils_test_pointer_null_ext | ( | _ptr, | |
_msg | |||
) | __a_utils_log_test_ext("bad case test failed: (" #_ptr " != nullptr)", ((_ptr)==nullptr), (_msg)) |
The same as __a_utils_test_pointer_null with an additional message.
[in] | _ptr | The pointer which will be checked |
[in] | _msg | Additional information which will be logged |
Definition at line 512 of file testmacros.h.
#define __a_utils_test_report | ( | _msg | ) | _assert(false, __FILE__, __LINE__) |
This macro creates an assertion using the given message.
[in] | _msg | Additional information which will be logged |
Definition at line 76 of file testmacros.h.
#define __a_utils_test_result | ( | _expr | ) |
This macro checks the return value of the expression for equality to ERR_NOERROR (tResult) To report the result the __a_utils_log_test macro is used.
[in] | _expr | The expression which will be executed |
Definition at line 390 of file testmacros.h.
#define __a_utils_test_result_ext | ( | _expr, | |
_msg | |||
) |
The same as __a_utils_test_result with an additional message.
[in] | _expr | The expression which will be executed |
[in] | _msg | Additional information which will be logged |
Definition at line 468 of file testmacros.h.
#define BEGIN_TESTER_MAP | ( | _classname | ) |
This macro creates the tester map.
all tests that will be executed are inserted between BEGIN_TESTER_MAP and END_TESTER_MAP
[in] | _classname | name of the test implementation class |
Definition at line 584 of file testmacros.h.
#define DECLARE_TESTER_CLASS | ( | _classname | ) | class _classname : public ITester |
This macro has to be used to declare a new tester class.
This macro creates the basic testclass implementation.
This has to be done at least once for a test.
[in] | _classname | The class name i.e. cTesterAlsaPlayback |
[in] | _classname | The class which includes the test cases (functions) |
Definition at line 633 of file testmacros.h.
#define DECLARE_TESTER_CLASS | ( | _classname | ) | class _classname : public ITester |
This macro has to be used to declare a new tester class.
This macro creates the basic testclass implementation.
This has to be done at least once for a test.
[in] | _classname | The class name i.e. cTesterAlsaPlayback |
[in] | _classname | The class which includes the test cases (functions) |
Definition at line 633 of file testmacros.h.
#define DECLARE_TESTER_FRIEND | ( | _tester, | |
_whitebox | |||
) |
This macro declares a new class base on class /a _whitebox which is friend of class /a _tester.
Definition at line 536 of file testmacros.h.
#define DECLARE_TESTER_FUNCTION | ( | _func | ) |
This macro defines a test that will be executed.
[in] | _func | The name of the test function |
Definition at line 597 of file testmacros.h.
#define END_TESTER_MAP | ( | ) |
This macro closes the tester map.
Definition at line 622 of file testmacros.h.
#define IMPLEMENT_TESTER_CLASS | ( | _classname, | |
_id, | |||
_title, | |||
_desc, | |||
_req | |||
) |
This macro implements a conrete test class / test group.
[in] | _classname | Name of the testclass |
[in] | _id | Identifier of the group |
[in] | _title | Title of the group |
[in] | _desc | Provides a short description |
[in] | _req | Links to the related requirements |
Definition at line 733 of file testmacros.h.
#define RETURN_TEST_ERROR | ( | _code | ) |
This macro returns _code if test failes.
[in] | _code | return code |
Definition at line 563 of file testmacros.h.
#define RETURN_TEST_NOERROR |
This macro returns value if test is OK.
Definition at line 554 of file testmacros.h.