[Avida-cvs] [avida-svn] r672 - in development/source: main script tools
kaben@myxo.css.msu.edu
kaben at myxo.css.msu.edu
Mon May 8 17:36:28 PDT 2006
Author: kaben
Date: 2006-05-08 20:36:28 -0400 (Mon, 08 May 2006)
New Revision: 672
Modified:
development/source/main/cTaskLib.h
development/source/main/cWorld.h
development/source/script/cASLibrary.h
development/source/script/cASSymbol.h
development/source/script/cParser.h
development/source/script/cScriptObject.h
development/source/script/cSymbolTable.h
development/source/tools/cBlockStruct.h
development/source/tools/cConstSchedule.h
development/source/tools/cCountTracker.h
development/source/tools/cCycleCheck.h
development/source/tools/cDataFile.h
development/source/tools/cDataFileManager.h
development/source/tools/cDataManager_Base.h
development/source/tools/cDefaultMessageDisplay.h
development/source/tools/cDoubleSum.h
development/source/tools/cFixedBlock.h
development/source/tools/cFixedCoords.h
development/source/tools/cGenesis.h
development/source/tools/cHelpAlias.h
development/source/tools/cHelpEntry.h
Log:
Moving class' UnitTests functions to corresponding namespaces.
Modified: development/source/main/cTaskLib.h
===================================================================
--- development/source/main/cTaskLib.h 2006-05-09 00:29:14 UTC (rev 671)
+++ development/source/main/cTaskLib.h 2006-05-09 00:36:28 UTC (rev 672)
@@ -219,18 +219,19 @@
double Task_NetSend(cTaskContext* ctx) const;
double Task_NetReceive(cTaskContext* ctx) const;
+};
#ifdef ENABLE_UNIT_TESTS
-public:
+namespace nTaskLib {
/**
* 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 double cTaskLib::TestOutput(const cTaskEntry& task, cTaskContext* ctx) const
Modified: development/source/main/cWorld.h
===================================================================
--- development/source/main/cWorld.h 2006-05-09 00:29:14 UTC (rev 671)
+++ development/source/main/cWorld.h 2006-05-09 00:36:28 UTC (rev 672)
@@ -106,17 +106,18 @@
void GetEvents();
void ReadEventListFile(const cString & filename);
void SyncEventList();
+};
#ifdef ENABLE_UNIT_TESTS
-public:
+namespace nWorld {
/**
* 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/script/cASLibrary.h
===================================================================
--- development/source/script/cASLibrary.h 2006-05-09 00:29:14 UTC (rev 671)
+++ development/source/script/cASLibrary.h 2006-05-09 00:36:28 UTC (rev 672)
@@ -25,17 +25,18 @@
public:
cASLibrary() { ; }
+};
#ifdef ENABLE_UNIT_TESTS
-public:
+namespace nASLibrary {
/**
* Run unit tests
*
* @param full Run full test suite; if false, just the fast tests.
**/
- static void UnitTests(bool full = false);
-#endif
-};
+ void UnitTests(bool full = false);
+}
+#endif
#endif
Modified: development/source/script/cASSymbol.h
===================================================================
--- development/source/script/cASSymbol.h 2006-05-09 00:29:14 UTC (rev 671)
+++ development/source/script/cASSymbol.h 2006-05-09 00:36:28 UTC (rev 672)
@@ -23,17 +23,18 @@
public:
cASSymbol(cString name) : m_name(name) { ; }
+};
#ifdef ENABLE_UNIT_TESTS
-public:
+namespace nASSymbol {
/**
* 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/script/cParser.h
===================================================================
--- development/source/script/cParser.h 2006-05-09 00:29:14 UTC (rev 671)
+++ development/source/script/cParser.h 2006-05-09 00:36:28 UTC (rev 672)
@@ -39,17 +39,18 @@
cParser(cASLibrary* library) : m_library(library), m_symtbl(NULL) { ; }
cScriptObject* Parse(std::istream* input);
+};
#ifdef ENABLE_UNIT_TESTS
-public:
+namespace nParser {
/**
* 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/script/cScriptObject.h
===================================================================
--- development/source/script/cScriptObject.h 2006-05-09 00:29:14 UTC (rev 671)
+++ development/source/script/cScriptObject.h 2006-05-09 00:36:28 UTC (rev 672)
@@ -16,17 +16,18 @@
public:
cScriptObject() { ; }
+};
#ifdef ENABLE_UNIT_TESTS
-public:
+namespace nScriptObject {
/**
* 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/script/cSymbolTable.h
===================================================================
--- development/source/script/cSymbolTable.h 2006-05-09 00:29:14 UTC (rev 671)
+++ development/source/script/cSymbolTable.h 2006-05-09 00:36:28 UTC (rev 672)
@@ -25,17 +25,18 @@
public:
cSymbolTable() { ; }
+};
#ifdef ENABLE_UNIT_TESTS
-public:
+namespace nSymbolTable {
/**
* 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/tools/cBlockStruct.h
===================================================================
--- development/source/tools/cBlockStruct.h 2006-05-09 00:29:14 UTC (rev 671)
+++ development/source/tools/cBlockStruct.h 2006-05-09 00:36:28 UTC (rev 672)
@@ -228,18 +228,19 @@
inline int GetFixedSize() const { return fixed_size; }
inline int GetBlocksUsed() const { return fixed_used.GetBlockNum() + 1; }
inline void SetFixedSize(int in_fs) { fixed_size = in_fs; }
+};
#ifdef ENABLE_UNIT_TESTS
-public:
+namespace nBlockStruct {
/**
* 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 * cBlockStruct::Find(const cFixedCoords & search_coords) const
{
Modified: development/source/tools/cConstSchedule.h
===================================================================
--- development/source/tools/cConstSchedule.h 2006-05-09 00:29:14 UTC (rev 671)
+++ development/source/tools/cConstSchedule.h 2006-05-09 00:36:28 UTC (rev 672)
@@ -44,17 +44,18 @@
void Adjust(int item_id, const cMerit& merit);
int GetNextID();
+};
#ifdef ENABLE_UNIT_TESTS
-public:
+namespace nConstSchedule {
/**
* 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/tools/cCountTracker.h
===================================================================
--- development/source/tools/cCountTracker.h 2006-05-09 00:29:14 UTC (rev 671)
+++ development/source/tools/cCountTracker.h 2006-05-09 00:36:28 UTC (rev 672)
@@ -30,17 +30,18 @@
void Dec() { cur_count--; }
void Next() { last_count = cur_count; cur_count = 0; }
void Clear() { cur_count = last_count = total_count = 0; }
+};
#ifdef ENABLE_UNIT_TESTS
-public:
+namespace nCountTracker {
/**
* 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/tools/cCycleCheck.h
===================================================================
--- development/source/tools/cCycleCheck.h 2006-05-09 00:29:14 UTC (rev 671)
+++ development/source/tools/cCycleCheck.h 2006-05-09 00:36:28 UTC (rev 672)
@@ -64,17 +64,18 @@
verification.
*/
~cCycleCheck();
+};
#ifdef ENABLE_UNIT_TESTS
-public:
+namespace nCycleCheck {
/**
* 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/tools/cDataFile.h
===================================================================
--- development/source/tools/cDataFile.h 2006-05-09 00:29:14 UTC (rev 671)
+++ development/source/tools/cDataFile.h 2006-05-09 00:36:28 UTC (rev 672)
@@ -142,17 +142,18 @@
* This function makes sure that all cached data is written to the disk.
**/
void Flush() { m_fp.flush(); }
+};
#ifdef ENABLE_UNIT_TESTS
-public:
+namespace nDataFile {
/**
* 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/tools/cDataFileManager.h
===================================================================
--- development/source/tools/cDataFileManager.h 2006-05-09 00:29:14 UTC (rev 671)
+++ development/source/tools/cDataFileManager.h 2006-05-09 00:36:28 UTC (rev 672)
@@ -65,18 +65,19 @@
* @return true if file existed, otherwise false.
**/
bool Remove(const cString& name);
+};
#ifdef ENABLE_UNIT_TESTS
-public:
+namespace nDataFileManager {
/**
* 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 cDataFileManager::cDataFileManager(cString target_dir) : m_target_dir(target_dir)
{
Modified: development/source/tools/cDataManager_Base.h
===================================================================
--- development/source/tools/cDataManager_Base.h 2006-05-09 00:29:14 UTC (rev 671)
+++ development/source/tools/cDataManager_Base.h 2006-05-09 00:36:28 UTC (rev 672)
@@ -38,17 +38,18 @@
virtual bool GetDesc(const cString& name, cString& out_desc) = 0;
bool PrintRow(cDataFile& data_file, cString row_entries, char sep=' ');
+};
#ifdef ENABLE_UNIT_TESTS
-public:
+namespace nDataManager_Base {
/**
* 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/tools/cDefaultMessageDisplay.h
===================================================================
--- development/source/tools/cDefaultMessageDisplay.h 2006-05-09 00:29:14 UTC (rev 671)
+++ development/source/tools/cDefaultMessageDisplay.h 2006-05-09 00:36:28 UTC (rev 672)
@@ -47,18 +47,19 @@
public:
cDefaultMessageDisplay(std::ostream* stream) : m_out(stream) { ; }
void out(cString& final_msg);
+};
#ifdef ENABLE_UNIT_TESTS
-public:
+namespace nDefaultMessageDisplay {
/**
* 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
-};
extern cDefaultMessageDisplay s_info_msg_cout;
extern cDefaultMessageDisplay s_debug_msg_cerr;
Modified: development/source/tools/cDoubleSum.h
===================================================================
--- development/source/tools/cDoubleSum.h 2006-05-09 00:29:14 UTC (rev 671)
+++ development/source/tools/cDoubleSum.h 2006-05-09 00:36:28 UTC (rev 672)
@@ -87,17 +87,18 @@
s3 -= w_val * w_val * w_val;
s4 -= w_val * w_val * w_val * w_val;
}
+};
#ifdef ENABLE_UNIT_TESTS
-public:
+namespace nDoubleSum {
/**
* 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/tools/cFixedBlock.h
===================================================================
--- development/source/tools/cFixedBlock.h 2006-05-09 00:29:14 UTC (rev 671)
+++ development/source/tools/cFixedBlock.h 2006-05-09 00:36:28 UTC (rev 672)
@@ -24,17 +24,18 @@
inline int GetStart() { return start_point; }
inline void SetStart(int in_sp) { start_point = in_sp; }
+};
#ifdef ENABLE_UNIT_TESTS
-public:
+namespace nFixedBlock {
/**
* 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/tools/cFixedCoords.h
===================================================================
--- development/source/tools/cFixedCoords.h 2006-05-09 00:29:14 UTC (rev 671)
+++ development/source/tools/cFixedCoords.h 2006-05-09 00:36:28 UTC (rev 672)
@@ -84,17 +84,18 @@
block_num += offset / fixed_size;
offset %= fixed_size;
}
+};
#ifdef ENABLE_UNIT_TESTS
-public:
+namespace nFixedCoords {
/**
* 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/tools/cGenesis.h
===================================================================
--- development/source/tools/cGenesis.h 2006-05-09 00:29:14 UTC (rev 671)
+++ development/source/tools/cGenesis.h 2006-05-09 00:36:28 UTC (rev 672)
@@ -91,18 +91,19 @@
void Read(bool & _var, const cString & _name, const cString & _def="0.0") {
_var = ReadInt(_name, _def.AsInt()) != 0;
}
+};
#ifdef ENABLE_UNIT_TESTS
-public:
+namespace nGenesis {
/**
* 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/tools/cHelpAlias.h
===================================================================
--- development/source/tools/cHelpAlias.h 2006-05-09 00:29:14 UTC (rev 671)
+++ development/source/tools/cHelpAlias.h 2006-05-09 00:36:28 UTC (rev 672)
@@ -32,17 +32,18 @@
cHelpType * GetType() const;
bool IsAlias() const { return true; }
+};
#ifdef ENABLE_UNIT_TESTS
-public:
+namespace nHelpAlias {
/**
* 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/tools/cHelpEntry.h
===================================================================
--- development/source/tools/cHelpEntry.h 2006-05-09 00:29:14 UTC (rev 671)
+++ development/source/tools/cHelpEntry.h 2006-05-09 00:36:28 UTC (rev 672)
@@ -35,17 +35,18 @@
virtual bool IsAlias() const = 0;
cString GetHTMLFilename() const { return cStringUtil::Stringf("help.%s.html", static_cast<const char*>(GetKeyword())); }
+};
#ifdef ENABLE_UNIT_TESTS
-public:
+namespace nHelpEntry {
/**
* 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
More information about the Avida-cvs
mailing list