[Avida-cvs] [avida-svn] r665 - in development/source: classification cpu

kaben@myxo.css.msu.edu kaben at myxo.css.msu.edu
Mon May 8 17:05:28 PDT 2006


Author: kaben
Date: 2006-05-08 20:05:28 -0400 (Mon, 08 May 2006)
New Revision: 665

Modified:
   development/source/classification/cInjectGenotypeElement.h
   development/source/classification/cInjectGenotypeQueue.h
   development/source/classification/cInjectGenotype_BirthData.h
   development/source/classification/cLineage.h
   development/source/classification/cSpecies.h
   development/source/classification/cSpeciesControl.h
   development/source/classification/cSpeciesQueue.h
   development/source/cpu/cCPUMemory.h
   development/source/cpu/cCPUStack.h
   development/source/cpu/cCPUTestInfo.h
   development/source/cpu/cCodeLabel.h
   development/source/cpu/cHardware4Stack.h
   development/source/cpu/cHardware4Stack_Thread.h
   development/source/cpu/cHardwareBase.h
   development/source/cpu/cHardwareCPU.h
Log:

Moving class' UnitTests functions to corresponding namespaces.



Modified: development/source/classification/cInjectGenotypeElement.h
===================================================================
--- development/source/classification/cInjectGenotypeElement.h	2006-05-08 23:59:07 UTC (rev 664)
+++ development/source/classification/cInjectGenotypeElement.h	2006-05-09 00:05:28 UTC (rev 665)
@@ -36,17 +36,18 @@
 
   void SetNext(cInjectGenotypeElement* in_next) { next = in_next; }
   void SetPrev(cInjectGenotypeElement* in_prev) { prev = in_prev; }
+};
 
 
 #ifdef ENABLE_UNIT_TESTS
-public:
+namespace nInjectGenotypeElement {
   /**
    * 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/classification/cInjectGenotypeQueue.h
===================================================================
--- development/source/classification/cInjectGenotypeQueue.h	2006-05-08 23:59:07 UTC (rev 664)
+++ development/source/classification/cInjectGenotypeQueue.h	2006-05-09 00:05:28 UTC (rev 665)
@@ -37,17 +37,18 @@
   void Insert(cInjectGenotype & in_inject_genotype);
   void Remove(cInjectGenotype & in_inject_genotype);
   cInjectGenotype * Find(const cGenome & in_genome) const;
+};
 
 
 #ifdef ENABLE_UNIT_TESTS
-public:
+namespace nInjectGenotypeQueue {
   /**
    * 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/classification/cInjectGenotype_BirthData.h
===================================================================
--- development/source/classification/cInjectGenotype_BirthData.h	2006-05-08 23:59:07 UTC (rev 664)
+++ development/source/classification/cInjectGenotype_BirthData.h	2006-05-09 00:05:28 UTC (rev 665)
@@ -37,18 +37,19 @@
   cInjectGenotype * parent_genotype; // Pointer to parent genotype...
   //cSpecies * parent_species;
   int num_offspring_genotypes; // Num offspring genotypes still in memory.
+};
 
 
 #ifdef ENABLE_UNIT_TESTS
-public:
+namespace nInjectGenotype_BirthData {
   /**
    * 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 cInjectGenotype_BirthData::cInjectGenotype_BirthData(int in_update_born)
 : update_born(in_update_born)

Modified: development/source/classification/cLineage.h
===================================================================
--- development/source/classification/cLineage.h	2006-05-08 23:59:07 UTC (rev 664)
+++ development/source/classification/cLineage.h	2006-05-09 00:05:28 UTC (rev 665)
@@ -167,17 +167,18 @@
    * the creation of this lineage
    **/
   double GetLineageStat2 () const { return m_lineage_stat2; }
+};
 
 
 #ifdef ENABLE_UNIT_TESTS
