![]() |
Shamrock 2025.10.0
Astrophysical Code
|
Class to hold the list of assertion related to a test. More...
#include <shamtest/details/TestAssertList.hpp>
Collaboration diagram for shamtest::details::TestAssertList:Public Member Functions | |
| void | assert_bool_with_log (std::string assert_name, bool v, std::string log) |
| void | assert_bool (std::string assert_name, bool v, SourceLocation loc=SourceLocation{}) |
| Test if the supplied boolean is true. | |
| template<class T1 , class T2 > | |
| void | assert_equal (std::string assert_name, T1 a, T2 b, SourceLocation loc=SourceLocation{}) |
| Test for an equality. | |
| template<class Acca , class Accb > | |
| void | assert_equal_array (std::string assert_name, Acca &acc_a, Accb &acc_b, u32 len, SourceLocation loc=SourceLocation{}) |
| Assert equal on an array of values. | |
| void | assert_float_equal (std::string assert_name, f64 a, f64 b, f64 eps, SourceLocation loc=SourceLocation{}) |
| Add an assertion testing a floating point equality up to precision eps. | |
| void | assert_add_comment (std::string assert_name, bool v, std::string comment, SourceLocation loc=SourceLocation{}) |
| add an assertion with a comment | |
| std::string | serialize_json () |
| Serialize the assertion in JSON. | |
| void | serialize (std::basic_stringstream< byte > &stream) |
| Serialize the assertion in binary format. | |
| u32 | get_assert_count () |
| Get number of assertion in the list. | |
| u32 | get_assert_success_count () |
| Get the number of successful assertions. | |
Static Public Member Functions | |
| static std::string | gen_comment (std::string s, SourceLocation loc) |
| Append the source location to the the supplied string to generate a comment. | |
| static TestAssertList | deserialize (std::basic_stringstream< byte > &reader) |
| DeSerialize the assertion from binary format. | |
Public Attributes | |
| std::vector< TestAssert > | asserts |
| List of assertion held by the class. | |
Class to hold the list of assertion related to a test.
Definition at line 26 of file TestAssertList.hpp.
|
inline |
add an assertion with a comment
Definition at line 124 of file TestAssertList.hpp.
|
inline |
Test if the supplied boolean is true.
Definition at line 45 of file TestAssertList.hpp.
|
inline |
Definition at line 34 of file TestAssertList.hpp.
|
inline |
Test for an equality.
Definition at line 58 of file TestAssertList.hpp.
|
inline |
Assert equal on an array of values.
Definition at line 74 of file TestAssertList.hpp.
|
inline |
Add an assertion testing a floating point equality up to precision eps.
| assert_name | name of the assertion |
| a | value a |
| b | value b |
| eps | precision of the test |
| loc | source location of the call |
Definition at line 108 of file TestAssertList.hpp.
|
static |
DeSerialize the assertion from binary format.
Definition at line 42 of file TestAssertList.cpp.
Here is the call graph for this function:
|
inlinestatic |
Append the source location to the the supplied string to generate a comment.
Definition at line 39 of file TestAssertList.hpp.
Here is the call graph for this function:
|
inline |
Get number of assertion in the list.
Definition at line 140 of file TestAssertList.hpp.
|
inline |
Get the number of successful assertions.
Definition at line 143 of file TestAssertList.hpp.
| void shamtest::details::TestAssertList::serialize | ( | std::basic_stringstream< byte > & | stream | ) |
Serialize the assertion in binary format.
Definition at line 38 of file TestAssertList.cpp.
Here is the call graph for this function:| std::string shamtest::details::TestAssertList::serialize_json | ( | ) |
Serialize the assertion in JSON.
Definition at line 24 of file TestAssertList.cpp.
Here is the call graph for this function:| std::vector<TestAssert> shamtest::details::TestAssertList::asserts |
List of assertion held by the class.
Definition at line 29 of file TestAssertList.hpp.