Browse Source

Made changes to testing protocol

enhancement_3
Trevor Irons 8 years ago
parent
commit
4da2f9ffd6

+ 5
- 6
CMakeLists.txt View File

204
     enable_testing()
204
     enable_testing()
205
     #CXXTEST_ADD_TEST(tester_executable runner.cpp
205
     #CXXTEST_ADD_TEST(tester_executable runner.cpp
206
     #                    ${CMAKE_CURRENT_SOURCE_DIR}/src/myTestsuite.h)
206
     #                    ${CMAKE_CURRENT_SOURCE_DIR}/src/myTestsuite.h)
207
-	CXXTEST_ADD_TEST(unittest_foo foo_test.cc
208
-                      ${CMAKE_CURRENT_SOURCE_DIR}/src/myTestSuite.h)
207
+	#CXXTEST_ADD_TEST(unittest_foo foo_test.cc
208
+    #                  ${CMAKE_CURRENT_SOURCE_DIR}/src/myTestSuite.h)
209
     #target_link_libraries(unittest_foo foo) # as needed
209
     #target_link_libraries(unittest_foo foo) # as needed
210
 #	else()
210
 #	else()
211
 #	message(FATAL_ERROR "CxxTest not found.")
211
 #	message(FATAL_ERROR "CxxTest not found.")
222
 # 
222
 # 
223
 include_directories(${CMAKE_INSTALL_PREFIX}/include)
223
 include_directories(${CMAKE_INSTALL_PREFIX}/include)
224
 
224
 
225
-add_executable(Hello "${PROJECT_SOURCE_DIR}/src/test.cpp")
226
-target_link_libraries(Hello lemmacore)
227
-add_dependencies(Hello YAML-CPP)
228
-
225
+#add_executable(Hello "${PROJECT_SOURCE_DIR}/src/test.cpp")
226
+#target_link_libraries(Hello lemmacore)
227
+#add_dependencies(Hello YAML-CPP)
229
 
228
 
230
 # add a target to generate API documentation with Doxygen
229
 # add a target to generate API documentation with Doxygen
231
 # ALL make documentation build by default if possible
230
 # ALL make documentation build by default if possible

+ 5
- 0
LemmaCore/include/EarthModel.h View File

90
             /// \mathbf{B}_0 \Vert \f$ in Gauss units
90
             /// \mathbf{B}_0 \Vert \f$ in Gauss units
91
             Real GetMagneticFieldMagnitudeInGauss( );
91
             Real GetMagneticFieldMagnitudeInGauss( );
92
 
92
 
93
+            /** Returns the name of the underlying class, similiar to Python's type */
94
+            virtual inline std::string GetName() const {
95
+                return this->CName;
96
+            }
97
+
93
         protected:
98
         protected:
94
 
99
 
95
             // ====================  LIFECYCLE     =======================
100
             // ====================  LIFECYCLE     =======================

+ 5
- 0
LemmaCore/include/Filter.h View File

39
 
39
 
40
             // ====================  INQUIRY       =======================
40
             // ====================  INQUIRY       =======================
41
 
41
 
42
+            /** Returns the name of the underlying class, similiar to Python's type */
43
+            virtual inline std::string GetName() const {
44
+                return this->CName;
45
+            }
46
+
42
         protected:
47
         protected:
43
 
48
 
44
             // ====================  LIFECYCLE     =======================
49
             // ====================  LIFECYCLE     =======================

+ 5
- 0
LemmaCore/include/Grid.h View File

42
 
42
 
43
         // ====================  INQUIRY       ===================================
43
         // ====================  INQUIRY       ===================================
44
 
44
 
45
+        /** Returns the name of the underlying class, similiar to Python's type */
46
+        virtual inline std::string GetName() const {
47
+            return this->CName;
48
+        }
49
+
45
     protected:
50
     protected:
46
 
51
 
47
         // ====================  LIFECYCLE     ===================================
52
         // ====================  LIFECYCLE     ===================================

+ 8
- 0
LemmaCore/include/GridReader.h View File

51
 
51
 
52
             // ====================  INQUIRY       =======================
52
             // ====================  INQUIRY       =======================
53
 
53
 
54
+            /** Returns the name of the underlying class, similiar to Python's type */
55
+            virtual inline std::string GetName() const {
56
+                return this->CName;
57
+            }
58
+
54
         protected:
59
         protected:
55
 
60
 
56
             // ====================  LIFECYCLE     =======================
61
             // ====================  LIFECYCLE     =======================
65
 
70
 
66
         private:
71
         private:
67
 
72
 
73
+            /** ASCII string representation of the class name */
74
+            static constexpr auto CName = "GridReader";
75
+
68
             // ====================  DATA MEMBERS  =========================
76
             // ====================  DATA MEMBERS  =========================
69
 
77
 
70
     }; // -----  end of class  GridReader  -----
78
     }; // -----  end of class  GridReader  -----

+ 5
- 0
LemmaCore/include/Instrument.h View File

41
 
41
 
42
 			// ====================  INQUIRY       ===========================
42
 			// ====================  INQUIRY       ===========================
43
 
43
 
44
+            /** Returns the name of the underlying class, similiar to Python's type */
45
+            virtual inline std::string GetName() const {
46
+                return this->CName;
47
+            }
48
+
44
 			// ====================  DATA MEMBERS  ===========================
49
 			// ====================  DATA MEMBERS  ===========================
45
 
50
 
46
 		protected:
51
 		protected:

+ 5
- 0
LemmaCore/include/LayeredEarth.h View File

85
             YAML::Node Serialize() const;
85
             YAML::Node Serialize() const;
86
             //static LayeredEarth* DeSerialize(const YAML::Node& node);
86
             //static LayeredEarth* DeSerialize(const YAML::Node& node);
