[Avida-cvs] [avida-svn] r666 - in development/source: cpu drivers

kaben@myxo.css.msu.edu kaben at myxo.css.msu.edu
Mon May 8 17:11:08 PDT 2006


Author: kaben
Date: 2006-05-08 20:11:07 -0400 (Mon, 08 May 2006)
New Revision: 666

Modified:
   development/source/cpu/cHardwareCPU_Thread.h
   development/source/cpu/cHardwareManager.h
   development/source/cpu/cHardwareSMT.h
   development/source/cpu/cHardwareStatusPrinter.h
   development/source/cpu/cHardwareTracer.h
   development/source/cpu/cHardwareTracer_4Stack.h
   development/source/cpu/cHardwareTracer_CPU.h
   development/source/cpu/cHardwareTracer_SMT.h
   development/source/cpu/cHardwareTracer_TestCPU.h
   development/source/cpu/cHeadCPU.h
   development/source/cpu/cHeadMultiMem.h
   development/source/cpu/cInstLibCPU.h
   development/source/cpu/cTestCPU.h
   development/source/cpu/cTestCPUInterface.h
   development/source/cpu/cTestUtil.h
   development/source/cpu/sCPUStats.h
   development/source/drivers/cAvidaDriver.h
Log:

Moving class' UnitTests functions to corresponding namespaces.



Modified: development/source/cpu/cHardwareCPU_Thread.h
===================================================================
--- development/source/cpu/cHardwareCPU_Thread.h	2006-05-09 00:05:28 UTC (rev 665)
+++ development/source/cpu/cHardwareCPU_Thread.h	2006-05-09 00:11:07 UTC (rev 666)
@@ -60,17 +60,18 @@
   void Reset(cHardwareBase* in_hardware, int _id);
   int GetID() const { return id; }
   void SetID(int _id) { id = _id; }
+};
 
 
 #ifdef ENABLE_UNIT_TESTS
-public:
+namespace nHardwareCPU_Thread {
   /**
    * 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  
-};
 
 #endif

Modified: development/source/cpu/cHardwareManager.h
===================================================================
--- development/source/cpu/cHardwareManager.h	2006-05-09 00:05:28 UTC (rev 665)
+++ development/source/cpu/cHardwareManager.h	2006-05-09 00:11:07 UTC (rev 666)
@@ -44,17 +44,18 @@
   
   const cInstSet& GetInstSet() const { return m_inst_set; }
   cInstSet& GetInstSet() { return m_inst_set; }
+};
 
 
 #ifdef ENABLE_UNIT_TESTS
-public:
+namespace nHardwareManager {
   /**
    * 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  
-};
 
 #endif

Modified: development/source/cpu/cHardwareSMT.h
===================================================================
--- development/source/cpu/cHardwareSMT.h	2006-05-09 00:05:28 UTC (rev 665)
+++ development/source/cpu/cHardwareSMT.h	2006-05-09 00:11:07 UTC (rev 666)
@@ -299,18 +299,19 @@
   bool Inst_NetLast(cAvidaContext& ctx);        // 42
   bool Inst_RotateLeft(cAvidaContext& ctx);     // 43
   bool Inst_RotateRight(cAvidaContext& ctx);    // 44
+};
 
 
 #ifdef ENABLE_UNIT_TESTS
-public:
+namespace nHardwareSMT {
   /**
    * 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 bool cHardwareSMT::ThreadKill(const cCodeLabel& in_label)

Modified: development/source/cpu/cHardwareStatusPrinter.h
===================================================================
--- development/source/cpu/cHardwareStatusPrinter.h	2006-05-09 00:05:28 UTC (rev 665)
+++ development/source/cpu/cHardwareStatusPrinter.h	2006-05-09 00:11:07 UTC (rev 666)
@@ -63,17 +63,18 @@
   virtual void TraceHardware_SMTBonus(cHardwareSMT &hardware);
   virtual void TraceHardware_TestCPU(int time_used, int time_allocated, int size,
                                      const cString& final_memory, const cString& child_memory);
+};
 
 
 #ifdef ENABLE_UNIT_TESTS
-public:
+namespace nHardwareStatusPrinter {
   /**
    * 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  
-};
 
 #endif

Modified: development/source/cpu/cHardwareTracer.h
===================================================================
--- development/source/cpu/cHardwareTracer.h	2006-05-09 00:05:28 UTC (rev 665)
+++ development/source/cpu/cHardwareTracer.h	2006-05-09 00:11:07 UTC (rev 666)
@@ -15,17 +15,6 @@
 {
 public:
   virtual ~cHardwareTracer() { ; }
-
-
-#ifdef ENABLE_UNIT_TESTS
-public:
-  /**
-   * Run unit tests
-   *
-   * @param full Run full test suite; if false, just the fast tests.
-   **/
-  static void UnitTests(bool full = false);
-#endif  
 };
 
 #endif

