C:/nobackup/private/physical_svn/trunk/test/conversions/dynamic_conversion_test.cpp File Reference

#include <boost/test/auto_unit_test.hpp>
#include "physical/dynamicphysical.hpp"
#include "physical/unit.hpp"

Include dependency graph for dynamic_conversion_test.cpp:

Go to the source code of this file.

Functions

 BOOST_AUTO_UNIT_TEST (conversion_exception_test)


Function Documentation

BOOST_AUTO_UNIT_TEST ( conversion_exception_test   ) 

Definition at line 23 of file dynamic_conversion_test.cpp.

References physical::unit_si_float::meter.

00023                                                   {
00024 
00025         try {
00026       physical::DynamicPhysical<SI> length = 200*unit::meter;
00027 
00028       // this is an invalid conversion and should throw an exception:
00029       quantity::temperature temp = length;
00030 
00031       // if we arrive, here, it is an error..
00032       BOOST_ERROR("Incompatible conversion from length to temperature succeeded!");
00033 
00034    } catch(const physical::IncompatibleUnitException& ){
00035       // ok, no error
00036 
00037    } catch(...) {
00038       BOOST_ERROR("Errorneous exception.");
00039    }
00040 
00041 }


Generated on Mon Apr 2 22:25:06 2007 for physical_svn by  doxygen 1.5.1-p1
hosted on SourceForge.net Logo