nlib
|
Framework to test C++ code. View the description of List of testing Library Features
.
More...
Classes | |
class | Environment |
Defines the SetUp and TearDown functions that inherit this class and are run globally. More... | |
Functions | |
void | InitNintendoTest (int *argc, char **argv) |
Processes command-line options for the test program. | |
void | InitNintendoTest (int *argc, wchar_t **argv) |
Processes command-line options for the test program. | |
Environment * | AddGlobalTestEnvironment (Environment *env) |
Passes the pointer to Environment and registers the code to run before and after all tests. | |
AssertionResult | FloatLE (const char *expr1, const char *expr2, float val1, float val2) |
Determines if val1 <= val2. [ASSERT|EXPECT] Used by including in PRED_FORMAT2 . More... | |
AssertionResult | DoubleLE (const char *expr1, const char *expr2, double val1, double val2) |
Determines if val1 <= val2. [ASSERT|EXPECT] Used by including in PRED_FORMAT2 . More... | |
Framework to test C++ code. View the description of List of testing Library Features
.
addTest
method, as with CppUnit
.) operator<<
. (For example: ASSERT_EQ(5, Foo(i)) << ” where i = ” << i;
.) testing
library maintains limited macro and function name compatibility with Google Test, and is built to compile test code that is written using Google Test. testing
library may be used in an environment that does not support std::ostream
, or in environments that do not support calling new
before the main
function. testing
library has implemented the following macros. RUN_ALL_TESTS()
TEST(), TEST_F()
TEST_P(), INSTANTIATE_TEST_CASE_P()
TYPED_TEST_CASE(), TYPED_TEST()
FRIEND_TEST()
FAIL(), SUCCEED()
ASSERT_TRUE(), ASSERT_FALSE(), EXPECT_TRUE(), EXPECT_FALSE()
ASSERT_EQ(), ASSERT_NE(), EXPECT_EQ(), EXPECT_NE()
ASSERT_LT(), ASSERT_LE(), EXPECT_LT(), EXPECT_LE()
ASSERT_GT(), ASSERT_GE(), EXPECT_GT(), EXPECT_GE()
ASSERT_STREQ(), ASSERT_STRNE(), EXPECT_STREQ(), EXPECT_STRNE()
ASSERT_STRCASEEQ(), ASSERT_STRCASENE(), EXPECT_STRCASEEQ(), EXPECT_STRCASENE()
ASSERT_FLOAT_EQ(), ASSERT_DOUBLE_EQ(), EXPECT_FLOAT_EQ(), EXPECT_DOUBLE_EQ()
ASSERT_NEAR(), EXPECT_NEAR()
SCOPED_TRACE()
ASSERT_NO_FATAL_FAILURE(), EXPECT_NO_FATAL_FAILURE()
ASSERT_PRED1(), ASSERT_PRED_FORMAT1(), EXPECT_PRED1(), EXPECT_PRED_FORMAT1()
ASSERT_PRED2(), ASSERT_PRED_FORMAT2(), EXPECT_PRED2(), EXPECT_PRED_FORMAT2()
ASSERT_PRED3(), ASSERT_PRED_FORMAT3(), EXPECT_PRED3(), EXPECT_PRED_FORMAT3()
ASSERT_PRED4(), ASSERT_PRED_FORMAT4(), EXPECT_PRED4(), EXPECT_PRED_FORMAT4()
ASSERT_PRED5(), ASSERT_PRED_FORMAT5(), EXPECT_PRED5(), EXPECT_PRED_FORMAT5()
ASSERT_*
macro fails, the process returns directly from that function, but continues tests within the function if EXPECT_*
macros fail. List of testing Library Features
for a description of macros.NLIB_USE_GTEST
macro is defined before including testing.h
, Google Test can be used by including the Google Test header. ASSERT_EQ
and EXPECT_EQ
functions, a comparison with NULL
causes a warning or a compiler error. This issue requires you to write comparisons as ASSERT_TRUE(NULL == val);
. std::ostream
. As a result, use the NLIB_TESTING_OSTREAM()
macro instead of std::ostream
to implement an operator<<
overload or PrintTo
function. operator<<
. std::endl
or functions such as manipulators cannot be used because std::ostream
is not real. ASSERT_DEATH
are not implemented. © 2012-2017 Nintendo Co., Ltd. All rights reserved.