Modified: development/source/cpu/cHardwareTracer_4Stack.h
===================================================================
--- development/source/cpu/cHardwareTracer_4Stack.h	2006-05-09 00:05:28 UTC (rev 665)
+++ development/source/cpu/cHardwareTracer_4Stack.h	2006-05-09 00:11:07 UTC (rev 666)
@@ -17,17 +17,6 @@
   virtual ~cHardwareTracer_4Stack() { ; }
   virtual void TraceHardware_4Stack(cHardware4Stack &) = 0;
   virtual void TraceHardware_4StackBonus(cHardware4Stack &) = 0;
-
-
-#ifdef ENABLE_UNIT_TESTS
-public:
-  /**
-   * Run unit tests
-   *
-   * @param full Run full test suite; if false, just the fast tests.
-   **/
-  static void UnitTests(bool full = false);
-#endif  
 };
 
 #endif

Modified: development/source/cpu/cHardwareTracer_CPU.h
===================================================================
--- development/source/cpu/cHardwareTracer_CPU.h	2006-05-09 00:05:28 UTC (rev 665)
+++ development/source/cpu/cHardwareTracer_CPU.h	2006-05-09 00:11:07 UTC (rev 666)
@@ -18,17 +18,6 @@
   virtual ~cHardwareTracer_CPU() { ; }
   virtual void TraceHardware_CPU(cHardwareCPU &) = 0;
   virtual void TraceHardware_CPUBonus(cHardwareCPU &) = 0;
-
-
-#ifdef ENABLE_UNIT_TESTS
-public:
-  /**
-   * Run unit tests
-   *
-   * @param full Run full test suite; if false, just the fast tests.
-   **/
-  static void UnitTests(bool full = false);
-#endif  
 };
 
 #endif

Modified: development/source/cpu/cHardwareTracer_SMT.h
===================================================================
--- development/source/cpu/cHardwareTracer_SMT.h	2006-05-09 00:05:28 UTC (rev 665)
+++ development/source/cpu/cHardwareTracer_SMT.h	2006-05-09 00:11:07 UTC (rev 666)
@@ -17,17 +17,6 @@
   virtual ~cHardwareTracer_SMT() { ; }
   virtual void TraceHardware_SMT(cHardwareSMT &) = 0;
   virtual void TraceHardware_SMTBonus(cHardwareSMT &) = 0;
-
-
-#ifdef ENABLE_UNIT_TESTS
-public:
-  /**
-   * Run unit tests
-   *
-   * @param full Run full test suite; if false, just the fast tests.
-   **/
-  static void UnitTests(bool full = false);
-#endif  
 };
 
 #endif

Modified: development/source/cpu/cHardwareTracer_TestCPU.h
===================================================================
--- development/source/cpu/cHardwareTracer_TestCPU.h	2006-05-09 00:05:28 UTC (rev 665)
+++ development/source/cpu/cHardwareTracer_TestCPU.h	2006-05-09 00:11:07 UTC (rev 666)
@@ -22,17 +22,6 @@
     const cString &final_memory,
     const cString &child_memory
   ) = 0;
-
-
-#ifdef ENABLE_UNIT_TESTS
-public:
-  /**
-   * Run unit tests
-   *
-   * @param full Run full test suite; if false, just the fast tests.
-   **/
-  static void UnitTests(bool full = false);
-#endif  
 };
 
 #endif

Modified: development/source/cpu/cHeadCPU.h
===================================================================
--- development/source/cpu/cHeadCPU.h	2006-05-09 00:05:28 UTC (rev 665)
+++ development/source/cpu/cHeadCPU.h	2006-05-09 00:11:07 UTC (rev 666)
@@ -122,17 +122,18 @@
 
   // Test functions...
   int TestParasite() const;
+};
 
 
 #ifdef ENABLE_UNIT_TESTS
