[Avida-cvs] [avida-svn] r655 - in development/source: testsuites tools

kaben@myxo.css.msu.edu kaben at myxo.css.msu.edu
Mon May 8 13:32:21 PDT 2006


Author: kaben
Date: 2006-05-08 16:32:21 -0400 (Mon, 08 May 2006)
New Revision: 655

Modified:
   development/source/testsuites/full-unit-tests.cc
   development/source/tools/cDataEntry.cc
   development/source/tools/cDataEntry.h
   development/source/tools/cInitFile.cc
Log:

Moved cDataEntry's UnitTests function to namespace nDataEntry.



Modified: development/source/testsuites/full-unit-tests.cc
===================================================================
--- development/source/testsuites/full-unit-tests.cc	2006-05-08 20:22:11 UTC (rev 654)
+++ development/source/testsuites/full-unit-tests.cc	2006-05-08 20:32:21 UTC (rev 655)
@@ -9,7 +9,7 @@
 
 int main() {
 
-  cDataEntry::UnitTests(true);
+  nDataEntry::UnitTests(true);
   cFile::UnitTests(true);
   nInitFile::UnitTests(true);
   cRandom::UnitTests(true);

Modified: development/source/tools/cDataEntry.cc
===================================================================
--- development/source/tools/cDataEntry.cc	2006-05-08 20:22:11 UTC (rev 654)
+++ development/source/tools/cDataEntry.cc	2006-05-08 20:32:21 UTC (rev 655)
@@ -24,7 +24,7 @@
 #include <fstream>
 #include <string>
 
-namespace nDataEntryTests {
+namespace nDataEntry {
   /*
   Test-helpers.
   */
@@ -83,18 +83,21 @@
       std::remove(filename.c_str());
     } 
   } // utDataEntry_archiving
-} // nDataEntryTests
 
-void cDataEntry::UnitTests(bool full)
-{
-  //if(full) {
-  //  std::cout << "nDataEntryTests::utDataEntry_hello_world" << std::endl;
-  //  nDataEntryTests::utDataEntry_hello_world::test();
-  //}
-  if(full) {
-    std::cout << "nDataEntryTests::utDataEntry_archiving" << std::endl;
-    nDataEntryTests::utDataEntry_archiving::test();
+
+
+  void UnitTests(bool full)
+  {
+    std::cout << "nDataEntry::UnitTests" << std::endl;
+    //if(full) {
+    //  std::cout << "utDataEntry_hello_world" << std::endl;
+    //  utDataEntry_hello_world::test();
+    //}
+    if(full) {
+      std::cout << "utDataEntry_archiving" << std::endl;
+      utDataEntry_archiving::test();
+    }
   }
-}
+} // nDataEntry
 
 #endif // ENABLE_UNIT_TESTS

Modified: development/source/tools/cDataEntry.h
===================================================================
--- development/source/tools/cDataEntry.h	2006-05-08 20:22:11 UTC (rev 654)
+++ development/source/tools/cDataEntry.h	2006-05-08 20:32:21 UTC (rev 655)
@@ -56,22 +56,24 @@
     a.ArkvObj("html_table_flags", html_table_flags);
   }   
 
+};
+
+inline std::ostream& operator << (std::ostream& out, cDataEntry & entry)
+{
+  entry.Print(out);
+  return out;
+}
+
   
 #ifdef ENABLE_UNIT_TESTS
-public:
+namespace nDataEntry {
   /**
    * Run unit tests
    *
    * @param full Run full test suite; if false, just the fast tests.
    **/
-  static void UnitTests(bool full = false);
+  void UnitTests(bool full = false);
+}
 #endif  
-};
 
-inline std::ostream& operator << (std::ostream& out, cDataEntry & entry)
-{
-  entry.Print(out);
-  return out;
-}
-
 #endif

Modified: development/source/tools/cInitFile.cc
===================================================================
--- development/source/tools/cInitFile.cc	2006-05-08 20:22:11 UTC (rev 654)
+++ development/source/tools/cInitFile.cc	2006-05-08 20:32:21 UTC (rev 655)
@@ -268,7 +268,7 @@
 #include <fstream> 
 #include <string>
 
-namespace nInitFileTests {
+namespace nInitFile {
   /*
   Test-helpers.
   */
@@ -424,35 +424,30 @@
       std::remove(data_file_name.c_str());
     }
   } // utInitFile_ReadString_after_open_and_close
-} // nInitFileTests
 
-namespace nInitFile {
-/*
 
-};
 
-  UnitTests()
 
-*/
   void UnitTests(bool full)
   {
+    std::cout << "nInitFile::UnitTests" << std::endl;
     //if(full) {
-    //  std::cout << "nInitFileTests::utInitFile_hello_world" << std::endl;
-    //  nInitFileTests::utInitFile_hello_world::test();
+    //  std::cout << "utInitFile_hello_world" << std::endl;
+    //  utInitFile_hello_world::test();
     //}
     if(full) {
-      std::cout << "nInitFileTests::utInitFile_archiving" << std::endl;
-      nInitFileTests::utInitFile_archiving::test();
+      std::cout << "utInitFile_archiving" << std::endl;
+      utInitFile_archiving::test();
     }
     if(full) {
-      std::cout << "nInitFileTests::utInitFile_archiving_closed_file" << std::endl;
-      nInitFileTests::utInitFile_archiving_closed_file::test();
+      std::cout << "utInitFile_archiving_closed_file" << std::endl;
+      utInitFile_archiving_closed_file::test();
     }
     if(1) {
-      std::cout << "nInitFileTests::utInitFile_ReadString_after_open_and_close" << std::endl;
-      nInitFileTests::utInitFile_ReadString_after_open_and_close::test();
+      std::cout << "utInitFile_ReadString_after_open_and_close" << std::endl;
+      utInitFile_ReadString_after_open_and_close::test();
     }
   }
-}
+} // nInitFile
 
 #endif // ENABLE_UNIT_TESTS




More information about the Avida-cvs mailing list