Commit b69e0acb authored by Marco Bartolini's avatar Marco Bartolini
Browse files

fixed little bug in SimpleParser library tests

parent 888e3c9e
Loading
Loading
Loading
Loading
+16 −5
Original line number Diff line number Diff line
@@ -12,12 +12,20 @@ using namespace SimpleParser;
class TestObject
{
    public:
        TestObject(){};
        void empty_command(){return;};
        TestObject() : test_value(0){};
        void empty_command();
        void unary_command(const char* parameter);
        IRA::CString result;
        int test_value;
};

void 
TestObject::empty_command()
{
    test_value++;
    return;
}

void
TestObject::unary_command(const char* parameter)
{
@@ -70,20 +78,23 @@ TEST_F(TestProcedureParsing, run_command_without_argument)
{
    IRA::CString procedure = "empty_command";
    IRA::CString output;
    int test_value = to.test_value;
    m_parser->run(procedure, output);
    //This is a google test macro
    RecordProperty("run_output", (const char*) output);
    SUCCEED();
    ASSERT_EQ(test_value + 1, to.test_value);
}

TEST_F(TestProcedureParsing, run_procedure_without_argument)
{
    IRA::CString procedure = "empty_procedure";
    IRA::CString output;
    int test_value = to.test_value;
    m_parser->run(procedure, output);
    //This is a google test macro
    RecordProperty("run_output", (const char*) output);
    SUCCEED();
    sleep(2);
    ASSERT_EQ(test_value + 1, to.test_value);
}

TEST_F(TestProcedureParsing, run_command_with_argument)
@@ -103,7 +114,7 @@ TEST_F(TestProcedureParsing, run_procedure_with_argument)
    m_parser->run(procedure, output);
    //This is a google test macro
    RecordProperty("run_output", (const char*) output);
    sleep(5);
    sleep(2);
    ASSERT_EQ(IRA::CString("ciao"), to.result);
}
+7 −7
Original line number Diff line number Diff line
<?xml version="1.0" encoding="UTF-8"?>
<testsuites tests="5" failures="0" disabled="0" errors="0" timestamp="2015-04-15T15:50:01" time="10.56" name="AllTests">
  <testsuite name="TestProcedureParsing" tests="5" failures="0" disabled="0" errors="0" time="10.554">
    <testcase name="test_setup" status="run" time="1.11" classname="TestProcedureParsing" />
    <testcase name="run_command_without_argument" status="run" time="1.114" classname="TestProcedureParsing" run_output="empty_command\" />
    <testcase name="run_procedure_without_argument" status="run" time="1.109" classname="TestProcedureParsing" run_output="empty_procedure\" />
    <testcase name="run_command_with_argument" status="run" time="1.11" classname="TestProcedureParsing" run_output="unary_command\" />
    <testcase name="run_procedure_with_argument" status="run" time="6.108" classname="TestProcedureParsing" run_output="unary_procedure\" />
<testsuites tests="5" failures="0" disabled="0" errors="0" timestamp="2015-04-15T16:10:46" time="9.55" name="AllTests">
  <testsuite name="TestProcedureParsing" tests="5" failures="0" disabled="0" errors="0" time="9.548">
    <testcase name="test_setup" status="run" time="1.111" classname="TestProcedureParsing" />
    <testcase name="run_command_without_argument" status="run" time="1.108" classname="TestProcedureParsing" run_output="empty_command\" />
    <testcase name="run_procedure_without_argument" status="run" time="3.114" classname="TestProcedureParsing" run_output="empty_procedure\" />
    <testcase name="run_command_with_argument" status="run" time="1.105" classname="TestProcedureParsing" run_output="unary_command\" />
    <testcase name="run_procedure_with_argument" status="run" time="3.105" classname="TestProcedureParsing" run_output="unary_procedure\" />
  </testsuite>
</testsuites>