summaryrefslogtreecommitdiffstats
path: root/src/usr/example/test/exampletest.H
blob: f6cad986385234c805a9eb0b0ccdf43d2038b35e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
#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 <cxxtest/TestSuite.H>
#include <example/example.H>


class ExampleTest: public CxxTest::TestSuite
{
public:


    /**
     * @test TS_WARN will run if the example1_function FAILS
     *      */
    void testExampleWarn(void)
    {
        uint64_t    l_rc = 0;
        l_rc = example1_function();
        if(l_rc)
        {
                TS_WARN("Warning, Call to example1_function1 returned bad value.\n");
        }
    }


    /**
          * @test TS_TRACE will run if the example1_function FAILS
          *      */
    void testExampleTrace(void)
    {
        uint64_t    l_rc = 0;
        l_rc = example1_function();
        if(l_rc)
        {
                TS_TRACE("Tracing something in example1_function1\n");
        }
    }

    /**
          * @test TS_FAIL will run if the example1_function FAILS
     */
    void testExampleFail(void)
    {
        uint64_t    l_rc = 0;
        l_rc = example1_function();
        if(l_rc)
        {
                TS_FAIL("Call to example1_function1 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_WARN
     */
    void testExampleForceTrace(void)
    {

        TS_TRACE("Run TS_TRACE() as part of the example test\n" );
    }



};

#endif

OpenPOWER on IntegriCloud