// IBM_PROLOG_BEGIN_TAG // This is an automatically generated prolog. // // $Source: src/usr/example/test/exampletest.H $ // // IBM CONFIDENTIAL // // COPYRIGHT International Business Machines Corp. 2011 // // p1 // // Object Code Only (OCO) source materials // Licensed Internal Code Source Materials // IBM HostBoot Licensed Internal Code // // The source code for this program is not published or other- // wise divested of its trade secrets, irrespective of what has // been deposited with the U.S. Copyright Office. // // Origin: 30 // // IBM_PROLOG_END #ifndef __TEST_EXAMPLETEST_H #define __TEST_EXAMPLETEST_H /** * @file exampletest.H * * @brief Example for people to use when writing test cases for their module. * @todo add more doxygen blocks */ #include #include class ExampleTest: public CxxTest::TestSuite { public: /** * @test TS_WARN will run if the testExampleWarn_function FAILS */ void testExampleWarn(void) { uint64_t l_rc = 0; l_rc = example1_function(); if(l_rc) { TS_WARN("Warning, Call to testExampleWarn returned bad value.\n"); } } /** * @test TS_TRACE will run if the testExampleTrace function FAILS * */ void testExampleTrace(void) { uint64_t l_rc = 0; l_rc = example1_function(); if(l_rc) { TS_TRACE("Tracing a failure in testExampleTrace function1\n"); } } /** * @test TS_FAIL will run if the testExampleFail function FAILS */ void testExampleFail(void) { uint64_t l_rc = 0; l_rc = example1_function(); if(l_rc) { TS_FAIL("Call to testExampleFail failed!\n"); } } /** * @test this will always run TS_FAIL */ void testExampleForceFail(void) { TS_FAIL("Run TS_FAIL() as part of the example test.\n" ); } /** * @test this will always run TS_WARN */ void testExampleForceWarn(void) { TS_WARN("Run TS_WARN() as part of the example test\n" ); } /** * @test this will always run TS_TRACE */ void testExampleForceTrace(void) { uint32_t i_32test = 0xdeadbeef; i_32test--; i_32test++; uint64_t i_64test = 0xbadc0ffee0ddf00d; i_64test--; i_64test++; TS_TRACE("Run TS_TRACE() as part of the example test\n" ); TS_TRACE("Run TS_TRACE() with one print parameter: %d\n", 5 ); TS_TRACE("Run TS_TRACE() with 2 parameters: 0x%x 0x%x \n", i_32test, 0x78 ); TS_TRACE("Run TS_TRACE() with 3 parameters: %d, 0x%llx, %p", 328, i_64test, &i_64test ); } }; #endif