src/test/snmp/prototest.cpp
void ProtocolTest::test()
{
    test::printOut("\nSNMP protocol test ... ");

    CPPUNIT_ASSERT(!base::Utils::fileExist(SOCKTEST_NAME));

    test::ThreadPtr thread(new ProtocolTestThread());
    m_scheduler.addTestThread(thread);
    m_scheduler.start();

    // be sure that it has been started
    sleep(3);

    CPPUNIT_ASSERT(base::Utils::fileExist(SOCKTEST_NAME));

    // different tests
    testScalar();
    testTable();
    testScalar();
    testTable();
    testTable();

    sleep(2);
    m_scheduler.stop();
    m_scheduler.checkResult();
}
// Do the test of Protocol traps
Do the test of Protocol traps
Do the test of Protocol traps
void ProtocolTest::test()
{
    test::printOut("\nSNMP protocol test ... ");
    CPPUNIT_ASSERT(!base::Utils::fileExist(SOCKTEST_NAME));
    test::ThreadPtr thread(new ProtocolTestThread());
    m_scheduler.addTestThread(thread);
    m_scheduler.start();
    sleep(3);
    CPPUNIT_ASSERT(base::Utils::fileExist(SOCKTEST_NAME));
    testScalar();
    testTable();
    testScalar();
    testTable();
    testTable();
    sleep(2);
    m_scheduler.stop();
    m_scheduler.checkResult();
}
void ProtocolTest :: test ( ) { test :: printOut ( " \n " ) ; CPPUNIT_ASSERT ( ! base :: Utils :: fileExist ( SOCKTEST_NAME ) ) ; test :: ThreadPtr thread ( new ProtocolTestThread ( ) ) ; m_scheduler . addTestThread ( thread ) ; m_scheduler . start ( ) ; sleep ( 3 ) ; CPPUNIT_ASSERT ( base :: Utils :: fileExist ( SOCKTEST_NAME ) ) ; testScalar ( ) ; testTable ( ) ; testScalar ( ) ; testTable ( ) ; testTable ( ) ; sleep ( 2 ) ; m_scheduler . stop ( ) ; m_scheduler . checkResult ( ) ; }
Do the test of Protocol traps
Do the test of Protocol traps
// be sure that it has been started // different tests