00001
00002
00003
00004
00005
00006
00007
00008 namespace impulse {
00009
00010 class MessageTest : public UnitTest {
00011
00012 public:
00013
00014 void runTests()
00015 {
00016 cout << "Testing Message..." << endl;
00017 cout << "------------------------------------------------------------" << endl;
00018 trace << endl << "message.eval()" << endl;
00019 trace << "--------------------" << endl;
00020
00021 Array args;
00022 Value v = 10.0;
00023
00024 double ep = numeric_limits<double>::epsilon();
00025
00026 Message message( Symbol::at("sin") );
00027
00028 ASSERT( message.eval( args, 10.0 ).getFloat() > ::sin( 10.0 ) - ep );
00029 ASSERT( message.eval( args, 10.0 ).getFloat() < ::sin( 10.0 ) + ep );
00030
00031 Message message2( Symbol::at("pow"), 2.0 );
00032
00033 ASSERT( message2.eval( args, 10.0 ).getFloat() == ::pow( 10.0, 2.0 ) );
00034
00035 cout << "------------------------------------------------------------" << endl;
00036 cout << endl;
00037 }
00038
00039 };
00040
00041 }