-public:
+namespace nHeadCPU {
   /**
    * 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  
-};
 
 #endif

Modified: development/source/cpu/cHeadMultiMem.h
===================================================================
--- development/source/cpu/cHeadMultiMem.h	2006-05-09 00:05:28 UTC (rev 665)
+++ development/source/cpu/cHeadMultiMem.h	2006-05-09 00:11:07 UTC (rev 666)
@@ -61,17 +61,18 @@
   bool operator==(const cHeadMultiMem& in_cpu_head) const; 
   bool AtEnd() const;
   bool InMemory() const;
+};
 
 
 #ifdef ENABLE_UNIT_TESTS
-public:
+namespace nHeadMultiMem {
   /**
    * 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  
-};
 
 #endif

Modified: development/source/cpu/cInstLibCPU.h
===================================================================
--- development/source/cpu/cInstLibCPU.h	2006-05-09 00:05:28 UTC (rev 665)
+++ development/source/cpu/cInstLibCPU.h	2006-05-09 00:11:07 UTC (rev 666)
@@ -79,18 +79,19 @@
   }
   const cInstruction & GetInstDefault(){ return inst_default; }
   const cInstruction & GetInstError(){ return inst_error; }
+};
 
 
 #ifdef ENABLE_UNIT_TESTS
-public:
+namespace nInstLibCPU {
   /**
    * 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  
-};
 
 
 #endif

Modified: development/source/cpu/cTestCPU.h
===================================================================
--- development/source/cpu/cTestCPU.h	2006-05-09 00:05:28 UTC (rev 665)
+++ development/source/cpu/cTestCPU.h	2006-05-09 00:11:07 UTC (rev 666)
@@ -41,18 +41,19 @@
   
 public:
   cTestResources(cWorld* world);
+};
 
 
 #ifdef ENABLE_UNIT_TESTS
-public:
+namespace nTestResources {
   /**
    * Run unit tests
    *
    * @param full Run full test suite; if false, just the fast tests.
    **/
   static void UnitTests(bool full = false);
-#endif  
-};
+}
+#endif
 
 class cTestCPU
 {
@@ -95,7 +96,19 @@
   cResourceCount& GetResourceCount(void) { return m_res->resource_count; }
 };
 
+#ifdef ENABLE_UNIT_TESTS
+namespace nTestCPU {
+  /**
+   * Run unit tests
+   *
+   * @param full Run full test suite; if false, just the fast tests.
+   **/
+  static void UnitTests(bool full = false);
+}
+#endif
 
+
+
 // Inline Methods
 
 inline int cTestCPU::GetInput()

Modified: development/source/cpu/cTestCPUInterface.h
===================================================================
--- development/source/cpu/cTestCPUInterface.h	2006-05-09 00:05:28 UTC (rev 665)
+++ development/source/cpu/cTestCPUInterface.h	2006-05-09 00:11:07 UTC (rev 666)
@@ -51,17 +51,18 @@
   int ReceiveValue();
   bool InjectParasite(cOrganism* parent, const cGenome& injected_code);
   bool UpdateMerit(double new_merit);
+};
 
 
 #ifdef ENABLE_UNIT_TESTS
-public:
+namespace nTestCPUInterface {
   /**
    * 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  
-};
 
 #endif

Modified: development/source/cpu/cTestUtil.h
===================================================================
--- development/source/cpu/cTestUtil.h	2006-05-09 00:05:28 UTC (rev 665)
+++ development/source/cpu/cTestUtil.h	2006-05-09 00:11:07 UTC (rev 666)
@@ -35,17 +35,18 @@
                           cGenotype * genotype=NULL, int update_out=-1);
   static void PrintGenome(cWorld* world, cInjectGenotype * genotype, const cGenome & genome, 
                           cString filename="", int update_out=-1);
+};
 
 
 #ifdef ENABLE_UNIT_TESTS
-public:
+namespace nTestUtil {
   /**
    * 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  
-};
 
 #endif

Modified: development/source/cpu/sCPUStats.h
===================================================================
--- development/source/cpu/sCPUStats.h	2006-05-09 00:05:28 UTC (rev 665)
+++ development/source/cpu/sCPUStats.h	2006-05-09 00:11:07 UTC (rev 666)
@@ -60,17 +60,18 @@
   void Clear() {  // Called on any New Creature
     mut_stats.Clear();
   }
+};
 
 
 #ifdef ENABLE_UNIT_TESTS
-public:
+namespace nCPUStats {
   /**
    * 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  
-};
 
 #endif

Modified: development/source/drivers/cAvidaDriver.h
===================================================================
--- development/source/drivers/cAvidaDriver.h	2006-05-09 00:05:28 UTC (rev 665)
+++ development/source/drivers/cAvidaDriver.h	2006-05-09 00:11:07 UTC (rev 666)
@@ -25,17 +25,6 @@
   virtual ~cAvidaDriver() { ; }
   
   virtual void Run() = 0;
-
-
-#ifdef ENABLE_UNIT_TESTS
-public:
-  /**
-   * Run unit tests
-   *
-   * @param full Run full test suite; if false, just the fast tests.
-   **/
-  static void UnitTests(bool full = false);
-#endif  
 };
 
 #endif




More information about the Avida-cvs mailing list