87
 
87
 
88
+            /** Returns the name of the underlying class, similiar to Python's type */
89
+            virtual inline std::string GetName() const {
90
+                return this->CName;
91
+            }
92
+
88
 		protected:
93
 		protected:
89
 
94
 
90
 			// ====================  LIFECYCLE     ===========================
95
 			// ====================  LIFECYCLE     ===========================

+ 1
- 1
LemmaCore/include/LemmaCore View File

30
 #include "RectilinearGridReader.h"
30
 #include "RectilinearGridReader.h"
31
 #include "RectilinearGridVTKExporter.h"
31
 #include "RectilinearGridVTKExporter.h"
32
 #include "WindowFilter.h"
32
 #include "WindowFilter.h"
33
+// helpers and utilities
33
 #include "banner.h"
34
 #include "banner.h"
34
 #include "helper.h"
35
 #include "helper.h"
35
 #include "timer.h"
36
 #include "timer.h"
36
-
37
 #endif   // ----- #ifndef LEMMAINCLUDE_INC  -----
37
 #endif   // ----- #ifndef LEMMAINCLUDE_INC  -----
38
 
38
 
39
 /* vim: set tabstop=4 expandtab: */
39
 /* vim: set tabstop=4 expandtab: */

+ 5
- 0
LemmaCore/include/RectilinearGrid.h View File

141
 
141
 
142
             // ====================  INQUIRY       =======================
142
             // ====================  INQUIRY       =======================
143
 
143
 
144
+            /** Returns the name of the underlying class, similiar to Python's type */
145
+            virtual inline std::string GetName() const {
146
+                return this->CName;
147
+            }
148
+
144
         protected:
149
         protected:
145
 
150
 
146
             // ====================  LIFECYCLE     =======================
151
             // ====================  LIFECYCLE     =======================

+ 5
- 0
LemmaCore/include/RectilinearGridReader.h View File

73
 
73
 
74
             // ====================  INQUIRY       =======================
74
             // ====================  INQUIRY       =======================
75
 
75
 
76
+            /** Returns the name of the underlying class, similiar to Python's type */
77
+            virtual inline std::string GetName() const {
78
+                return this->CName;
79
+            }
80
+
76
         protected:
81
         protected:
77
 
82
 
78
             // ====================  LIFECYCLE     =======================
83
             // ====================  LIFECYCLE     =======================

+ 6
- 1
LemmaCore/include/RectilinearGridVTKExporter.h View File

83
      */
83
      */
84
     void WriteVTKGrid( const std::string& name );
84
     void WriteVTKGrid( const std::string& name );
85
 
85
 
86
+    /** Returns the name of the underlying class, similiar to Python's type */
87
+    virtual inline std::string GetName() const {
88
+        return this->CName;
89
+    }
90
+
86
     protected:
91
     protected:
87
 
92
 
88
     // ====================  LIFECYCLE     =======================
93
     // ====================  LIFECYCLE     =======================
96
     private:
101
     private:
97
 
102
 
98
     /** ASCII string representation of the class name */
103
     /** ASCII string representation of the class name */
99
-    static constexpr auto CName = "VTKRectilinearGridVTKExporter";
104
+    static constexpr auto CName = "RectilinearGridVTKExporter";
100
 
105
 
101
     void BuildVTKRectilinearGrid();
106
     void BuildVTKRectilinearGrid();
102
 
107
 

+ 5
- 0
LemmaCore/include/WindowFilter.h View File

76
             /// Returns a Vector of the filter coefficients.
76
             /// Returns a Vector of the filter coefficients.
77
             VectorXr GetFilterCoefficients( );
77
             VectorXr GetFilterCoefficients( );
78
 
78
 
79
+            /** Returns the name of the underlying class, similiar to Python's type */
80
+            virtual inline std::string GetName() const {
81
+                return this->CName;
82
+            }
83
+
79
         protected:
84
         protected:
80
 
85
 
81
             // ====================  LIFECYCLE     =======================
86
             // ====================  LIFECYCLE     =======================

+ 11
- 4
LemmaCore/testing/CMakeLists.txt View File

1
-add_executable(testOne testOne.cpp)
2
-add_executable(testTwo testTwo.cpp)
3
-add_test( testLemmaCoreOne testOne )
4
-add_test( testLemmaCoreTwo testTwo )
1
+#add_executable(testOne testOne.cpp)
2
+#add_executable(testTwo testTwo.cpp)
3
+#add_test( testLemmaCoreOne testOne )
4
+#add_test( testLemmaCoreTwo testTwo )
5
+
6
+CXXTEST_ADD_TEST(unittest_GetNameCheck GetNameCheck.cc ${CMAKE_CURRENT_SOURCE_DIR}/GetNameCheck.h)
7
+target_link_libraries(unittest_GetNameCheck "lemmacore")
8
+
9
+CXXTEST_ADD_TEST(unittest_SerializeCheck SerializeCheck.cc ${CMAKE_CURRENT_SOURCE_DIR}/SerializeCheck.h)
10
+target_link_libraries(unittest_SerializeCheck "lemmacore")
11
+ 

+ 1
- 1
src/myTestSuite.h View File

26
     void testAddition( void )
26
     void testAddition( void )
27
     {
27
     {
28
         TS_ASSERT( 1 + 1 > 1 );
28
         TS_ASSERT( 1 + 1 > 1 );
29
-        TS_ASSERT( 1 - 1 > 1 );
29
+        TS_ASSERT( 3 - 1 > 1 );
30
         TS_ASSERT_EQUALS( 1 + 1, 2 );
30
         TS_ASSERT_EQUALS( 1 + 1, 2 );
31
     }
31
     }
32
 };
32
 };

Loading…
Cancel
Save