icub-test
Loading...
Searching...
No Matches
Public Member Functions
ExampleTest Class Reference

This is just an example test, use it as a reference to implement new tests. More...

#include <ExampleTest.h>

Inherits yarp::robottestingframework::TestCase.

Public Member Functions

virtual bool setup (yarp::os::Property &property)
 
virtual void tearDown ()
 
virtual void run ()
 

Detailed Description

This is just an example test, use it as a reference to implement new tests.

Check the following functions:

Accepts the following parameters:

Parameter name Type Units Default Value Required Description Notes
name string - "ExampleTest" No The name of the test. -
example string - default value No An example value. -

Definition at line 41 of file ExampleTest.h.

Constructor & Destructor Documentation

◆ ExampleTest()

ExampleTest::ExampleTest ( )

Definition at line 32 of file ExampleTest.cpp.

32 : yarp::robottestingframework::TestCase("ExampleTest") {
33}

◆ ~ExampleTest()

ExampleTest::~ExampleTest ( )
virtual

Definition at line 35 of file ExampleTest.cpp.

35{ }

Member Function Documentation

◆ run()

void ExampleTest::run ( )
virtual

Definition at line 55 of file ExampleTest.cpp.

55 {
56
57 int a = 5; int b = 3;
58 ROBOTTESTINGFRAMEWORK_TEST_CHECK(a<b, "a smaller then b");
59 ROBOTTESTINGFRAMEWORK_TEST_CHECK(a>b, "a bigger then b");
60 ROBOTTESTINGFRAMEWORK_TEST_CHECK(a==b, "a equal to b");
61
62 // add more
63 // ...
64}

◆ setup()

bool ExampleTest::setup ( yarp::os::Property &  property)
virtual

Definition at line 37 of file ExampleTest.cpp.

37 {
38
39 // initialization goes here ...
40 //updating the test name
41 if(property.check("name"))
42 setName(property.find("name").asString());
43
44 string example = property.check("example", Value("default value")).asString();
45
46 ROBOTTESTINGFRAMEWORK_TEST_REPORT(Asserter::format("Use '%s' for the example param!",
47 example.c_str()));
48 return true;
49}

◆ tearDown()

void ExampleTest::tearDown ( )
virtual

Definition at line 51 of file ExampleTest.cpp.

51 {
52 // finalization goes her ...
53}

The documentation for this class was generated from the following files: