[cig-commits] r13490 - cs/cigma/trunk/tests/libcigma

luis at geodynamics.org luis at geodynamics.org
Tue Dec 9 18:12:27 PST 2008


Author: luis
Date: 2008-12-09 18:12:27 -0800 (Tue, 09 Dec 2008)
New Revision: 13490

Modified:
   cs/cigma/trunk/tests/libcigma/DataPathTest.cpp
   cs/cigma/trunk/tests/libcigma/DataPathTest.h
Log:
Test DataPath copy constructors

Modified: cs/cigma/trunk/tests/libcigma/DataPathTest.cpp
===================================================================
--- cs/cigma/trunk/tests/libcigma/DataPathTest.cpp	2008-12-10 02:12:25 UTC (rev 13489)
+++ cs/cigma/trunk/tests/libcigma/DataPathTest.cpp	2008-12-10 02:12:27 UTC (rev 13490)
@@ -5,8 +5,6 @@
 #include "Exception.h"
 using namespace cigma;
 
-DataPathTest::DataPathTest() {}
-DataPathTest::~DataPathTest() {}
 
 void DataPathTest::test_data()
 {
@@ -37,3 +35,11 @@
     CPPUNIT_ASSERT_THROW(DataPath(":foo:bar"), cigma::Exception);
 }
 
+void DataPathTest::test_copy_constructor()
+{
+    DataPath a("foo");
+    DataPath b(a);
+    DataPath c = a;
+    CPPUNIT_ASSERT_EQUAL(a.filename(), b.filename());
+    CPPUNIT_ASSERT_EQUAL(a.filename(), c.filename());
+}

Modified: cs/cigma/trunk/tests/libcigma/DataPathTest.h
===================================================================
--- cs/cigma/trunk/tests/libcigma/DataPathTest.h	2008-12-10 02:12:25 UTC (rev 13489)
+++ cs/cigma/trunk/tests/libcigma/DataPathTest.h	2008-12-10 02:12:27 UTC (rev 13490)
@@ -12,16 +12,18 @@
         CPPUNIT_TEST(test_data);
         CPPUNIT_TEST(test_edge_cases);
         CPPUNIT_TEST(test_constructor_exceptions);
+        CPPUNIT_TEST(test_copy_constructor);
         CPPUNIT_TEST_SUITE_END();
 
     public:
 
-        DataPathTest();
-        virtual ~DataPathTest();
+        DataPathTest() {}
+        virtual ~DataPathTest() {}
 
         void test_data();
         void test_edge_cases();
         void test_constructor_exceptions();
+        void test_copy_constructor();
 
     };
 }



More information about the CIG-COMMITS mailing list