MOAB: Mesh Oriented datABase
(version 5.4.1)
|
00001 /* ***************************************************************** 00002 MESQUITE -- The Mesh Quality Improvement Toolkit 00003 00004 Copyright 2004 Sandia Corporation and Argonne National 00005 Laboratory. Under the terms of Contract DE-AC04-94AL85000 00006 with Sandia Corporation, the U.S. Government retains certain 00007 rights in this software. 00008 00009 This library is free software; you can redistribute it and/or 00010 modify it under the terms of the GNU Lesser General Public 00011 License as published by the Free Software Foundation; either 00012 version 2.1 of the License, or (at your option) any later version. 00013 00014 This library is distributed in the hope that it will be useful, 00015 but WITHOUT ANY WARRANTY; without even the implied warranty of 00016 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 00017 Lesser General Public License for more details. 00018 00019 You should have received a copy of the GNU Lesser General Public License 00020 (lgpl.txt) along with this library; if not, write to the Free Software 00021 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 00022 00023 [email protected], [email protected], [email protected], 00024 [email protected], [email protected], [email protected] 00025 00026 ***************************************************************** */ 00027 #ifndef __VECTOR3DTEST_H__ 00028 #define __VECTOR3DTEST_H__ 00029 00030 #include "Vector3D.hpp" 00031 #include "cppunit/extensions/HelperMacros.h" 00032 #include <iostream> 00033 00034 class Vector3DTest : public CppUnit::TestFixture 00035 { 00036 CPPUNIT_TEST_SUITE( Vector3DTest ); 00037 CPPUNIT_TEST( test_default_constructor ); 00038 CPPUNIT_TEST( test_double_constructor ); 00039 CPPUNIT_TEST( test_copy_constructor ); 00040 // CPPUNIT_TEST_EXCEPTION (throw_exception, CppUnit::SignalException); 00041 CPPUNIT_TEST_SUITE_END(); 00042 00043 public: 00044 Vector3DTest() {} 00045 00046 void test_default_constructor() 00047 { 00048 MBMesquite::Vector3D v; 00049 CPPUNIT_ASSERT( v.x() == 0 ); 00050 CPPUNIT_ASSERT( v.y() == 0 ); 00051 CPPUNIT_ASSERT( v.z() == 0 ); 00052 } 00053 void test_double_constructor() 00054 { 00055 MBMesquite::Vector3D v( 3, 2, 1 ); 00056 CPPUNIT_ASSERT( v.x() == 3 ); 00057 CPPUNIT_ASSERT( v.y() == 2 ); 00058 CPPUNIT_ASSERT( v.z() == 1 ); 00059 } 00060 void test_copy_constructor() 00061 { 00062 MBMesquite::Vector3D v2( 3, 2, 1 ); 00063 MBMesquite::Vector3D v( v2 ); 00064 00065 CPPUNIT_ASSERT( v.x() == 3 ); 00066 CPPUNIT_ASSERT( v.y() == 2 ); 00067 CPPUNIT_ASSERT( v.z() == 1 ); 00068 } 00069 void throw_exception() 00070 { 00071 MBMesquite::Vector3D* v = NULL; 00072 double d = v->x(); 00073 std::cout << d << std::endl; 00074 } 00075 }; 00076 00077 class Vector3DTest2 : public CppUnit::TestFixture 00078 { 00079 CPPUNIT_TEST_SUITE( Vector3DTest ); 00080 CPPUNIT_TEST_SUITE_END(); 00081 00082 public: 00083 Vector3DTest2() {} 00084 }; 00085 00086 CPPUNIT_TEST_SUITE_NAMED_REGISTRATION( Vector3DTest, "Unit" ); 00087 CPPUNIT_TEST_SUITE_NAMED_REGISTRATION( Vector3DTest, "Misc" ); 00088 CPPUNIT_TEST_SUITE_NAMED_REGISTRATION( Vector3DTest, "Vector3DTest" ); 00089 00090 #endif