-
Notifications
You must be signed in to change notification settings - Fork 4
unit.reference
This macro yields a logical true
(might be int
) if the last check was unsuccsessful.
\par Example
std::string str = get_str();
METAL_EXPECT(str.empty());
if (METAL_ERROR())
METAL_LOG("Empty String");
See also
This macro yields a logical true
(might be int
) if the last check was succsessful.
\par Example
const char * str = get_str();
METAL_EXPECT_NOT_EQUAL(str, nullptr);
if (METAL_STATUS())
{
const char cmp[15] = "compare string";
METAL_ASSERT_EQUAL_RANGED(str, str + std::strlen(str), cmp, cmp + 15);
}
See also
This macro yields a logical true
(might be int
) if an error occured anywhere up to this point.
\par Example
METAL_CALL(&my_test_case, "my test case");
if (METAL_ERRORED())
clean_up();
See also
This macro yields a logical true
(might be int
) if the current environment is critical. That means,
that all tests being executed will cause canceling of the current test case if it fails.
\note This may be used as a replacement if the test is executed in standalone mode.
\par Example
if (!METAL_IS_CRITICAL())
METAL_ASSERT(some_test());
See also
This macro enters a test case, which is important for the handling critical tests.
\param Function The function \param Message The name of the test case as a string
\note This function uses a pointer and is not a template, so it can be defined in another place and reduces the amount of needed breakpoints. Though not used yet, it is reserved for future use. This might however be discarded, to any functionobject can be passed.
\par Example
void test_func()
{
METAL_ASSERT(some_test());
}
int main(int argc, char * argv[])
{
METAL_CALL(&test_func, "first test func");
METAL_CALL(+[]{METAL_ASSERT(something_else);}, "lambda case");
return METAL_REPORT();
}
This macro returns zero when no error occured and non-zero for any error. It is meant to be used in the main-function of the test as the return value.
In hosted mode the return value may be manipulated, if the test runner needs to ignore the return value.
\par Example:
int main(int argc, char * argv[])
{
METAL_ASSERT(some_test());
return METAL_REPORT();
}
This macro does provide the implementation for bitwise operations, done through the shift-operator.
It can be used to add more tests if necessary. The operator will just be paste between the shifted
values.
The Chain
parameter is necessary, since the logic can be different. I.e. when comparing two values
bitwise, all of the bits need to be equal, while when comparing to not equal
, one difference is enough.
Hence equal
has &&
as chain operator, while not equal
uses ||
.
\param Lhs Left hand side of the operation \param Rhs Right hand side of the operation \param Oper the actual operation \param Chain the connection of the bitwise steps. \return A logical boolean value containing the result.
\par Example
#define METAL_EQUAL_BITWISE(Lhs, Rhs) METAL_BITWISE(Lhs, Rhs, ==, &&, __metal_oper_equal)
#define METAL_NOT_EQUAL_BITWISE(Lhs, Rhs) METAL_BITWISE(Lhs, Rhs, != , ||, __metal_oper_not_equal);
This macro provides a statis assertion, i.e. a test done without execution.
\warning Currently this test is done at compiletime, so that all the other tests cannot be executed on fail. This may change in a future version.
\param Condition the condition to be asserted \param Message to be outputted.
METAL_STATIC_ASSERT(42 > 0, "dummy test");
Output a log message.
\warning Does nothing in standalone mode.
See also
This macro puts in a checkpoint, so the output documents this.
See also
This macro provides a assertion with a custom error message. The plain \ref METAL_ASSERT will output the code given as the condition.
\param Condition The condition to be checked. \param Message the custom message.
\par Example
std::string str;
METAL_ASSERT_MESSAGE(str.empty(), "string empty");
See also
This macro provides a expectation with a custom error message. The plain #METAL_EXPECT will output the code given as the condition.
\param Condition The condition to be checked. \param Message the custom message.
\par Example
std::string str;
METAL_EXPECT_MESSAGE(str.empty(), "string empty");
See also
This macro provides a plain assertion.
\param Condition The condition to be checked.
\par Example
std::string str = "some data";
METAL_ASSERT(str.empty());
See also
This macro provides a plain expectation.
\param Condition The condition to be checked.
\par Example
std::string str = "some data";
METAL_EXPECT(str.empty(), "string empty");
See also
This macro provides an expectation based on a predicate. It provides more detailed output than \bb_macro{METAL_ASSERT}.
\param Function The condition to be checked. \param Args... The arguments for the predicate call.
\par Example
auto predicate = [](int x, int y, int z) {return (x*y) < z;};
METAL_ASSERT_PREDICATE(predicate, 10, 2, 30);
See also
This macro provides an expectation based on a predicate. It provides more detailed output than METAL_EXPECT.
\param Function The condition to be checked. \param Args... The arguments for the predicate call.
\par Example
auto predicate = [](int x, int y, int z) {return (x*y) < z;};
METAL_EXPECT_PREDICATE(predicate, 10, 2, 30);
See also
A static test version of METAL_ASSERT_PREDICATE.
\warning Currently this test is done at compiletime, so that all the other tests cannot be executed on fail. This may change in a future version.
\param Function The condition to be checked. \param Args... The arguments for the predicate call.
\par Example
constexpr bool predicate(int x, int y, int z) {return (x*y) < z;}
METAL_STATIC_ASSERT_PREDICATE(predicate, x, y, z);
See also
This test asserts the equality of two values, through operator==
.
It provides output of the actual values when used in hosted mode.
\param Lhs Left hand-side value to compare. \param Rhs Right hand-side value to compare.
\par Example
METAL_ASSERT_EQUAL(15, 0xF);
See also
- METAL_EXPECT_EQUAL
- METAL_ASSERT_EQUAL_RANGED
- METAL_EXPECT_EQUAL_RANGED
- METAL_STATIC_ASSERT_EQUAL
- METAL_STATIC_ASSERT_EQUAL_BITWISE
- METAL_ASSERT_EQUAL_BITWISE
- METAL_EXPECT_EQUAL_BITWISE
- METAL_ASSERT_EQUAL_BITWISE_RANGED
- METAL_EXPECT_EQUAL_BITWISE_RANGED
This test expects the equality of two values, through operator==
.
It provides output of the actual values when used in hosted mode.
\param Lhs Left hand-side value to compare. \param Rhs Right hand-side value to compare.
\par Example
METAL_EXPECT_EQUAL(15, 0xF);
See also
- METAL_ASSERT_EQUAL
- METAL_ASSERT_EQUAL_RANGED
- METAL_EXPECT_EQUAL_RANGED
- METAL_STATIC_ASSERT_EQUAL
- METAL_STATIC_ASSERT_EQUAL_BITWISE
- METAL_ASSERT_EQUAL_BITWISE
- METAL_EXPECT_EQUAL_BITWISE
- METAL_ASSERT_EQUAL_BITWISE_RANGED
- METAL_EXPECT_EQUAL_BITWISE_RANGED
This test expects the equality of every bit in the given values. The values given must have an
operator<<
and an operator&
defined. The maximum size is 8 bytes.
This test will succeed if every bit in Lhs is equal to the bit in Rhs at the same position.
In hosted mode the output will also be done in binary notation.
\note The behaviour of shifting signed values is implementation defined.
\param Lhs Left hand-side value to compare. \param Rhs Right hand-side value to compare.
\par Example
METAL_EXPECT_EQUAL_BITWISE(0b10, 2);
See also
- METAL_ASSERT_EQUAL
- METAL_EXPECT_EQUAL
- METAL_ASSERT_EQUAL_RANGED
- METAL_EXPECT_EQUAL_RANGED
- METAL_STATIC_ASSERT_EQUAL
- METAL_STATIC_ASSERT_EQUAL_BITWISE
- METAL_ASSERT_EQUAL_BITWISE
- METAL_ASSERT_EQUAL_BITWISE_RANGED
- METAL_EXPECT_EQUAL_BITWISE_RANGED
This test expects the equality of every bit in the given values. The values given must have an
operator<<
and an operator&
defined. The maximum size is 8 bytes.
This test will succeed if every bit in Lhs is equal to the bit in Rhs at the same position.
In hosted mode the output will also be done in binary notation.
\note The behaviour of shifting signed values is implementation defined.
\param Lhs Left hand-side value to compare. \param Rhs Right hand-side value to compare.
\par Example
METAL_ASSERT_EQUAL_BITWISE(0b10, 2);
See also
- METAL_ASSERT_EQUAL
- METAL_EXPECT_EQUAL
- METAL_EXPECT_EQUAL_RANGED
- METAL_STATIC_ASSERT_EQUAL
- METAL_STATIC_ASSERT_EQUAL_BITWISE
- METAL_ASSERT_EQUAL_BITWISE
- METAL_EXPECT_EQUAL_BITWISE
- METAL_ASSERT_EQUAL_BITWISE_RANGED
- METAL_EXPECT_EQUAL_BITWISE_RANGED
This test expects the equality of two values, through operator==
.
It provides output of the actual values when used in hosted mode.
\param Lhs Left hand-side value to compare. \param Rhs Right hand-side value to compare.
\warning Currently this test is done at compiletime, so that all the other tests cannot be executed on fail. This may change in a future version.
\par Example
METAL_STATIC_ASSERT_EQUAL(3, 0b11);
See also
- METAL_ASSERT_EQUAL
- METAL_EXPECT_EQUAL
- METAL_ASSERT_EQUAL_RANGED
- METAL_EXPECT_EQUAL_RANGED
- METAL_STATIC_ASSERT_EQUAL_BITWISE
- METAL_ASSERT_EQUAL_BITWISE
- METAL_EXPECT_EQUAL_BITWISE
- METAL_ASSERT_EQUAL_BITWISE_RANGED
- METAL_EXPECT_EQUAL_BITWISE_RANGED
This macro provides a bitwise version of METAL_STATIC_ASSERT_EQUAL.
\param Lhs Left hand-side value to compare. \param Rhs Right hand-side value to compare.
\warning Currently this test is done at compiletime, so that all the other tests cannot be executed on fail. This may change in a future version.
\par Example
METAL_STATIC_ASSERT_EQUAL_BITWISE(3, 0b11);
See also
- METAL_ASSERT_EQUAL
- METAL_EXPECT_EQUAL
- METAL_ASSERT_EQUAL_RANGED
- METAL_EXPECT_EQUAL_RANGED
- METAL_STATIC_ASSERT_EQUAL
- METAL_ASSERT_EQUAL_BITWISE
- METAL_EXPECT_EQUAL_BITWISE
- METAL_ASSERT_EQUAL_BITWISE_RANGED
- METAL_EXPECT_EQUAL_BITWISE_RANGED
This test asserts the equality of two values, through operator==
.
It provides output of the actual values when used in hosted mode.
\param Lhs Left hand-side value to compare. \param Rhs Right hand-side value to compare.
\par Example
METAL_ASSERT_NOT_EQUAL(15, 0xF);
See also
- METAL_EXPECT_NOT_EQUAL
- METAL_ASSERT_NOT_EQUAL_RANGED
- METAL_EXPECT_NOT_EQUAL_RANGED
- METAL_STATIC_ASSERT_NOT_EQUAL
- METAL_STATIC_ASSERT_NOT_EQUAL_BITWISE
- METAL_ASSERT_NOT_EQUAL_BITWISE
- METAL_EXPECT_NOT_EQUAL_BITWISE
- METAL_ASSERT_NOT_EQUAL_BITWISE_RANGED
- METAL_EXPECT_NOT_EQUAL_BITWISE_RANGED
This test expects the equality of two values, through operator!=
.
It provides output of the actual values when used in hosted mode.
\param Lhs Left hand-side value to compare. \param Rhs Right hand-side value to compare.
\par Example
METAL_EXPECT_NOT_EQUAL(15, 0xF);
See also
- METAL_ASSERT_NOT_EQUAL
- METAL_ASSERT_NOT_EQUAL_RANGED
- METAL_EXPECT_NOT_EQUAL_RANGED
- METAL_STATIC_ASSERT_NOT_EQUAL
- METAL_STATIC_ASSERT_NOT_EQUAL_BITWISE
- METAL_ASSERT_NOT_EQUAL_BITWISE
- METAL_EXPECT_NOT_EQUAL_BITWISE
- METAL_ASSERT_NOT_EQUAL_BITWISE_RANGED
- METAL_EXPECT_NOT_EQUAL_BITWISE_RANGED
This test expects the equality of every bit in the given values. The values given must have an
operator<<
and an operator&
defined. The maximum size is 8 bytes.
This test will succeed if any bit in Lhs is not equal to the bit in Rhs at the same position.
In hosted mode the output will also be done in binary notation.
\note The behaviour of shifting signed values is implementation defined.
\param Lhs Left hand-side value to compare. \param Rhs Right hand-side value to compare.
\par Example
METAL_EXPECT_NOT_EQUAL_BITWISE(0b10, 1);
See also
- METAL_ASSERT_NOT_EQUAL
- METAL_EXPECT_NOT_EQUAL
- METAL_ASSERT_NOT_EQUAL_RANGED
- METAL_EXPECT_NOT_EQUAL_RANGED
- METAL_STATIC_ASSERT_NOT_EQUAL
- METAL_STATIC_ASSERT_NOT_EQUAL_BITWISE
- METAL_ASSERT_NOT_EQUAL_BITWISE
- METAL_ASSERT_NOT_EQUAL_BITWISE_RANGED
- METAL_EXPECT_NOT_EQUAL_BITWISE_RANGED
This test expects the equality of every bit in the given values. The values given must have an
operator<<
and an operator&
defined. The maximum size is 8 bytes.
This test will succeed if any bit in Lhs is not equal to the bit in Rhs at the same position.
In hosted mode the output will also be done in binary notation.
\note The behaviour of shifting signed values is implementation defined.
\param Lhs Left hand-side value to compare. \param Rhs Right hand-side value to compare.
\par Example
METAL_ASSERT_NOT_EQUAL_BITWISE(0b10, 1);
See also
- METAL_ASSERT_NOT_EQUAL
- METAL_EXPECT_NOT_EQUAL
- METAL_ASSERT_NOT_EQUAL_RANGED
- METAL_EXPECT_NOT_EQUAL_RANGED
- METAL_STATIC_ASSERT_NOT_EQUAL
- METAL_STATIC_ASSERT_NOT_EQUAL_BITWISE
- METAL_EXPECT_NOT_EQUAL_BITWISE
- METAL_ASSERT_NOT_EQUAL_BITWISE_RANGED
- METAL_EXPECT_NOT_EQUAL_BITWISE_RANGED
This test expects the equality of two values, through operator!=
.
It provides output of the actual values when used in hosted mode.
\param Lhs Left hand-side value to compare. \param Rhs Right hand-side value to compare.
\warning Currently this test is done at compiletime, so that all the other tests cannot be executed on fail. This may change in a future version.
\par Example
METAL_STATIC_ASSERT_NOT_EQUAL(2, 0b11);
See also
- METAL_ASSERT_NOT_EQUAL
- METAL_EXPECT_NOT_EQUAL
- METAL_ASSERT_NOT_EQUAL_RANGED
- METAL_EXPECT_NOT_EQUAL_RANGED
- METAL_STATIC_ASSERT_NOT_EQUAL_BITWISE
- METAL_ASSERT_NOT_EQUAL_BITWISE
- METAL_EXPECT_NOT_EQUAL_BITWISE
- METAL_ASSERT_NOT_EQUAL_BITWISE_RANGED
- METAL_EXPECT_NOT_EQUAL_BITWISE_RANGED
This macro provides a bitwise version of METAL_STATIC_ASSERT_NOT_EQUAL.
\param Lhs Left hand-side value to compare. \param Rhs Right hand-side value to compare.
\warning Currently this test is done at compiletime, so that all the other tests cannot be executed on fail. This may change in a future version.
\par Example
METAL_STATIC_ASSERT_NOT_EQUAL_BITWISE(0b10, 0b11);
See also
- METAL_ASSERT_NOT_EQUAL
- METAL_EXPECT_NOT_EQUAL
- METAL_ASSERT_NOT_EQUAL_RANGED
- METAL_EXPECT_NOT_EQUAL_RANGED
- METAL_STATIC_ASSERT_NOT_EQUAL
- METAL_ASSERT_NOT_EQUAL_BITWISE
- METAL_EXPECT_NOT_EQUAL_BITWISE
- METAL_ASSERT_NOT_EQUAL_BITWISE_RANGED
- METAL_EXPECT_NOT_EQUAL_BITWISE_RANGED
This test expects Rhs to be within an absolute tolerance to Lhs, i.e. Lhs = Rhs +/- Tolerance
.
\param Lhs hand-side value to compare \param Rhs hand-side value to compare \param Tolerance The tolerated distance between Rhs and Lhs.
\par Example
METAL_EXPECT_CLOSE(1.0, 1.2, 0.2);
See also.
- METAL_ASSERT_CLOSE
- METAL_STATIC_ASSERT_CLOSE
- METAL_ASSERT_CLOSE_RELATIVE
- METAL_EXPECT_CLOSE_RELATIVE
- METAL_STATIC_ASSERT_CLOSE_RELATIVE
- METAL_ASSERT_CLOSE_PERCENT
- METAL_EXPECT_CLOSE_PERCENT
- METAL_STATIC_ASSERT_CLOSE_PERCENT
- METAL_ASSERT_CLOSE_RANGED
- METAL_EXPECT_CLOSE_RANGED
- METAL_ASSERT_CLOSE_RELATIVE_RANGED
- METAL_EXPECT_CLOSE_RELATIVE_RANGED
- METAL_ASSERT_CLOSE_PERCENT_RANGED
- METAL_EXPECT_CLOSE_PERCENT_RANGED
This test assert Rhs to be within an absolute tolerance to Lhs, i.e. Lhs = Rhs +/- Tolerance
.
\param Lhs hand-side value to compare \param Rhs hand-side value to compare \param Tolerance The tolerated distance between Rhs and Lhs.
\par Example
METAL_ASSERT_CLOSE(1.0, 1.2, 0.2);
See also.
- METAL_EXPECT_CLOSE
- METAL_STATIC_ASSERT_CLOSE
- METAL_ASSERT_CLOSE_RELATIVE
- METAL_EXPECT_CLOSE_RELATIVE
- METAL_STATIC_ASSERT_CLOSE_RELATIVE
- METAL_ASSERT_CLOSE_PERCENT
- METAL_EXPECT_CLOSE_PERCENT
- METAL_STATIC_ASSERT_CLOSE_PERCENT
- METAL_ASSERT_CLOSE_RANGED
- METAL_EXPECT_CLOSE_RANGED
- METAL_ASSERT_CLOSE_RELATIVE_RANGED
- METAL_EXPECT_CLOSE_RELATIVE_RANGED
- METAL_ASSERT_CLOSE_PERCENT_RANGED
- METAL_EXPECT_CLOSE_PERCENT_RANGED
This static test assert Rhs to be within an absolute tolerance to Lhs, i.e. Lhs = Rhs +/- Tolerance
.
\param Lhs hand-side value to compare \param Rhs hand-side value to compare \param Tolerance The tolerated distance between Rhs and Lhs.
\warning Currently this test is done at compiletime, so that all the other tests cannot be executed on fail. This may change in a future version.
\par Example
METAL_STATIC_ASSERT_CLOSE(1.0, 1.2, 0.2);
See also.
- METAL_ASSERT_CLOSE
- METAL_EXPECT_CLOSE
- METAL_ASSERT_CLOSE_RELATIVE
- METAL_EXPECT_CLOSE_RELATIVE
- METAL_STATIC_ASSERT_CLOSE_RELATIVE
- METAL_ASSERT_CLOSE_PERCENT
- METAL_EXPECT_CLOSE_PERCENT
- METAL_STATIC_ASSERT_CLOSE_PERCENT
- METAL_ASSERT_CLOSE_RANGED
- METAL_EXPECT_CLOSE_RANGED
- METAL_ASSERT_CLOSE_RELATIVE_RANGED
- METAL_EXPECT_CLOSE_RELATIVE_RANGED
- METAL_ASSERT_CLOSE_PERCENT_RANGED
- METAL_EXPECT_CLOSE_PERCENT_RANGED
This test expects Rhs to be within a relative tolerance to Lhs, i.e. Lhs = Rhs +/- (Lhs * Tolerance)
.
\param Lhs hand-side value to compare \param Rhs hand-side value to compare \param Tolerance The tolerated distance between Rhs and Lhs.
\par Example
METAL_EXPECT_CLOSE_RELATIVE(2.0, 1.5, 0.25);
See also.
- METAL_ASSERT_CLOSE
- METAL_EXPECT_CLOSE
- METAL_STATIC_ASSERT_CLOSE
- METAL_ASSERT_CLOSE_RELATIVE
- METAL_STATIC_ASSERT_CLOSE_RELATIVE
- METAL_ASSERT_CLOSE_PERCENT
- METAL_EXPECT_CLOSE_PERCENT
- METAL_STATIC_ASSERT_CLOSE_PERCENT
- METAL_ASSERT_CLOSE_RANGED
- METAL_EXPECT_CLOSE_RANGED
- METAL_ASSERT_CLOSE_RELATIVE_RANGED
- METAL_EXPECT_CLOSE_RELATIVE_RANGED
- METAL_ASSERT_CLOSE_PERCENT_RANGED
- METAL_EXPECT_CLOSE_PERCENT_RANGED
This test assert Rhs to be within a relative tolerance to Lhs, i.e. Lhs = Rhs +/- (Lhs * Tolerance)
.
\param Lhs hand-side value to compare \param Rhs hand-side value to compare \param Tolerance The tolerated distance between Rhs and Lhs.
\par Example
METAL_ASSERT_CLOSE_RELATIVE(5.0, 0.5, 0.1);
See also.
- METAL_ASSERT_CLOSE
- METAL_EXPECT_CLOSE
- METAL_STATIC_ASSERT_CLOSE
- METAL_EXPECT_CLOSE_RELATIVE
- METAL_STATIC_ASSERT_CLOSE_RELATIVE
- METAL_ASSERT_CLOSE_PERCENT
- METAL_EXPECT_CLOSE_PERCENT
- METAL_STATIC_ASSERT_CLOSE_PERCENT
- METAL_ASSERT_CLOSE_RANGED
- METAL_EXPECT_CLOSE_RANGED
- METAL_ASSERT_CLOSE_RELATIVE_RANGED
- METAL_EXPECT_CLOSE_RELATIVE_RANGED
- METAL_ASSERT_CLOSE_PERCENT_RANGED
- METAL_EXPECT_CLOSE_PERCENT_RANGED
This static test assert Rhs to be within a relative tolerance to Lhs, i.e. Lhs = Rhs +/- (Lhs * Tolerance)
.
\param Lhs hand-side value to compare \param Rhs hand-side value to compare \param Tolerance The tolerated distance between Rhs and Lhs.
\warning Currently this test is done at compiletime, so that all the other tests cannot be executed on fail. This may change in a future version.
\par Example
METAL_STATIC_ASSERT_CLOSE_RELATIVE(2.0, 1.8, 0.1);
See also.
- METAL_ASSERT_CLOSE
- METAL_EXPECT_CLOSE
- METAL_STATIC_ASSERT_CLOSE
- METAL_ASSERT_CLOSE_RELATIVE
- METAL_EXPECT_CLOSE_RELATIVE
- METAL_ASSERT_CLOSE_PERCENT
- METAL_EXPECT_CLOSE_PERCENT
- METAL_STATIC_ASSERT_CLOSE_PERCENT
- METAL_ASSERT_CLOSE_RANGED
- METAL_EXPECT_CLOSE_RANGED
- METAL_ASSERT_CLOSE_RELATIVE_RANGED
- METAL_EXPECT_CLOSE_RELATIVE_RANGED
- METAL_ASSERT_CLOSE_PERCENT_RANGED
- METAL_EXPECT_CLOSE_PERCENT_RANGED
This test expects Rhs to be within a relative tolerance to Lhs, i.e. Lhs = Rhs +/- (Lhs * Tolerance %)
.
\param Lhs hand-side value to compare \param Rhs hand-side value to compare \param Tolerance The tolerated distance between Rhs and Lhs.
\par Example
METAL_EXPECT_CLOSE_PERCENT(2.0, 1.5, 25);
See also.
- METAL_ASSERT_CLOSE
- METAL_EXPECT_CLOSE
- METAL_STATIC_ASSERT_CLOSE
- METAL_ASSERT_CLOSE_RELATIVE
- METAL_EXPECT_CLOSE_RELATIVE
- METAL_STATIC_ASSERT_CLOSE_RELATIVE
- METAL_ASSERT_CLOSE_PERCENT
- METAL_STATIC_ASSERT_CLOSE_PERCENT
- METAL_ASSERT_CLOSE_RANGED
- METAL_EXPECT_CLOSE_RANGED
- METAL_ASSERT_CLOSE_RELATIVE_RANGED
- METAL_EXPECT_CLOSE_RELATIVE_RANGED
- METAL_ASSERT_CLOSE_PERCENT_RANGED
- METAL_EXPECT_CLOSE_PERCENT_RANGED
This test assert Rhs to be within a relative tolerance to Lhs, i.e. Lhs = Rhs +/- (Lhs * Tolerance %)
.
\param Lhs hand-side value to compare \param Rhs hand-side value to compare \param Tolerance The tolerated distance between Rhs and Lhs.
\par Example
METAL_ASSERT_CLOSE_PERCENT(5.0, 0.5, 10);
See also.
- METAL_ASSERT_CLOSE
- METAL_EXPECT_CLOSE
- METAL_STATIC_ASSERT_CLOSE
- METAL_ASSERT_CLOSE_RELATIVE
- METAL_EXPECT_CLOSE_RELATIVE
- METAL_STATIC_ASSERT_CLOSE_RELATIVE
- METAL_EXPECT_CLOSE_PERCENT
- METAL_STATIC_ASSERT_CLOSE_PERCENT
- METAL_ASSERT_CLOSE_RANGED
- METAL_EXPECT_CLOSE_RANGED
- METAL_ASSERT_CLOSE_RELATIVE_RANGED
- METAL_EXPECT_CLOSE_RELATIVE_RANGED
- METAL_ASSERT_CLOSE_PERCENT_RANGED
- METAL_EXPECT_CLOSE_PERCENT_RANGED
This static test assert Rhs to be within a relative tolerance to Lhs, i.e. Lhs = Rhs +/- (Lhs * Tolerance %)
.
\param Lhs hand-side value to compare \param Rhs hand-side value to compare \param Tolerance The tolerated distance between Rhs and Lhs.
\warning Currently this test is done at compiletime, so that all the other tests cannot be executed on fail. This may change in a future version.
\par Example
METAL_STATIC_ASSERT_CLOSE_PERCENT(2.0, 1.8, 10);
See also.
- METAL_ASSERT_CLOSE
- METAL_EXPECT_CLOSE
- METAL_STATIC_ASSERT_CLOSE
- METAL_ASSERT_CLOSE_RELATIVE
- METAL_EXPECT_CLOSE_RELATIVE
- METAL_STATIC_ASSERT_CLOSE_RELATIVE
- METAL_ASSERT_CLOSE_PERCENT
- METAL_EXPECT_CLOSE_PERCENT
- METAL_ASSERT_CLOSE_RANGED
- METAL_EXPECT_CLOSE_RANGED
- METAL_ASSERT_CLOSE_RELATIVE_RANGED
- METAL_EXPECT_CLOSE_RELATIVE_RANGED
- METAL_ASSERT_CLOSE_PERCENT_RANGED
- METAL_EXPECT_CLOSE_PERCENT_RANGED
This test expects Lhs to be greater or equal to Rhs, through operator>=
.
It provides output of the actual values when used in hosted mode.
\param Lhs Left hand-side value to compare. \param Rhs Right hand-side value to compare.
\par Example
METAL_EXPECT_GE(15, 0xF);
See also
- METAL_ASSERT_GE
- METAL_ASSERT_GE_RANGED
- METAL_EXPECT_GE_RANGED
- METAL_STATIC_ASSERT_GE
- METAL_STATIC_ASSERT_GE_BITWISE
- METAL_ASSERT_GE_BITWISE
- METAL_EXPECT_GE_BITWISE
- METAL_ASSERT_GE_BITWISE_RANGED
- METAL_EXPECT_GE_BITWISE_RANGED
This test expects Lhs to be greater or equal to Rhs, through operator>=
.
It provides output of the actual values when used in hosted mode.
\param Lhs Left hand-side value to compare. \param Rhs Right hand-side value to compare.
METAL_ASSERT_GE(4, 0b100);
See also
- METAL_EXPECT_GE
- METAL_ASSERT_GE_RANGED
- METAL_EXPECT_GE_RANGED
- METAL_STATIC_ASSERT_GE
- METAL_STATIC_ASSERT_GE_BITWISE
- METAL_ASSERT_GE_BITWISE
- METAL_EXPECT_GE_BITWISE
- METAL_ASSERT_GE_BITWISE_RANGED
- METAL_EXPECT_GE_BITWISE_RANGED
This test expects the every bit of Lhs to be greater or equal to the corresponding in Rhs. The values given must have an operator<<
and an operator&
defined. The maximum size is 8 bytes.
This test will succeed if every bit in Lhs is equal to the bit in Rhs at the same position.
In hosted mode the output will also be done in binary notation.
\note The behaviour of shifting signed values is implementation defined.
\param Lhs Left hand-side value to compare. \param Rhs Right hand-side value to compare.
\par Example
METAL_EXPECT_GE_BITWISE(0b10, 2);
See also
- METAL_ASSERT_GE
- METAL_EXPECT_GE
- METAL_ASSERT_GE_RANGED
- METAL_EXPECT_GE_RANGED
- METAL_STATIC_ASSERT_GE
- METAL_STATIC_ASSERT_GE_BITWISE
- METAL_ASSERT_GE_BITWISE
- METAL_ASSERT_GE_BITWISE_RANGED
- METAL_EXPECT_GE_BITWISE_RANGED
This test expects the every bit of Lhs to be greater or equal to the corresponding in Rhs. The values given must have an operator<<
and an operator&
defined. The maximum size is 8 bytes.
This test will succeed if every bit in Lhs is equal to the bit in Rhs at the same position.
In hosted mode the output will also be done in binary notation.
\note The behaviour of shifting signed values is implementation defined.
\param Lhs Left hand-side value to compare. \param Rhs Right hand-side value to compare.
\par Example
METAL_ASSERT_GE_BITWISE(0b10, 2);
See also
- METAL_ASSERT_GE
- METAL_EXPECT_GE
- METAL_ASSERT_GE_RANGED
- METAL_EXPECT_GE_RANGED
- METAL_STATIC_ASSERT_GE
- METAL_STATIC_ASSERT_GE_BITWISE
- METAL_EXPECT_GE_BITWISE
- METAL_ASSERT_GE_BITWISE_RANGED
- METAL_EXPECT_GE_BITWISE_RANGED
This test expects Lhs to be greater or equal to Rhs, through operator>=
.
It provides output of the actual values when used in hosted mode.
\param Lhs Left hand-side value to compare. \param Rhs Right hand-side value to compare.
\warning Currently this test is done at compiletime, so that all the other tests cannot be executed on fail. This may change in a future version.
\par Example
METAL_STATIC_ASSERT_GE(3, 0b11);
See also
- METAL_ASSERT_GE
- METAL_EXPECT_GE
- METAL_ASSERT_GE_RANGED
- METAL_EXPECT_GE_RANGED
- METAL_STATIC_ASSERT_GE
- METAL_STATIC_ASSERT_GE_BITWISE
- METAL_ASSERT_GE_BITWISE
- METAL_EXPECT_GE_BITWISE
- METAL_ASSERT_GE_BITWISE_RANGED
- METAL_EXPECT_GE_BITWISE_RANGED
This macro provides a bitwise version of METAL_STATIC_ASSERT_GE.
\param Lhs Left hand-side value to compare. \param Rhs Right hand-side value to compare.
\warning Currently this test is done at compiletime, so that all the other tests cannot be executed on fail. This may change in a future version.
\par Example
METAL_STATIC_ASSERT_GE_BITWISE(3, 0b11);
See also
- METAL_ASSERT_GE
- METAL_EXPECT_GE
- METAL_ASSERT_GE_RANGED
- METAL_EXPECT_GE_RANGED
- METAL_STATIC_ASSERT_GE
- METAL_STATIC_ASSERT_GE_BITWISE
- METAL_EXPECT_GE_BITWISE
- METAL_ASSERT_GE_BITWISE_RANGED
- METAL_EXPECT_GE_BITWISE_RANGED
This test expects Lhs to be lesser or equal to Rhs, through operator<=
.
It provides output of the actual values when used in hosted mode.
\param Lhs Left hand-side value to compare. \param Rhs Right hand-side value to compare.
\par Example
METAL_EXPECT_LE(15, 0xF);
See also
- METAL_ASSERT_LE
- METAL_ASSERT_LE_RANGED
- METAL_EXPECT_LE_RANGED
- METAL_STATIC_ASSERT_LE
- METAL_STATIC_ASSERT_LE_BITWISE
- METAL_ASSERT_LE_BITWISE
- METAL_EXPECT_LE_BITWISE
- METAL_ASSERT_LE_BITWISE_RANGED
- METAL_EXPECT_LE_BITWISE_RANGED
This test expects Lhs to be lesser or equal to Rhs, through operator<=
.
It provides output of the actual values when used in hosted mode.
\param Lhs Left hand-side value to compare. \param Rhs Right hand-side value to compare.
METAL_ASSERT_LE(4, 0b100);
See also
- METAL_EXPECT_LE
- METAL_ASSERT_LE_RANGED
- METAL_EXPECT_LE_RANGED
- METAL_STATIC_ASSERT_LE
- METAL_STATIC_ASSERT_LE_BITWISE
- METAL_ASSERT_LE_BITWISE
- METAL_EXPECT_LE_BITWISE
- METAL_ASSERT_LE_BITWISE_RANGED
- METAL_EXPECT_LE_BITWISE_RANGED
This test expects the every bit of Lhs to be lesser or equal to the corresponding in Rhs. The values given must have an operator<<
and an operator&
defined. The maximum size is 8 bytes.
This test will succeed if every bit in Lhs is equal to the bit in Rhs at the same position.
In hosted mode the output will also be done in binary notation.
\note The behaviour of shifting signed values is implementation defined.
\param Lhs Left hand-side value to compare. \param Rhs Right hand-side value to compare.
\par Example
METAL_EXPECT_LE_BITWISE(0b10, 2);
See also
- METAL_ASSERT_LE
- METAL_EXPECT_LE
- METAL_ASSERT_LE_RANGED
- METAL_EXPECT_LE_RANGED
- METAL_STATIC_ASSERT_LE
- METAL_STATIC_ASSERT_LE_BITWISE
- METAL_ASSERT_LE_BITWISE
- METAL_ASSERT_LE_BITWISE_RANGED
- METAL_EXPECT_LE_BITWISE_RANGED
This test expects the every bit of Lhs to be lesser or equal to the corresponding in Rhs. The values given must have an operator<<
and an operator&
defined. The maximum size is 8 bytes.
This test will succeed if every bit in Lhs is equal to the bit in Rhs at the same position.
In hosted mode the output will also be done in binary notation.
\note The behaviour of shifting signed values is implementation defined.
\param Lhs Left hand-side value to compare. \param Rhs Right hand-side value to compare.
\par Example
METAL_ASSERT_LE_BITWISE(0b10, 2);
See also
- METAL_ASSERT_LE
- METAL_EXPECT_LE
- METAL_ASSERT_LE_RANGED
- METAL_EXPECT_LE_RANGED
- METAL_STATIC_ASSERT_LE
- METAL_STATIC_ASSERT_LE_BITWISE
- METAL_EXPECT_LE_BITWISE
- METAL_ASSERT_LE_BITWISE_RANGED
- METAL_EXPECT_LE_BITWISE_RANGED
This test expects Lhs to be lesser or equal to Rhs, through operator<=
.
It provides output of the actual values when used in hosted mode.
\param Lhs Left hand-side value to compare. \param Rhs Right hand-side value to compare.
\warning Currently this test is done at compiletime, so that all the other tests cannot be executed on fail. This may change in a future version.
\par Example
METAL_STATIC_ASSERT_LE(3, 0b11);
See also
- METAL_ASSERT_LE
- METAL_EXPECT_LE
- METAL_ASSERT_LE_RANGED
- METAL_EXPECT_LE_RANGED
- METAL_STATIC_ASSERT_LE_BITWISE
- METAL_ASSERT_LE_BITWISE
- METAL_EXPECT_LE_BITWISE
- METAL_ASSERT_LE_BITWISE_RANGED
- METAL_EXPECT_LE_BITWISE_RANGED
This macro provides a bitwise version of METAL_STATIC_ASSERT_LE.
\param Lhs Left hand-side value to compare. \param Rhs Right hand-side value to compare.
\warning Currently this test is done at compiletime, so that all the other tests cannot be executed on fail. This may change in a future version.
\par Example
METAL_STATIC_ASSERT_LE_BITWISE(3, 0b11);
See also
- METAL_ASSERT_LE
- METAL_EXPECT_LE
- METAL_ASSERT_LE_RANGED
- METAL_EXPECT_LE_RANGED
- METAL_STATIC_ASSERT_LE
- METAL_ASSERT_LE_BITWISE
- METAL_EXPECT_LE_BITWISE
- METAL_ASSERT_LE_BITWISE_RANGED
- METAL_EXPECT_LE_BITWISE_RANGED
This test expects Lhs to be greater than Rhs, through operator>
.
It provides output of the actual values when used in hosted mode.
\param Lhs Left hand-side value to compare. \param Rhs Right hand-side value to compare.
\par Example
METAL_EXPECT_GREATER(15, 0xE);
See also
- METAL_ASSERT_GREATER
- METAL_ASSERT_GREATER_RANGED
- METAL_EXPECT_GREATER_RANGED
- METAL_STATIC_ASSERT_GREATER
This test expects Lhs to be greater than Rhs, through operator>
.
It provides output of the actual values when used in hosted mode.
\param Lhs Left hand-side value to compare. \param Rhs Right hand-side value to compare.
METAL_ASSERT_GREATER(4, 0b10);
See also
- METAL_EXPECT_GREATER
- METAL_ASSERT_GREATER_RANGED
- METAL_EXPECT_GREATER_RANGED
- METAL_STATIC_ASSERT_GREATER
This test expects Lhs to be greater than Rhs, through operator>
.
It provides output of the actual values when used in hosted mode.
\param Lhs Left hand-side value to compare. \param Rhs Right hand-side value to compare.
\warning Currently this test is done at compiletime, so that all the other tests cannot be executed on fail. This may change in a future version.
\par Example
METAL_STATIC_ASSERT_GREATER(3, 0b10);
See also
This test expects Lhs to be lesser than Rhs, through operator>
.
It provides output of the actual values when used in hosted mode.
\param Lhs Left hand-side value to compare. \param Rhs Right hand-side value to compare.
\par Example
METAL_EXPECT_LESSER(13, 0xF);
See also
- METAL_ASSERT_LESSER
- METAL_ASSERT_LESSER_RANGED
- METAL_EXPECT_LESSER_RANGED
- METAL_STATIC_ASSERT_LESSER
This test expects Lhs to be lesser than Rhs, through operator>
.
It provides output of the actual values when used in hosted mode.
\param Lhs Left hand-side value to compare. \param Rhs Right hand-side value to compare.
METAL_ASSERT_LESSER(1, 0b100);
See also
- METAL_EXPECT_LESSER
- METAL_ASSERT_LESSER_RANGED
- METAL_EXPECT_LESSER_RANGED
- METAL_STATIC_ASSERT_LESSER
This test expects Lhs to be lesser than Rhs, through operator>
.
It provides output of the actual values when used in hosted mode.
\param Lhs Left hand-side value to compare. \param Rhs Right hand-side value to compare.
\warning Currently this test is done at compiletime, so that all the other tests cannot be executed on fail. This may change in a future version.
\par Example
METAL_STATIC_ASSERT_LESSER(2, 0b11);
See also
This macro provides an equality assertion for two ranges.
It succeeds if every element in the left-handside container is equal to the one the right side.
\param LhsBegin The begin of the left-hand-side range. In C this is a pointer to an array. \param LhsEnd The end of the left-hand-side range (behind the last element). In C this is the size of the array. \param RhsBegin The begin of the right-hand-side range. In C this is a pointer to an array. \param RhsEnd The end of the right-hand-side range (behind the last element). In C this is the size of the array.
\par Example C++
std::vector<int> rhs = {1,2,3};
std::vector<int> lhs = {1,2,3};
METAL_ASSERT_EQUAL_RANGED(rhs.begin(), rhs.end(), lhs.begin(), lhs.end());
\par Example C
\code{.c} int rhs[3] = {1,2,3}; int lhs[3] = {1,2,3}; METAL_ASSERT_EQUAL_RANGED(rhs, 3, lhs, 3);
**See also**
* [METAL_ASSERT_EQUAL](#metal_assert_equal)
* [METAL_EXPECT_EQUAL](#metal_expect_equal)
* [METAL_EXPECT_EQUAL_RANGED](#metal_expect_equal_ranged)
* [METAL_STATIC_ASSERT_EQUAL](#metal_static_assert_equal)
* [METAL_STATIC_ASSERT_EQUAL_BITWISE](#metal_static_assert_equal_bitwise)
* [METAL_ASSERT_EQUAL_BITWISE](#metal_assert_equal_bitwise)
* [METAL_EXPECT_EQUAL_BITWISE](#metal_expect_equal_bitwise)
* [METAL_ASSERT_EQUAL_BITWISE_RANGED](#metal_assert_equal_bitwise_ranged)
* [METAL_EXPECT_EQUAL_BITWISE_RANGED](#metal_expect_equal_bitwise_ranged)
# METAL_EXPECT_EQUAL_RANGED(LhsBegin, LhsEnd, RhsBegin, RhsEnd)
This macro provides an equality expectation for two ranges.
It succeeds if every element in the left-handside container is equal
to the one the right side.
\param LhsBegin The begin of the left-hand-side range. In C this is a pointer to an array.
\param LhsEnd The end of the left-hand-side range (behind the last element). In C this is the size of the array.
\param RhsBegin The begin of the right-hand-side range. In C this is a pointer to an array.
\param RhsEnd The end of the right-hand-side range (behind the last element). In C this is the size of the array.
\par Example C++
```cpp
std::vector<int> rhs = {1,2,3};
std::vector<int> lhs = {1,2,3};
METAL_EXPECT_EQUAL_RANGED(rhs.begin(), rhs.end(), lhs.begin(), lhs.end());
\par Example C
int rhs[3] = {1,2,3};
int lhs[3] = {1,2,3};
METAL_EXPECT_EQUAL_RANGED(rhs, 3, lhs, 3);
See also
- METAL_ASSERT_EQUAL
- METAL_EXPECT_EQUAL
- METAL_ASSERT_EQUAL_RANGED
- METAL_EXPECT_EQUAL_RANGED
- METAL_STATIC_ASSERT_EQUAL
- METAL_STATIC_ASSERT_EQUAL_BITWISE
- METAL_ASSERT_EQUAL_BITWISE
- METAL_ASSERT_EQUAL_BITWISE_RANGED
- METAL_EXPECT_EQUAL_BITWISE_RANGED
This macro provides a bitwise equality assertion for two ranges.
It succeeds if every element in the left-handside container is equal to the one the right side.
\param LhsBegin The begin of the left-hand-side range. In C this is a pointer to an array. \param LhsEnd The end of the left-hand-side range (behind the last element). In C this is the size of the array. \param RhsBegin The begin of the right-hand-side range. In C this is a pointer to an array. \param RhsEnd The end of the right-hand-side range (behind the last element). In C this is the size of the array.
\par Example C++
std::vector<int> rhs = {1,2,3};
std::vector<int> lhs = {1,2,3};
METAL_ASSERT_EQUAL_BITWISE_RANGED(rhs.begin(), rhs.end(), lhs.begin(), lhs.end());
\par Example C
int rhs[3] = {1,2,3};
int lhs[3] = {1,2,3};
METAL_ASSERT_EQUAL_BITWISE_RANGED(rhs, 3, lhs, 3);
See also
- METAL_ASSERT_EQUAL
- METAL_EXPECT_EQUAL
- METAL_ASSERT_EQUAL_RANGED
- METAL_EXPECT_EQUAL_RANGED
- METAL_STATIC_ASSERT_EQUAL
- METAL_STATIC_ASSERT_EQUAL_BITWISE
- METAL_ASSERT_EQUAL_BITWISE
- METAL_EXPECT_EQUAL_BITWISE
- METAL_EXPECT_EQUAL_BITWISE_RANGED
This macro provides a bitwise equality expectation for two ranges.
It succeeds if every element in the left-handside container is equal to the one the right side.
\param LhsBegin The begin of the left-hand-side range. In C this is a pointer to an array. \param LhsEnd The end of the left-hand-side range (behind the last element). In C this is the size of the array. \param RhsBegin The begin of the right-hand-side range. In C this is a pointer to an array. \param RhsEnd The end of the right-hand-side range (behind the last element). In C this is the size of the array.
\par Example C++
std::vector<int> rhs = {1,2,3};
std::vector<int> lhs = {1,2,3};
METAL_EXPECT_EQUAL_BITWISE_RANGED(rhs.begin(), rhs.end(), lhs.begin(), lhs.end());
\par Example C
int rhs[3] = {1,2,3};
int lhs[3] = {1,2,3};
METAL_EXPECT_EQUAL_BITWISE_RANGED(rhs, 3, lhs, 3);
See also
- METAL_ASSERT_EQUAL
- METAL_EXPECT_EQUAL
- METAL_ASSERT_EQUAL_RANGED
- METAL_EXPECT_EQUAL_RANGED
- METAL_STATIC_ASSERT_EQUAL
- METAL_STATIC_ASSERT_EQUAL_BITWISE
- METAL_ASSERT_EQUAL_BITWISE
- METAL_EXPECT_EQUAL_BITWISE
- METAL_ASSERT_EQUAL_BITWISE_RANGED
This macro provides an inequality assertion for two ranges.
It succeeds if one element in the left-handside container is not equal to the one the right side.
\param LhsBegin The begin of the left-hand-side range. In C this is a pointer to an array. \param LhsEnd The end of the left-hand-side range (behind the last element). In C this is the size of the array. \param RhsBegin The begin of the right-hand-side range. In C this is a pointer to an array. \param RhsEnd The end of the right-hand-side range (behind the last element). In C this is the size of the array.
\par Example C++
std::vector<int> rhs = {1,2,3};
std::vector<int> lhs = {1,2,3};
METAL_ASSERT_NOT_EQUAL_RANGED(rhs.begin(), rhs.end(), lhs.begin(), lhs.end());
\par Example C
int rhs[3] = {1,2,3};
int lhs[3] = {1,2,3};
METAL_ASSERT_NOT_EQUAL_RANGED(rhs, 3, lhs, 3);
See also
- METAL_ASSERT_NOT_EQUAL
- METAL_EXPECT_NOT_EQUAL
- METAL_EXPECT_NOT_EQUAL_RANGED
- METAL_STATIC_ASSERT_NOT_EQUAL
- METAL_STATIC_ASSERT_NOT_EQUAL_BITWISE
- METAL_ASSERT_NOT_EQUAL_BITWISE
- METAL_EXPECT_NOT_EQUAL_BITWISE
- METAL_ASSERT_NOT_EQUAL_BITWISE_RANGED
- METAL_EXPECT_NOT_EQUAL_BITWISE_RANGED
This macro provides an inequality expectation for two ranges.
It succeeds if one element in the left-handside container is not equal to the one the right side.
\param LhsBegin The begin of the left-hand-side range. In C this is a pointer to an array. \param LhsEnd The end of the left-hand-side range (behind the last element). In C this is the size of the array. \param RhsBegin The begin of the right-hand-side range. In C this is a pointer to an array. \param RhsEnd The end of the right-hand-side range (behind the last element). In C this is the size of the array.
\par Example C++
std::vector<int> rhs = {1,2,3};
std::vector<int> lhs = {1,2,3};
METAL_EXPECT_NOT_EQUAL_RANGED(rhs.begin(), rhs.end(), lhs.begin(), lhs.end());
\par Example C
int rhs[3] = {1,2,3};
int lhs[3] = {1,2,3};
METAL_EXPECT_NOT_EQUAL_RANGED(rhs, 3, lhs, 3);
See also
- METAL_ASSERT_NOT_EQUAL
- METAL_EXPECT_NOT_EQUAL
- METAL_ASSERT_NOT_EQUAL_RANGED
- METAL_STATIC_ASSERT_NOT_EQUAL
- METAL_STATIC_ASSERT_NOT_EQUAL_BITWISE
- METAL_ASSERT_NOT_EQUAL_BITWISE
- METAL_EXPECT_NOT_EQUAL_BITWISE
- METAL_ASSERT_NOT_EQUAL_BITWISE_RANGED
- METAL_EXPECT_NOT_EQUAL_BITWISE_RANGED
This macro provides a bitwise inequality assertion for two ranges.
It succeeds if one element in the left-handside container is not equal to the one the right side.
\param LhsBegin The begin of the left-hand-side range. In C this is a pointer to an array. \param LhsEnd The end of the left-hand-side range (behind the last element). In C this is the size of the array. \param RhsBegin The begin of the right-hand-side range. In C this is a pointer to an array. \param RhsEnd The end of the right-hand-side range (behind the last element). In C this is the size of the array.
\par Example C++
std::vector<int> rhs = {1,2,3};
std::vector<int> lhs = {1,2,3};
METAL_ASSERT_NOT_EQUAL_BITWISE_RANGED(rhs.begin(), rhs.end(), lhs.begin(), lhs.end());
\par Example C
int rhs[3] = {1,2,3};
int lhs[3] = {1,2,3};
METAL_ASSERT_NOT_EQUAL_BITWISE_RANGED(rhs, 3, lhs, 3);
See also
- METAL_ASSERT_NOT_EQUAL
- METAL_EXPECT_NOT_EQUAL
- METAL_ASSERT_NOT_EQUAL_RANGED
- METAL_EXPECT_NOT_EQUAL_RANGED
- METAL_STATIC_ASSERT_NOT_EQUAL
- METAL_STATIC_ASSERT_NOT_EQUAL_BITWISE
- METAL_ASSERT_NOT_EQUAL_BITWISE
- METAL_EXPECT_NOT_EQUAL_BITWISE
- METAL_EXPECT_NOT_EQUAL_BITWISE_RANGED
This macro provides a bitwise inequality expectation for two ranges.
It succeeds if one element in the left-handside container is not equal to the one the right side.
\param LhsBegin The begin of the left-hand-side range. In C this is a pointer to an array. \param LhsEnd The end of the left-hand-side range (behind the last element). In C this is the size of the array. \param RhsBegin The begin of the right-hand-side range. In C this is a pointer to an array. \param RhsEnd The end of the right-hand-side range (behind the last element). In C this is the size of the array.
\par Example C++
std::vector<int> rhs = {1,2,3};
std::vector<int> lhs = {1,2,3};
METAL_EXPECT_NOT_EQUAL_BITWISE_RANGED(rhs.begin(), rhs.end(), lhs.begin(), lhs.end());
\par Example C
int rhs[3] = {1,2,3};
int lhs[3] = {1,2,3};
METAL_EXPECT_NOT_EQUAL_BITWISE_RANGED(rhs, 3, lhs, 3);
See also
- METAL_ASSERT_NOT_EQUAL
- METAL_EXPECT_NOT_EQUAL
- METAL_ASSERT_NOT_EQUAL_RANGED
- METAL_EXPECT_NOT_EQUAL_RANGED
- METAL_STATIC_ASSERT_NOT_EQUAL
- METAL_STATIC_ASSERT_NOT_EQUAL_BITWISE
- METAL_ASSERT_NOT_EQUAL_BITWISE
- METAL_EXPECT_NOT_EQUAL_BITWISE
- METAL_ASSERT_NOT_EQUAL_BITWISE_RANGED
This macro provides a bitwise equality assertion for two ranges with a tolerance.
It succeeds if one element in the left-handside container is not equal to the one the right side.
\param LhsBegin The begin of the left-hand-side range. In C this is a pointer to an array. \param LhsEnd The end of the left-hand-side range (behind the last element). In C this is the size of the array. \param RhsBegin The begin of the right-hand-side range. In C this is a pointer to an array. \param RhsEnd The end of the right-hand-side range (behind the last element). In C this is the size of the array. \param Tolerance The tolerance of the comparison
\par Example C++
std::vector<int> rhs = {11,22,33};
std::vector<int> lhs = {12,23,32};
METAL_ASSERT_CLOSE_RANGED(rhs.begin(), rhs.end(), lhs.begin(), lhs.end(), 1);
\par Example C
int rhs[3] = {12,25,37};
int lhs[3] = {13,24,36};
METAL_ASSERT_CLOSE_RANGED(rhs, 3, lhs, 3, 1);
See also.
- METAL_ASSERT_CLOSE
- METAL_EXPECT_CLOSE
- METAL_STATIC_ASSERT_CLOSE
- METAL_ASSERT_CLOSE_RELATIVE
- METAL_EXPECT_CLOSE_RELATIVE
- METAL_STATIC_ASSERT_CLOSE_RELATIVE
- METAL_ASSERT_CLOSE_PERCENT
- METAL_EXPECT_CLOSE_PERCENT
- METAL_STATIC_ASSERT_CLOSE_PERCENT
- METAL_EXPECT_CLOSE_RANGED
- METAL_ASSERT_CLOSE_RELATIVE_RANGED
- METAL_EXPECT_CLOSE_RELATIVE_RANGED
- METAL_ASSERT_CLOSE_PERCENT_RANGED
- METAL_EXPECT_CLOSE_PERCENT_RANGED
This macro provides a bitwise equality expectation for two ranges with a tolerance.
It succeeds if one element in the left-handside container is not equal to the one the right side.
\param LhsBegin The begin of the left-hand-side range. In C this is a pointer to an array. \param LhsEnd The end of the left-hand-side range (behind the last element). In C this is the size of the array. \param RhsBegin The begin of the right-hand-side range. In C this is a pointer to an array. \param RhsEnd The end of the right-hand-side range (behind the last element). In C this is the size of the array. \param Tolerance The tolerance of the comparison
\par Example C++
std::vector<int> rhs = {11,22,33};
std::vector<int> lhs = {12,23,32};
METAL_EXPECT_CLOSE_RANGED(rhs.begin(), rhs.end(), lhs.begin(), lhs.end(), 1);
\par Example C
int rhs[3] = {12,25,37};
int lhs[3] = {13,24,36};
METAL_EXPECT_CLOSE_RANGED(rhs, 3, lhs, 3, 1);
See also.
- METAL_ASSERT_CLOSE
- METAL_EXPECT_CLOSE
- METAL_STATIC_ASSERT_CLOSE
- METAL_ASSERT_CLOSE_RELATIVE
- METAL_EXPECT_CLOSE_RELATIVE
- METAL_STATIC_ASSERT_CLOSE_RELATIVE
- METAL_ASSERT_CLOSE_PERCENT
- METAL_EXPECT_CLOSE_PERCENT
- METAL_STATIC_ASSERT_CLOSE_PERCENT
- METAL_ASSERT_CLOSE_RANGED
- METAL_ASSERT_CLOSE_RELATIVE_RANGED
- METAL_EXPECT_CLOSE_RELATIVE_RANGED
- METAL_ASSERT_CLOSE_PERCENT_RANGED
- METAL_EXPECT_CLOSE_PERCENT_RANGED
This macro provides a bitwise equality assertion for two ranges with a relative tolerance.
It succeeds if one element in the left-handside container is not equal to the one the right side.
\param LhsBegin The begin of the left-hand-side range. In C this is a pointer to an array. \param LhsEnd The end of the left-hand-side range (behind the last element). In C this is the size of the array. \param RhsBegin The begin of the right-hand-side range. In C this is a pointer to an array. \param RhsEnd The end of the right-hand-side range (behind the last element). In C this is the size of the array. \param Tolerance The tolerance of the comparison
\par Example C++
std::vector<double> rhs = {1.0, 2.0, 3.0};
std::vector<double> lhs = {1.1, 1.8, 3.3};
METAL_ASSERT_CLOSE_RELATIVE_RANGED(rhs.begin(), rhs.end(), lhs.begin(), lhs.end(), 0.1);
\par Example C
double rhs[3] = {1.0, 2.0, 3.0};
double lhs[3] = {0.9, 2.2, 2.7};
METAL_ASSERT_NOT_EQUAL_BITWISE_RANGED(rhs, 3, lhs, 3, 0.1);
See also.
- METAL_ASSERT_CLOSE
- METAL_EXPECT_CLOSE
- METAL_STATIC_ASSERT_CLOSE
- METAL_ASSERT_CLOSE_RELATIVE
- METAL_EXPECT_CLOSE_RELATIVE
- METAL_STATIC_ASSERT_CLOSE_RELATIVE
- METAL_ASSERT_CLOSE_PERCENT
- METAL_EXPECT_CLOSE_PERCENT
- METAL_STATIC_ASSERT_CLOSE_PERCENT
- METAL_ASSERT_CLOSE_RANGED
- METAL_EXPECT_CLOSE_RANGED
- METAL_EXPECT_CLOSE_RELATIVE_RANGED
- METAL_ASSERT_CLOSE_PERCENT_RANGED
- METAL_EXPECT_CLOSE_PERCENT_RANGED
This macro provides a bitwise equality expectation for two ranges with a relative tolerance.
It succeeds if one element in the left-handside container is not equal to the one the right side.
\param LhsBegin The begin of the left-hand-side range. In C this is a pointer to an array. \param LhsEnd The end of the left-hand-side range (behind the last element). In C this is the size of the array. \param RhsBegin The begin of the right-hand-side range. In C this is a pointer to an array. \param RhsEnd The end of the right-hand-side range (behind the last element). In C this is the size of the array. \param Tolerance The tolerance of the comparison
\par Example C++
std::vector<double> rhs = {1.0, 2.0, 3.0};
std::vector<double> lhs = {1.1, 1.8, 3.3};
METAL_ASSERT_CLOSE_RELATIVE_RANGED(rhs.begin(), rhs.end(), lhs.begin(), lhs.end(), 0.1);
\par Example C
double rhs[3] = {1.0, 2.0, 3.0};
double lhs[3] = {0.9, 2.2, 2.7};
METAL_ASSERT_NOT_EQUAL_BITWISE_RANGED(rhs, 3, lhs, 3, 0.1);
See also.
- METAL_ASSERT_CLOSE
- METAL_EXPECT_CLOSE
- METAL_STATIC_ASSERT_CLOSE
- METAL_ASSERT_CLOSE_RELATIVE
- METAL_EXPECT_CLOSE_RELATIVE
- METAL_STATIC_ASSERT_CLOSE_RELATIVE
- METAL_ASSERT_CLOSE_PERCENT
- METAL_EXPECT_CLOSE_PERCENT
- METAL_STATIC_ASSERT_CLOSE_PERCENT
- METAL_ASSERT_CLOSE_RANGED
- METAL_EXPECT_CLOSE_RANGED
- METAL_ASSERT_CLOSE_RELATIVE_RANGED
- METAL_ASSERT_CLOSE_PERCENT_RANGED
- METAL_EXPECT_CLOSE_PERCENT_RANGED
This macro provides a bitwise equality assertion for two ranges with a relative tolerance in percent.
It succeeds if one element in the left-handside container is not equal to the one the right side.
\param LhsBegin The begin of the left-hand-side range. In C this is a pointer to an array. \param LhsEnd The end of the left-hand-side range (behind the last element). In C this is the size of the array. \param RhsBegin The begin of the right-hand-side range. In C this is a pointer to an array. \param RhsEnd The end of the right-hand-side range (behind the last element). In C this is the size of the array. \param Tolerance The tolerance of the comparison
\par Example C++
std::vector<double> rhs = {1.0, 2.0, 3.0};
std::vector<double> lhs = {1.1, 1.8, 3.3};
METAL_ASSERT_CLOSE_PERCENT_RANGED(rhs.begin(), rhs.end(), lhs.begin(), lhs.end(), 10);
\par Example C
double rhs[3] = {1.0, 2.0, 3.0};
double lhs[3] = {0.9, 2.2, 2.7};
METAL_ASSERT_NOT_EQUAL_BITWISE_RANGED(rhs, 3, lhs, 3, 10);
See also.
- METAL_ASSERT_CLOSE
- METAL_EXPECT_CLOSE
- METAL_STATIC_ASSERT_CLOSE
- METAL_ASSERT_CLOSE_RELATIVE
- METAL_EXPECT_CLOSE_RELATIVE
- METAL_STATIC_ASSERT_CLOSE_RELATIVE
- METAL_ASSERT_CLOSE_PERCENT
- METAL_EXPECT_CLOSE_PERCENT
- METAL_STATIC_ASSERT_CLOSE_PERCENT
- METAL_ASSERT_CLOSE_RANGED
- METAL_EXPECT_CLOSE_RANGED
- METAL_ASSERT_CLOSE_RELATIVE_RANGED
- METAL_EXPECT_CLOSE_RELATIVE_RANGED
- METAL_EXPECT_CLOSE_PERCENT_RANGED
This macro provides a bitwise equality expectation for two ranges with a relative tolerance in percent.
It succeeds if one element in the left-handside container is not equal to the one the right side.
\param LhsBegin The begin of the left-hand-side range. In C this is a pointer to an array. \param LhsEnd The end of the left-hand-side range (behind the last element). In C this is the size of the array. \param RhsBegin The begin of the right-hand-side range. In C this is a pointer to an array. \param RhsEnd The end of the right-hand-side range (behind the last element). In C this is the size of the array. \param Tolerance The tolerance of the comparison
\par Example C++
std::vector<double> rhs = {1.0, 2.0, 3.0};
std::vector<double> lhs = {1.1, 1.8, 3.3};
METAL_ASSERT_CLOSE_PERCENT_RANGED(rhs.begin(), rhs.end(), lhs.begin(), lhs.end(), 10);
\par Example C
double rhs[3] = {1.0, 2.0, 3.0};
double lhs[3] = {0.9, 2.2, 2.7};
METAL_ASSERT_NOT_EQUAL_BITWISE_RANGED(rhs, 3, lhs, 3, 10);
See also.
- METAL_ASSERT_CLOSE
- METAL_EXPECT_CLOSE
- METAL_STATIC_ASSERT_CLOSE
- METAL_ASSERT_CLOSE_RELATIVE
- METAL_EXPECT_CLOSE_RELATIVE
- METAL_STATIC_ASSERT_CLOSE_RELATIVE
- METAL_ASSERT_CLOSE_PERCENT
- METAL_EXPECT_CLOSE_PERCENT
- METAL_STATIC_ASSERT_CLOSE_PERCENT
- METAL_ASSERT_CLOSE_RANGED
- METAL_EXPECT_CLOSE_RANGED
- METAL_ASSERT_CLOSE_RELATIVE_RANGED
- METAL_EXPECT_CLOSE_RELATIVE_RANGED
- METAL_ASSERT_CLOSE_PERCENT_RANGED
This macro provides a greater or equal assertion for two ranges.
It succeeds if one element in the left-handside container is not equal to the one the right side.
\param LhsBegin The begin of the left-hand-side range. In C this is a pointer to an array. \param LhsEnd The end of the left-hand-side range (behind the last element). In C this is the size of the array. \param RhsBegin The begin of the right-hand-side range. In C this is a pointer to an array. \param RhsEnd The end of the right-hand-side range (behind the last element). In C this is the size of the array.
\par Example C++
std::vector<int> rhs = {1,4,3};
std::vector<int> lhs = {1,2,3};
METAL_ASSERT_GE_RANGED(rhs.begin(), rhs.end(), lhs.begin(), lhs.end());
\par Example C
int rhs[3] = {1,4,3};
int lhs[3] = {1,2,3};
METAL_ASSERT_GE_RANGED(rhs, 3, lhs, 3);
See also
- METAL_ASSERT_GE
- METAL_EXPECT_GE
- METAL_EXPECT_GE_RANGED
- METAL_STATIC_ASSERT_GE
- METAL_STATIC_ASSERT_GE_BITWISE
- METAL_ASSERT_GE_BITWISE
- METAL_EXPECT_GE_BITWISE
- METAL_ASSERT_GE_BITWISE_RANGED
- METAL_EXPECT_GE_BITWISE_RANGED
This macro provides a greater or equal expectation for two ranges.
It succeeds if one element in the left-handside container is not equal to the one the right side.
\param LhsBegin The begin of the left-hand-side range. In C this is a pointer to an array. \param LhsEnd The end of the left-hand-side range (behind the last element). In C this is the size of the array. \param RhsBegin The begin of the right-hand-side range. In C this is a pointer to an array. \param RhsEnd The end of the right-hand-side range (behind the last element). In C this is the size of the array.
\par Example C++
std::vector<int> rhs = {1,3,3};
std::vector<int> lhs = {1,2,3};
METAL_EXPECT_GE_RANGED(rhs.begin(), rhs.end(), lhs.begin(), lhs.end());
\par Example C
int rhs[3] = {1,3,3};
int lhs[3] = {1,2,3};
METAL_EXPECT_GE_RANGED(rhs, 3, lhs, 3);
See also
- METAL_ASSERT_GE
- METAL_EXPECT_GE
- METAL_ASSERT_GE_RANGED
- METAL_STATIC_ASSERT_GE
- METAL_STATIC_ASSERT_GE_BITWISE
- METAL_ASSERT_GE_BITWISE
- METAL_EXPECT_GE_BITWISE
- METAL_ASSERT_GE_BITWISE_RANGED
- METAL_EXPECT_GE_BITWISE_RANGED
This macro provides a bitwise greater or equal assertion for two ranges.
It succeeds if one element in the left-handside container is not equal to the one the right side.
\param LhsBegin The begin of the left-hand-side range. In C this is a pointer to an array. \param LhsEnd The end of the left-hand-side range (behind the last element). In C this is the size of the array. \param RhsBegin The begin of the right-hand-side range. In C this is a pointer to an array. \param RhsEnd The end of the right-hand-side range (behind the last element). In C this is the size of the array.
\par Example C++
std::vector<int> rhs = {1,3,3};
std::vector<int> lhs = {1,2,3};
METAL_ASSERT_GE_BITWISE_RANGED(rhs.begin(), rhs.end(), lhs.begin(), lhs.end());
\par Example C
int rhs[3] = {1,3,3};
int lhs[3] = {1,2,3};
METAL_ASSERT_GE_BITWISE_RANGED(rhs, 3, lhs, 3);
See also
- METAL_ASSERT_GE
- METAL_EXPECT_GE
- METAL_ASSERT_GE_RANGED
- METAL_EXPECT_GE_RANGED
- METAL_STATIC_ASSERT_GE
- METAL_STATIC_ASSERT_GE_BITWISE
- METAL_ASSERT_GE_BITWISE
- METAL_EXPECT_GE_BITWISE
- METAL_EXPECT_GE_BITWISE_RANGED
This macro provides a bitwise greater or equal expectation for two ranges.
It succeeds if one element in the left-handside container is not equal to the one the right side.
\param LhsBegin The begin of the left-hand-side range. In C this is a pointer to an array. \param LhsEnd The end of the left-hand-side range (behind the last element). In C this is the size of the array. \param RhsBegin The begin of the right-hand-side range. In C this is a pointer to an array. \param RhsEnd The end of the right-hand-side range (behind the last element). In C this is the size of the array.
\par Example C++
std::vector<int> rhs = {1,2,3};
std::vector<int> lhs = {1,1,1};
METAL_EXPECT_GE_BITWISE_RANGED(rhs.begin(), rhs.end(), lhs.begin(), lhs.end());
\par Example C
int rhs[3] = {1,3,3};
int lhs[3] = {1,2,3};
METAL_EXPECT_GE_BITWISE_RANGED(rhs, 3, lhs, 3);
See also
- METAL_ASSERT_GE
- METAL_EXPECT_GE
- METAL_ASSERT_GE_RANGED
- METAL_EXPECT_GE_RANGED
- METAL_STATIC_ASSERT_GE
- METAL_STATIC_ASSERT_GE_BITWISE
- METAL_ASSERT_GE_BITWISE
- METAL_EXPECT_GE_BITWISE
- METAL_ASSERT_GE_BITWISE_RANGED
This macro provides a lesser or equal assertion for two ranges.
It succeeds if one element in the left-handside container is not equal to the one the right side.
\param LhsBegin The begin of the left-hand-side range. In C this is a pointer to an array. \param LhsEnd The end of the left-hand-side range (behind the last element). In C this is the size of the array. \param RhsBegin The begin of the right-hand-side range. In C this is a pointer to an array. \param RhsEnd The end of the right-hand-side range (behind the last element). In C this is the size of the array.
\par Example C++
std::vector<int> rhs = {1,1,3};
std::vector<int> lhs = {1,2,3};
METAL_ASSERT_LE_RANGED(rhs.begin(), rhs.end(), lhs.begin(), lhs.end());
\par Example C
int rhs[3] = {1,1,3};
int lhs[3] = {1,2,3};
METAL_ASSERT_LE_RANGED(rhs, 3, lhs, 3);
See also
- METAL_ASSERT_LE
- METAL_EXPECT_LE
- METAL_EXPECT_LE_RANGED
- METAL_STATIC_ASSERT_LE
- METAL_STATIC_ASSERT_LE_BITWISE
- METAL_ASSERT_LE_BITWISE
- METAL_EXPECT_LE_BITWISE
- METAL_ASSERT_LE_BITWISE_RANGED
- METAL_EXPECT_LE_BITWISE_RANGED
This macro provides a lesser or equal expectation for two ranges.
It succeeds if one element in the left-handside container is not equal to the one the right side.
\param LhsBegin The begin of the left-hand-side range. In C this is a pointer to an array. \param LhsEnd The end of the left-hand-side range (behind the last element). In C this is the size of the array. \param RhsBegin The begin of the right-hand-side range. In C this is a pointer to an array. \param RhsEnd The end of the right-hand-side range (behind the last element). In C this is the size of the array.
\par Example C++
std::vector<int> rhs = {1,1,3};
std::vector<int> lhs = {1,2,3};
METAL_EXPECT_LE_RANGED(rhs.begin(), rhs.end(), lhs.begin(), lhs.end());
\par Example C
int rhs[3] = {1,1,3};
int lhs[3] = {1,2,3};
METAL_EXPECT_LE_RANGED(rhs, 3, lhs, 3);
See also
- METAL_ASSERT_LE
- METAL_EXPECT_LE
- METAL_ASSERT_LE_RANGED
- METAL_STATIC_ASSERT_LE
- METAL_STATIC_ASSERT_LE_BITWISE
- METAL_ASSERT_LE_BITWISE
- METAL_EXPECT_LE_BITWISE
- METAL_ASSERT_LE_BITWISE_RANGED
- METAL_EXPECT_LE_BITWISE_RANGED
This macro provides a bitwise lesser or equal assertion for two ranges.
It succeeds if one element in the left-handside container is not equal to the one the right side.
\param LhsBegin The begin of the left-hand-side range. In C this is a pointer to an array. \param LhsEnd The end of the left-hand-side range (behind the last element). In C this is the size of the array. \param RhsBegin The begin of the right-hand-side range. In C this is a pointer to an array. \param RhsEnd The end of the right-hand-side range (behind the last element). In C this is the size of the array.
\par Example C++
std::vector<int> rhs = {1,1,3};
std::vector<int> lhs = {1,2,3};
METAL_ASSERT_LE_BITWISE_RANGED(rhs.begin(), rhs.end(), lhs.begin(), lhs.end());
\par Example C
int rhs[3] = {1,1,3};
int lhs[3] = {1,2,3};
METAL_ASSERT_LE_BITWISE_RANGED(rhs, 3, lhs, 3);
See also
- METAL_ASSERT_LE
- METAL_EXPECT_LE
- METAL_ASSERT_LE_RANGED
- METAL_EXPECT_LE_RANGED
- METAL_STATIC_ASSERT_LE
- METAL_STATIC_ASSERT_LE_BITWISE
- METAL_ASSERT_LE_BITWISE
- METAL_EXPECT_LE_BITWISE
- METAL_EXPECT_LE_BITWISE_RANGED
This macro provides a bitwise lesser or equal expectation for two ranges.
It succeeds if one element in the left-handside container is not equal to the one the right side.
\param LhsBegin The begin of the left-hand-side range. In C this is a pointer to an array. \param LhsEnd The end of the left-hand-side range (behind the last element). In C this is the size of the array. \param RhsBegin The begin of the right-hand-side range. In C this is a pointer to an array. \param RhsEnd The end of the right-hand-side range (behind the last element). In C this is the size of the array.
\par Example C++
std::vector<int> rhs = {1,2,3};
std::vector<int> lhs = {1,3,4};
METAL_EXPECT_LE_BITWISE_RANGED(rhs.begin(), rhs.end(), lhs.begin(), lhs.end());
\par Example C
int rhs[3] = {1,3,3};
int lhs[3] = {1,4,3};
METAL_EXPECT_LE_BITWISE_RANGED(rhs, 3, lhs, 3);
See also
- METAL_ASSERT_LE
- METAL_EXPECT_LE
- METAL_ASSERT_LE_RANGED
- METAL_EXPECT_LE_RANGED
- METAL_STATIC_ASSERT_LE
- METAL_STATIC_ASSERT_LE_BITWISE
- METAL_ASSERT_LE_BITWISE
- METAL_EXPECT_LE_BITWISE
- METAL_ASSERT_LE_BITWISE_RANGED
This macro provides a greater than assertion for two ranges.
It succeeds if one element in the left-handside container is not equal to the one the right side.
\param LhsBegin The begin of the left-hand-side range. In C this is a pointer to an array. \param LhsEnd The end of the left-hand-side range (behind the last element). In C this is the size of the array. \param RhsBegin The begin of the right-hand-side range. In C this is a pointer to an array. \param RhsEnd The end of the right-hand-side range (behind the last element). In C this is the size of the array.
\par Example C++
std::vector<int> rhs = {2,4,4};
std::vector<int> lhs = {1,2,3};
METAL_ASSERT_GREATER_RANGED(rhs.begin(), rhs.end(), lhs.begin(), lhs.end());
\par Example C
int rhs[3] = {3,4,7};
int lhs[3] = {1,2,3};
METAL_ASSERT_GREATER_RANGED(rhs, 3, lhs, 3);
See also
This macro provides a greater than expectation for two ranges.
It succeeds if one element in the left-handside container is not equal to the one the right side.
\param LhsBegin The begin of the left-hand-side range. In C this is a pointer to an array. \param LhsEnd The end of the left-hand-side range (behind the last element). In C this is the size of the array. \param RhsBegin The begin of the right-hand-side range. In C this is a pointer to an array. \param RhsEnd The end of the right-hand-side range (behind the last element). In C this is the size of the array.
\par Example C++
std::vector<int> rhs = {2,3,3};
std::vector<int> lhs = {1,2,3};
METAL_EXPECT_GREATER_RANGED(rhs.begin(), rhs.end(), lhs.begin(), lhs.end());
\par Example C
int rhs[3] = {1,3,3};
int lhs[3] = {0,2,2};
METAL_EXPECT_GREATER_RANGED(rhs, 3, lhs, 3);
See also
This macro provides a lesser than assertion for two ranges.
It succeeds if one element in the left-handside container is not equal to the one the right side.
\param LhsBegin The begin of the left-hand-side range. In C this is a pointer to an array. \param LhsEnd The end of the left-hand-side range (behind the last element). In C this is the size of the array. \param RhsBegin The begin of the right-hand-side range. In C this is a pointer to an array. \param RhsEnd The end of the right-hand-side range (behind the last element). In C this is the size of the array.
\par Example C++
std::vector<int> rhs = {2,4,4};
std::vector<int> lhs = {3,5,6};
METAL_ASSERT_LESSER_RANGED(rhs.begin(), rhs.end(), lhs.begin(), lhs.end());
\par Example C
int rhs[3] = {3,4,7};
int lhs[3] = {4,5,8};
METAL_ASSERT_LESSER_RANGED(rhs, 3, lhs, 3);
See also
This macro provides a lesser than expectation for two ranges.
It succeeds if one element in the left-handside container is not equal to the one the right side.
\param LhsBegin The begin of the left-hand-side range. In C this is a pointer to an array. \param LhsEnd The end of the left-hand-side range (behind the last element). In C this is the size of the array. \param RhsBegin The begin of the right-hand-side range. In C this is a pointer to an array. \param RhsEnd The end of the right-hand-side range (behind the last element). In C this is the size of the array.
\par Example C++
std::vector<int> rhs = {2,3,3};
std::vector<int> lhs = {3,4,5};
METAL_EXPECT_LESSER_RANGED(rhs.begin(), rhs.end(), lhs.begin(), lhs.end());
\par Example C
int rhs[3] = {1,3,3};
int lhs[3] = {0,2,2};
METAL_EXPECT_LESSER_RANGED(rhs, 3, lhs, 3);
See also
This macro does provide an assertion for an exception of a set of types. It fails if no exception or an exception not in the list (except inheriting exceptions) are thrown. If the required code includes commas, it might not compile correctly. To allow this the try and catch expressions can be seperated using \xmlonly METAL_ENTER_TRY and \xmlonly METAL_ASSERT_THROW_EXIT \endxmlonly.
\note An exception not listed will still be caught.
\param Code The code to be executed \param Exceptions... The set of exceptions.
\par Example
METAL_ASSERT_THROW(std::stoi("invalid string"), std::out_of_range, std::invalid_range);
METAL_ASSERT_THROW(std::stoi("123987789234789897234"), std::out_of_range, std::invalid_range);
See also
- METAL_EXPECT_THROW
- METAL_ASSERT_ANY_THROW
- METAL_EXPECT_ANY_THROW
- METAL_ASSERT_NO_THROW
- METAL_EXPECT_NO_THROW
- METAL_ENTER_TRY
- METAL_ASSERT_THROW_EXIT
- METAL_EXPECT_THROW_EXIT
- METAL_ASSERT_ANY_THROW_EXIT
- METAL_EXPECT_ANY_THROW_EXIT
- METAL_ASSERT_NO_THROW_EXIT
- METAL_EXPECT_NO_THROW_EXIT
This macro does provide an expectation for an exception of a set of types. It fails if no exception or an exception not in the list (except inheriting exceptions) are thrown. If the required code includes commas, it might not compile correctly. To allow this the try and catch expressions can be seperated using \xmlonly METAL_ENTER_TRY and \xmlonly METAL_EXPECT_THROW_EXIT \endxmlonly.
\note An exception not listed will still be caught.
\param Code The code to be executed \param Exceptions... The set of exceptions.
\par Example
METAL_EXPECT_THROW(std::stoi("invalid string"), std::out_of_range, std::invalid_range);
METAL_EXPECT_THROW(std::stoi("123987789234789897234"), std::out_of_range, std::invalid_range);
See also
- METAL_ASSERT_THROW
- METAL_ASSERT_ANY_THROW
- METAL_EXPECT_ANY_THROW
- METAL_ASSERT_NO_THROW
- METAL_EXPECT_NO_THROW
- METAL_ENTER_TRY
- METAL_ASSERT_THROW_EXIT
- METAL_EXPECT_THROW_EXIT
- METAL_ASSERT_ANY_THROW_EXIT
- METAL_EXPECT_ANY_THROW_EXIT
- METAL_ASSERT_NO_THROW_EXIT
- METAL_EXPECT_NO_THROW_EXIT
This macro does provide an assertion for the throw of any exception. If the required code includes commas, it might not compile correctly. To allow this the try and catch expressions can be seperated using \xmlonly METAL_ENTER_TRY and \xmlonly METAL_ASSERT_ANY_THROW_EXIT \endxmlonly.
\param Code The code to be executed
\par Example
METAL_ASSERT_ANY_THROW(std::stoi("invalid string"));
See also
- METAL_ASSERT_THROW
- METAL_EXPECT_THROW
- METAL_EXPECT_ANY_THROW
- METAL_ASSERT_NO_THROW
- METAL_EXPECT_NO_THROW
- METAL_ENTER_TRY
- METAL_ASSERT_THROW_EXIT
- METAL_EXPECT_THROW_EXIT
- METAL_ASSERT_ANY_THROW_EXIT
- METAL_EXPECT_ANY_THROW_EXIT
- METAL_ASSERT_NO_THROW_EXIT
- METAL_EXPECT_NO_THROW_EXIT
This macro does provide an assertion for the throw of any exception. If the required code includes commas, it might not compile correctly. To allow this the try and catch expressions can be seperated using \xmlonly METAL_ENTER_TRY and \xmlonly METAL_EXPECT_ANY_THROW_EXIT \endxmlonly.
\param Code The code to be executed
\par Example
METAL_EXPECT_ANY_THROW(std::stoi("invalid string"));
See also
- METAL_ASSERT_THROW
- METAL_EXPECT_THROW
- METAL_EXPECT_ANY_THROW
- METAL_ASSERT_NO_THROW
- METAL_EXPECT_NO_THROW
- METAL_ENTER_TRY
- METAL_ASSERT_THROW_EXIT
- METAL_EXPECT_THROW_EXIT
- METAL_ASSERT_ANY_THROW_EXIT
- METAL_EXPECT_ANY_THROW_EXIT
- METAL_ASSERT_NO_THROW_EXIT
- METAL_EXPECT_NO_THROW_EXIT
This macro does provide an assertion for the throw of no exception. If the required code includes commas, it might not compile correctly. To allow this the try and catch expressions can be seperated using \xmlonly METAL_ENTER_TRY and \xmlonly METAL_ASSERT_NO_THROW_EXIT \endxmlonly.
\param Code The code to be executed
\par Example
METAL_ASSERT_NO_THROW(std::stoi("42"));
See also
- METAL_ASSERT_THROW
- METAL_EXPECT_THROW
- METAL_ASSERT_ANY_THROW
- METAL_EXPECT_ANY_THROW
- METAL_EXPECT_NO_THROW
- METAL_ENTER_TRY
- METAL_ASSERT_THROW_EXIT
- METAL_EXPECT_THROW_EXIT
- METAL_ASSERT_ANY_THROW_EXIT
- METAL_EXPECT_ANY_THROW_EXIT
- METAL_ASSERT_NO_THROW_EXIT
- METAL_EXPECT_NO_THROW_EXIT
This macro does provide an assertion for the throw of no exception. If the required code includes commas, it might not compile correctly. To allow this the try and catch expressions can be seperated using \xmlonly METAL_ENTER_TRY and \xmlonly METAL_EXPECT_NO_THROW_EXIT \endxmlonly.
\param Code The code to be executed
\par Example
METAL_EXPECT_NO_THROW(std::stoi("42"));
See also
- METAL_ASSERT_THROW
- METAL_EXPECT_THROW
- METAL_ASSERT_ANY_THROW
- METAL_EXPECT_ANY_THROW
- METAL_ASSERT_NO_THROW
- METAL_ENTER_TRY
- METAL_ASSERT_THROW_EXIT
- METAL_EXPECT_THROW_EXIT
- METAL_ASSERT_ANY_THROW_EXIT
- METAL_EXPECT_ANY_THROW_EXIT
- METAL_ASSERT_NO_THROW_EXIT
- METAL_EXPECT_NO_THROW_EXIT
This macro is for seperate exceptions tests, i.e. if longer code shall be used.
It expands to try {
, but documents the intent much clearer.
The seperated syntax is used, when the
\par Example
METAL_TRY()
int i,j;
i = std::stoi("42");
j = std::stoi("12");
METAL_ASSERT_NO_THROW();
See also
- METAL_ASSERT_THROW
- METAL_EXPECT_THROW
- METAL_ASSERT_ANY_THROW
- METAL_EXPECT_ANY_THROW
- METAL_ASSERT_NO_THROW
- METAL_EXPECT_NO_THROW
- METAL_ASSERT_THROW_EXIT
- METAL_EXPECT_THROW_EXIT
- METAL_ASSERT_ANY_THROW_EXIT
- METAL_EXPECT_ANY_THROW_EXIT
- METAL_ASSERT_NO_THROW_EXIT
- METAL_EXPECT_NO_THROW_EXIT
This macro provides an assertion for an exception of a set of types. It fails if no exception or an exception not in the list (except inheriting exceptions) are thrown. This is the seperate form of \xmlonly METAL_ASSERT_THROW \endxmlonly.
\note An exception not listed will still be caught.
\param Exceptions... The set of exceptions.
\par Example
METAL_ENTER_TRY()
int i, j;
i = std::stoi("invalid string");
j = std::stoi("123987789234789897234");
METAL_ASSERT_THROW_EXIT(std::out_of_range, std::invalid_range)
See also
- METAL_ASSERT_THROW
- METAL_EXPECT_THROW
- METAL_ASSERT_ANY_THROW
- METAL_EXPECT_ANY_THROW
- METAL_ASSERT_NO_THROW
- METAL_EXPECT_NO_THROW
- METAL_ENTER_TRY
- METAL_EXPECT_THROW_EXIT
- METAL_ASSERT_ANY_THROW_EXIT
- METAL_EXPECT_ANY_THROW_EXIT
- METAL_ASSERT_NO_THROW_EXIT
- METAL_EXPECT_NO_THROW_EXIT
This macro provides an expectation for an exception of a set of types. It fails if no exception or an exception not in the list (except inheriting exceptions) are thrown. This is the seperate form of \xmlonly METAL_EXPECT_THROW \endxmlonly.
\note An exception not listed will still be caught.
\param Exceptions... The set of exceptions.
\par Example
METAL_ENTER_TRY()
int i, j;
i = std::stoi("invalid string");
j = std::stoi("123987789234789897234");
METAL_EXPECT_THROW_EXIT(std::out_of_range, std::invalid_range)
See also
- METAL_ASSERT_THROW
- METAL_EXPECT_THROW
- METAL_ASSERT_ANY_THROW
- METAL_EXPECT_ANY_THROW
- METAL_ASSERT_NO_THROW
- METAL_EXPECT_NO_THROW
- METAL_ENTER_TRY
- METAL_ASSERT_THROW_EXIT
- METAL_ASSERT_ANY_THROW_EXIT
- METAL_EXPECT_ANY_THROW_EXIT
- METAL_ASSERT_NO_THROW_EXIT
- METAL_EXPECT_NO_THROW_EXIT
This macro provides an assertion for the throw of any exception. This is the seperate form of \xmlonly METAL_ASSERT_ANY_THROW \endxmlonly.
\par Example
METAL_ENTER_TRY()
int i = std::stoi("invalid string");
METAL_ASSERT_ANY_THROW_EXIT();
See also
- METAL_ASSERT_THROW
- METAL_EXPECT_THROW
- METAL_ASSERT_ANY_THROW
- METAL_EXPECT_ANY_THROW
- METAL_ASSERT_NO_THROW
- METAL_EXPECT_NO_THROW
- METAL_ENTER_TRY
- METAL_ASSERT_THROW_EXIT
- METAL_EXPECT_THROW_EXIT
- METAL_EXPECT_ANY_THROW_EXIT
- METAL_ASSERT_NO_THROW_EXIT
- METAL_EXPECT_NO_THROW_EXIT
This macro provides an assertion for the throw of any exception. This is the seperate form of \xmlonly METAL_EXPECT_ANY_THROW \endxmlonly.
\par Example
METAL_ENTER_TRY()
int i = std::stoi("invalid string");
METAL_EXPECT_ANY_THROW_EXIT();
See also
- METAL_ASSERT_THROW
- METAL_EXPECT_THROW
- METAL_ASSERT_ANY_THROW
- METAL_EXPECT_ANY_THROW
- METAL_ASSERT_NO_THROW
- METAL_EXPECT_NO_THROW
- METAL_ENTER_TRY
- METAL_ASSERT_THROW_EXIT
- METAL_EXPECT_THROW_EXIT
- METAL_ASSERT_ANY_THROW_EXIT
- METAL_ASSERT_NO_THROW_EXIT
- METAL_EXPECT_NO_THROW_EXIT
This macro provides an assertion for the throw of no exception. This is the seperate form of \xmlonly METAL_ASSERT_NO_THROW \endxmlonly.
\par Example
METAL_ENTER_TRY()
int i = std::stoi("42");
METAL_ASSERT_NO_THROW_EXIT()
See also
- METAL_ASSERT_THROW
- METAL_EXPECT_THROW
- METAL_ASSERT_ANY_THROW
- METAL_EXPECT_ANY_THROW
- METAL_ASSERT_NO_THROW
- METAL_EXPECT_NO_THROW
- METAL_ENTER_TRY
- METAL_ASSERT_THROW_EXIT
- METAL_EXPECT_THROW_EXIT
- METAL_ASSERT_ANY_THROW_EXIT
- METAL_EXPECT_ANY_THROW_EXIT
- METAL_EXPECT_NO_THROW_EXIT
This macro provides an assertion for the throw of no exception. This is the seperate form of \xmlonly METAL_EXPECT_NO_THROW \endxmlonly.
\par Example
METAL_ENTER_TRY()
int i = std::stoi("42");
METAL_EXPECT_NO_THROW_EXIT()
See also
- METAL_ASSERT_THROW
- METAL_EXPECT_THROW
- METAL_ASSERT_ANY_THROW
- METAL_EXPECT_ANY_THROW
- METAL_ASSERT_NO_THROW
- METAL_EXPECT_NO_THROW
- METAL_ENTER_TRY
- METAL_ASSERT_THROW_EXIT
- METAL_EXPECT_THROW_EXIT
- METAL_ASSERT_ANY_THROW_EXIT
- METAL_EXPECT_ANY_THROW_EXIT
- METAL_ASSERT_NO_THROW_EXIT
This macro can be used to assert the execution of a certain line.
\warning At the current state this must be validated in the output.
See also
This macro can be used to expect the execution of a certain line.
\warning At the current state this must be validated in the output.
See also
This macro can be used to assert a certain line is not executed. Fails when executed.
\par example
if (false)
METAL_ASSERT_NO_EXECUTE()
See also
This macro can be used to assert a certain line is not executed. Fails when executed.
\par example
if (false)
METAL_EXPECT_NO_EXECUTE()
See also
This macro declares an expression as a critical test. This means, that in hosted mode, the current test case will be aborted.
\warning Critical test abortion on fail does only work in hosted mode.
\param Check The actual check
Example
METAL_CRITICAL(METAL_ASSERT(true));
See also
This macro provides entering a critical section, when more than one tests shall be critical at once.
Example
METAL_ENTER_CRITICAL()
METAL_ASSERT(true);
METAL_EXPECT_EQUAL(42, 0x2A);
METAL_EXIT_CRITICAL()
See also
This macro provides entering a critical section, when more than one tests shall be critical at once.
Example
METAL_ENTER_CRITICAL()
METAL_ASSERT(true);
METAL_EXPECT_EQUAL(42, 0x2A);
METAL_EXIT_CRITICAL()
See also
- Overview
- Runner Introduction
- Runner Invocation
- Runner Plugins
- Runner Extender
- Runner FAQ
- Runner Reference
- Unit Introduction
- Unit Tutorial
- Unit FAQ
- Unit Reference
- Calltrace Introduction
- Calltrace Tutorial
- Calltrace FAQ
- Calltrace Plugin
- Calltrace Reference
- Serial Introduction
- Serial Tutorial
- Serial Invocation
- Serial Reference