// StatusValue_t.cpp #include "StatusValue.h" #include #include #include using std::string; using std::cout; using std::cerr; using std::endl; //********************************************************************** int main( ) { string component = "StatusValue"; string ok_prefix = component + " (I): "; string error_prefix = component + " test (E): "; cout << ok_prefix << "---------- Testing component " + component + ". ----------" << endl; // Make sure assert is enabled. bool assert_flag = false; assert ( ( assert_flag = true, assert_flag ) ); if ( ! assert_flag ) { cerr << "Assert is disabled" << endl; return 1; } //******************************************************************** cout << ok_prefix << "Test double." << endl; StatusDouble sd(3,1.234); cout << sd << endl; assert( sd.status() == 3 ); assert( sd.value() == 1.234 ); //******************************************************************** cout << ok_prefix << "------------- All tests passed. -------------" << endl; return 0; //******************************************************************** }