Contains the unit_test class an global unit defines. More...
#include "matador/unit/unit_exception.hpp"
#include <functional>
#include <map>
#include <vector>
#include <string>
#include <sstream>
#include <type_traits>
#include <iostream>
#include <cstring>
Classes | |
class | matador::unit_test |
A unit_test consists of serveral tests. More... | |
Namespaces | |
namespace | matador |
The Open Object Store namespace. | |
Macros | |
#define | UNIT_ASSERT_EQUAL(a, b) assert_equal(a, b, __LINE__, __FILE__) |
Checks if a is equal b. | |
#define | UNIT_ASSERT_NOT_EQUAL(a, b) assert_not_equal(a, b, __LINE__, __FILE__) |
Checks if a is not msgstrequal b. | |
#define | UNIT_ASSERT_GREATER(a, b) assert_greater(a, b, __LINE__, __FILE__) |
Checks if a is greater b. | |
#define | UNIT_ASSERT_LESS(a, b) assert_less(a, b, __LINE__, __FILE__) |
Checks if a is greater b. | |
#define | UNIT_ASSERT_FALSE(a) assert_false(a, __LINE__, __FILE__) |
Checks if a evaluates to false. | |
#define | UNIT_ASSERT_TRUE(a) assert_true(a, __LINE__, __FILE__) |
Checks if a evaluates to true. | |
#define | UNIT_ASSERT_NULL(o) assert_null(o, __LINE__, __FILE__) |
Checks if o is NULL. | |
#define | UNIT_ASSERT_NOT_NULL(o) assert_not_null(o, __LINE__, __FILE__) |
Checks if o is not NULL. | |
#define | UNIT_ASSERT_EXCEPTION(expression, exception_type, exception_msg) |
Checks if a is equal b. | |
#define | UNIT_EXPECT_EQUAL(a, b) expect_equal(a, b, __LINE__, __FILE__) |
Checks if a is equal b. | |
#define | UNIT_EXPECT_GREATER(a, b) expect_greater(a, b, __LINE__, __FILE__) |
Checks if a is greater b. | |
#define | UNIT_EXPECT_FALSE(a) expect_false(a, __LINE__, __FILE__) |
Checks if a evaluates to false. | |
#define | UNIT_EXPECT_TRUE(a) expect_true(a, __LINE__, __FILE__) |
Checks if a evaluates to true. | |
#define | UNIT_FAIL(msg) |
Throws an error. | |
#define | UNIT_WARN(msg) |
Displays a warning. | |
#define | UNIT_INFO(msg) info(msg) |
Displays an informatkon. | |
Contains the unit_test class an global unit defines.
This file contains the declaration of the unit_test class and the global unit assert defines.
#define UNIT_ASSERT_EQUAL | ( | a, | |
b | |||
) | assert_equal(a, b, __LINE__, __FILE__) |
Checks if a is equal b.
If a is not equal b the test method throws a unit_exception with the given message. The exception is caught by the test_suite the message is displayed
#define UNIT_ASSERT_EXCEPTION | ( | expression, | |
exception_type, | |||
exception_msg | |||
) |
Checks if a is equal b.
If a is not equal b the test method throws a unit_exception with the given message. The exception is caught by the test_suite the message is displayed
#define UNIT_ASSERT_FALSE | ( | a | ) | assert_false(a, __LINE__, __FILE__) |
Checks if a evaluates to false.
If a doesn't evaluates to false the test method throws a unit_exception with the given message. The exception is caught by the test_suite the message is displayed
#define UNIT_ASSERT_GREATER | ( | a, | |
b | |||
) | assert_greater(a, b, __LINE__, __FILE__) |
Checks if a is greater b.
If a is not greater b the test method throws a unit_exception with the given message. The exception is caught by the test_suite the message is displayed
#define UNIT_ASSERT_LESS | ( | a, | |
b | |||
) | assert_less(a, b, __LINE__, __FILE__) |
Checks if a is greater b.
If a is not greater b the test method throws a unit_exception with the given message. The exception is caught by the test_suite the message is displayed
#define UNIT_ASSERT_NOT_EQUAL | ( | a, | |
b | |||
) | assert_not_equal(a, b, __LINE__, __FILE__) |
Checks if a is not msgstrequal b.
If a is equal b the test method throws a unit_exception with the given message. The exception is caught by the test_suite the message is displayed
#define UNIT_ASSERT_NOT_NULL | ( | o | ) | assert_not_null(o, __LINE__, __FILE__) |
Checks if o is not NULL.
If o is NULL the test method throws a unit_exception with the given message. The exception is caught by the test_suite the message is displayed
#define UNIT_ASSERT_NULL | ( | o | ) | assert_null(o, __LINE__, __FILE__) |
Checks if o is NULL.
If o isn't NULL the test method throws a unit_exception with the given message. The exception is caught by the test_suite the message is displayed
#define UNIT_ASSERT_TRUE | ( | a | ) | assert_true(a, __LINE__, __FILE__) |
Checks if a evaluates to true.
If a doesn't evaluates to true the test method throws a unit_exception with the given message. The exception is caught by the test_suite the message is displayed
#define UNIT_EXPECT_EQUAL | ( | a, | |
b | |||
) | expect_equal(a, b, __LINE__, __FILE__) |
Checks if a is equal b.
If a is not equal b the test prints the given message to stdout.
#define UNIT_EXPECT_FALSE | ( | a | ) | expect_false(a, __LINE__, __FILE__) |
Checks if a evaluates to false.
If a doesn't evaluates to false the test method prints the given message to stdout.
#define UNIT_EXPECT_GREATER | ( | a, | |
b | |||
) | expect_greater(a, b, __LINE__, __FILE__) |
Checks if a is greater b.
If a is not greater b the test prints the given message to stdout.
#define UNIT_EXPECT_TRUE | ( | a | ) | expect_true(a, __LINE__, __FILE__) |
Checks if a evaluates to true.
If a doesn't evaluates to true the test method prints the given message to stdout.
#define UNIT_FAIL | ( | msg | ) |
Throws an error.
The test method throws an exception with the given error message and the current file and line number information.
#define UNIT_INFO | ( | msg | ) | info(msg) |
Displays an informatkon.
The test method displays an information with the given message.
#define UNIT_WARN | ( | msg | ) |
Displays a warning.
The test method displays a warning with the given message and the current file and line number information.