Main Page | Class Hierarchy | Alphabetical List | Class List | File List | Class Members | Related Pages

CoinErrorTest.cpp

00001 // Copyright (C) 2000, International Business Machines
00002 // Corporation and others.  All Rights Reserved.
00003 
00004 #include <cassert>
00005 #include "CoinError.hpp"
00006 
00007 #ifdef NDEBUG
00008 #undef NDEBUG
00009 #endif
00010 
00011 void
00012 CoinErrorUnitTest()
00013 {
00014 
00015   // Test default constructor
00016   {
00017     CoinError r;
00018     assert( r.message_=="" );
00019     assert( r.method_=="" );
00020     assert( r.class_=="" );
00021   }
00022 
00023   // Test alternate constructor and get method
00024   CoinError rhs;
00025   {
00026     CoinError a("msg","me.hpp","cl");
00027     assert( a.message()=="msg" );
00028     assert( a.methodName()=="me.hpp" );
00029     assert( a.className()=="cl" );
00030     
00031     // Test copy constructor
00032     {
00033       CoinError c(a);
00034       assert( c.message()=="msg" );
00035       assert( c.methodName()=="me.hpp" );
00036       assert( c.className()=="cl" );
00037     }
00038     
00039     // Test assignment
00040     {
00041       CoinError a1("msg1","meth1","cl1");
00042       assert( a1.message()=="msg1" );
00043       assert( a1.methodName()=="meth1" );
00044       assert( a1.className()=="cl1" );
00045       rhs = a1;
00046     }
00047   }
00048   assert( rhs.message()=="msg1" );
00049   assert( rhs.methodName()=="meth1" );
00050   assert( rhs.className()=="cl1" );
00051 
00052 
00053 }

Generated on Wed Dec 3 14:34:16 2003 for Coin by doxygen 1.3.5