outputctl.h File Reference

#include "smbios/compat.h"
#include <exception>
#include <typeinfo>

Go to the source code of this file.

Classes

class  skip_test

Defines

#define WHEREAMI   "%s (line %d)... ", typeid(*this).name(), __LINE__
#define startTest(arg1, arg2)   do{ printf(arg1, arg2); printf(WHEREAMI) ;}while(0)
#define passTest()   do {printf( "[ ok ]\n" ); } while(0)
#define failTest()   do {printf( "[FAIL]\n" ); } while(0)
#define skipTest()   do {printf( "[SKIP]\n" ); } while(0)
#define STD_TEST_START(arg1, arg2)   startTest(arg1, arg2); bool skip=false; cout << flush; try {
#define STD_TEST_END()
#define ASSERT_THROWS(expr, exc)


Define Documentation

#define ASSERT_THROWS ( expr,
exc   ) 

Value:

do {                        \
    bool caught = false;        \
    try                         \
    {                           \
        expr;                   \
    }                           \
    catch( const exc & )        \
    {                           \
            caught = true;      \
    }                           \
    catch( const std::exception &e ) \
    {                           \
        ostringstream ost;      \
        ost << "Executed: " #expr "\nCaught wrong exception. Expected: " #exc;    \
        ost << "\nLine: " << __LINE__;   \
        ost << "\nFile: " << __FILE__;   \
        ost << "\nException Caught: " << typeid(e).name();        \
        CPPUNIT_FAIL (ost.str().c_str());   \
    }                           \
    catch( ... )                \
    {                           \
        ostringstream ost;      \
        ost << "Executed: " #expr "\nCaught wrong exception. Expected: " #exc;    \
        ost << "\nLine: " << __LINE__;   \
        ost << "\nFile: " << __FILE__;   \
        CPPUNIT_FAIL (ost.str().c_str());   \
    }                           \
    if ( ! caught )             \
        CPPUNIT_FAIL ("Executed: " #expr "\nShould have thrown an exception, but did not. Expected: " #exc);\
    } while(0)

Definition at line 74 of file outputctl.h.

Referenced by testSmbiosXml::testCmosWriting(), testSmbiosXml::testConstructionOffset(), testSmbiosXml::testGetBoundaries(), testSmbiosXml::testOutOfBounds(), and testSmbiosXml::testTypeMismatch().

 
#define failTest (  )     do {printf( "[FAIL]\n" ); } while(0)

Definition at line 43 of file outputctl.h.

 
#define passTest (  )     do {printf( "[ ok ]\n" ); } while(0)

Definition at line 42 of file outputctl.h.

 
#define skipTest (  )     do {printf( "[SKIP]\n" ); } while(0)

Definition at line 44 of file outputctl.h.

#define startTest ( arg1,
arg2   )     do{ printf(arg1, arg2); printf(WHEREAMI) ;}while(0)

Definition at line 41 of file outputctl.h.

 
#define STD_TEST_END (  ) 

Value:

} catch (const skip_test &) {               \
                skip = true;                        \
        } catch ( const smbios::IException &e ) {   \
                failTest();                         \
                CPPUNIT_FAIL( e.what() );           \
        } catch ( const std::exception &e ) {   \
                failTest();                         \
                CPPUNIT_FAIL( e.what() );           \
        } catch (...) {         \
                failTest();     \
                throw;          \
        }                       \
        if( skip )              \
            skipTest();         \
        else                    \
            passTest();

Definition at line 55 of file outputctl.h.

Referenced by testSmbiosXml::testAssetTag(), testSmbiosXml::testBiosVersion(), testSmbiosXml::testCmosChecksum(), testSmbiosXml::testCmosConstructor(), testSmbiosXml::testCmosWriting(), testSmbiosXml::testConstIterator(), testSmbiosXml::testConstructionOffset(), testSmbiosXml::testEachItemAccessors(), testSmbiosXml::testEntryCount(), testSmbiosXml::testException(), testSmbiosXml::testGetBoundaries(), testSmbiosXml::testIdByte(), testSmbiosXml::testIsDell(), testSmbiosXml::testItem_GetBiosInfo(), testSmbiosXml::testItem_GetSystemInfo(), testSmbiosXml::testItemIdentity(), testSmbiosXml::testLibraryVersion(), testSmbiosXml::testOutOfBounds(), testSmbiosXml::testServiceTag(), testSmbiosXml::testServiceTagWriting(), testSmbiosXml::testSmi_callingInterface(), testSmbiosXml::testSmi_callingInterface_physaddr(), testSmbiosXml::testStateBytes(), testSmbiosXml::testStreamify(), testSmbiosXml::testSubscriptOperator1(), testSmbiosXml::testSubscriptOperator2(), testSmbiosXml::testSubscriptOperator3(), testSmbiosXml::testSystemInfo(), testSmbiosXml::testSystemName(), testSmbiosXml::testTable_Subscript(), testSmbiosXml::testTypeMismatch(), testSmbiosXml::testUpBoot(), and testSmbiosXml::testVariousAccessors().

#define STD_TEST_START ( arg1,
arg2   )     startTest(arg1, arg2); bool skip=false; cout << flush; try {

Definition at line 52 of file outputctl.h.

Referenced by testSmbiosXml::testAssetTag(), testSmbiosXml::testBiosVersion(), testSmbiosXml::testCmosChecksum(), testSmbiosXml::testCmosConstructor(), testSmbiosXml::testCmosWriting(), testSmbiosXml::testConstIterator(), testSmbiosXml::testConstructionOffset(), testSmbiosXml::testEachItemAccessors(), testSmbiosXml::testEntryCount(), testSmbiosXml::testException(), testSmbiosXml::testGetBoundaries(), testSmbiosXml::testIdByte(), testSmbiosXml::testIsDell(), testSmbiosXml::testItem_GetBiosInfo(), testSmbiosXml::testItem_GetSystemInfo(), testSmbiosXml::testItemIdentity(), testSmbiosXml::testLibraryVersion(), testSmbiosXml::testOutOfBounds(), testSmbiosXml::testServiceTag(), testSmbiosXml::testServiceTagWriting(), testSmbiosXml::testSmi_callingInterface(), testSmbiosXml::testSmi_callingInterface_physaddr(), testSmbiosXml::testStateBytes(), testSmbiosXml::testStreamify(), testSmbiosXml::testSubscriptOperator1(), testSmbiosXml::testSubscriptOperator2(), testSmbiosXml::testSubscriptOperator3(), testSmbiosXml::testSystemInfo(), testSmbiosXml::testSystemName(), testSmbiosXml::testTable_Subscript(), testSmbiosXml::testTypeMismatch(), testSmbiosXml::testUpBoot(), and testSmbiosXml::testVariousAccessors().

#define WHEREAMI   "%s (line %d)... ", typeid(*this).name(), __LINE__

Definition at line 38 of file outputctl.h.


Generated on Tue Jul 11 20:46:47 2006 for SMBIOS Library by  doxygen 1.4.7