-public:
+namespace nLineage {
   /**
    * 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/classification/cSpecies.h
===================================================================
--- development/source/classification/cSpecies.h	2006-05-08 23:59:07 UTC (rev 664)
+++ development/source/classification/cSpecies.h	2006-05-09 00:05:28 UTC (rev 665)
@@ -91,17 +91,18 @@
   int debug_num_genotypes;
   int debug_num_threshold;
 #endif
+};
 
 
 #ifdef ENABLE_UNIT_TESTS
-public:
+namespace nSpecies {
   /**
    * 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/classification/cSpeciesControl.h
===================================================================
--- development/source/classification/cSpeciesControl.h	2006-05-08 23:59:07 UTC (rev 664)
+++ development/source/classification/cSpeciesControl.h	2006-05-09 00:05:28 UTC (rev 665)
@@ -55,17 +55,18 @@
     { return garbage_queue.GetFirst(); }
   inline int GetSize() const { return active_queue.GetSize(); }
   inline int GetInactiveSize() const { return inactive_queue.GetSize(); }
+};
 
 
 #ifdef ENABLE_UNIT_TESTS
-public:
+namespace nSpeciesControl {
   /**
    * 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/classification/cSpeciesQueue.h
===================================================================
--- development/source/classification/cSpeciesQueue.h	2006-05-08 23:59:07 UTC (rev 664)
+++ development/source/classification/cSpeciesQueue.h	2006-05-09 00:05:28 UTC (rev 665)
@@ -38,17 +38,18 @@
 
   inline int GetSize() const { return size; }
   inline cSpecies * GetFirst() const { return first; }
+};
 
 
 #ifdef ENABLE_UNIT_TESTS
-public:
+namespace nSpeciesQueue {
   /**
    * 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/cCPUMemory.h
===================================================================
--- development/source/cpu/cCPUMemory.h	2006-05-08 23:59:07 UTC (rev 664)
+++ development/source/cpu/cCPUMemory.h	2006-05-09 00:05:28 UTC (rev 665)
@@ -90,17 +90,18 @@
   void Insert(int pos, const cGenome& in_genome);
   void Remove(int pos, int num_insts=1);
   void Replace(int pos, int num_insts, const cGenome& in_genome);
+};
 
 
 #ifdef ENABLE_UNIT_TESTS
-public:
+namespace nCPUMemory {
   /**
    * 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/cCPUStack.h
===================================================================
--- development/source/cpu/cCPUStack.h	2006-05-08 23:59:07 UTC (rev 664)
+++ development/source/cpu/cCPUStack.h	2006-05-09 00:05:28 UTC (rev 665)
@@ -43,18 +43,19 @@
 
   void SaveState(std::ostream& fp);
   void LoadState(std::istream & fp);
+};
 
 
 #ifdef ENABLE_UNIT_TESTS
-public:
+namespace nCPUStack {
   /**
    * 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 void cCPUStack::Push(int value)

Modified: development/source/cpu/cCPUTestInfo.h
===================================================================
--- development/source/cpu/cCPUTestInfo.h	2006-05-08 23:59:07 UTC (rev 664)
+++ development/source/cpu/cCPUTestInfo.h	2006-05-09 00:05:28 UTC (rev 665)
@@ -96,17 +96,18 @@
   // And just because these are so commonly used...
   double GetGenotypeFitness();
   double GetColonyFitness();
+};
 
 
 #ifdef ENABLE_UNIT_TESTS
-public:
+namespace nCPUTestInfo {
   /**
    * 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/cCodeLabel.h
===================================================================
--- development/source/cpu/cCodeLabel.h	2006-05-08 23:59:07 UTC (rev 664)
+++ development/source/cpu/cCodeLabel.h	2006-05-09 00:05:28 UTC (rev 665)
@@ -69,18 +69,19 @@
   int AsIntAdditivePolynomial(const int base) const;
   int AsIntFib(const int base) const;
   int AsIntPolynomialCoefficent(const int base) const;
+};
 
 
 #ifdef ENABLE_UNIT_TESTS
-public:
+namespace nCodeLabel {
   /**
    * 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  
-};
 
 void cCodeLabel::AddNop(int nop_num) {
   assert (nop_num < nHardware::MAX_NOPS);

Modified: development/source/cpu/cHardware4Stack.h
===================================================================
--- development/source/cpu/cHardware4Stack.h	2006-05-08 23:59:07 UTC (rev 664)
+++ development/source/cpu/cHardware4Stack.h	2006-05-09 00:05:28 UTC (rev 665)
@@ -266,18 +266,19 @@
   bool Inst_KillThread(cAvidaContext& ctx);
   bool Inst_IO(cAvidaContext& ctx);
   bool Inst_Inject(cAvidaContext& ctx);  
+};
 
 
 #ifdef ENABLE_UNIT_TESTS
-public:
+namespace nHardware4Stack {
   /**
    * 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 cHardware4Stack::ThreadSelect(const int thread_num)

Modified: development/source/cpu/cHardware4Stack_Thread.h
===================================================================
--- development/source/cpu/cHardware4Stack_Thread.h	2006-05-08 23:59:07 UTC (rev 664)
+++ development/source/cpu/cHardware4Stack_Thread.h	2006-05-09 00:05:28 UTC (rev 665)
@@ -61,17 +61,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 nHardware4Stack_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/cHardwareBase.h
===================================================================
--- development/source/cpu/cHardwareBase.h	2006-05-08 23:59:07 UTC (rev 664)
+++ development/source/cpu/cHardwareBase.h	2006-05-09 00:05:28 UTC (rev 665)
@@ -143,17 +143,18 @@
 protected:
   // --------  No-Operation Instruction --------
   bool Inst_Nop(cAvidaContext& ctx);  // A no-operation instruction that does nothing! 
+};
 
 
 #ifdef ENABLE_UNIT_TESTS
-public:
+namespace nHardwareBase {
   /**
    * 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/cHardwareCPU.h
===================================================================
--- development/source/cpu/cHardwareCPU.h	2006-05-08 23:59:07 UTC (rev 664)
+++ development/source/cpu/cHardwareCPU.h	2006-05-09 00:05:28 UTC (rev 665)
@@ -424,18 +424,19 @@
 
   //// Placebo ////
   bool Inst_Skip(cAvidaContext& ctx);
+};
 
 
 #ifdef ENABLE_UNIT_TESTS
-public:
+namespace nHardwareCPU {
   /**
    * 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 cHardwareCPU::ThreadSelect(const int thread_num)




More information about the Avida-cvs mailing list