Trevor Irons 8 лет назад
Родитель
Сommit
02571dcce4
4 измененных файлов: 61 добавлений и 11 удалений
  1. 8
    0
      CMakeLists.txt
  2. 13
    11
      include/DEMParticle.h
  3. 3
    0
      testing/CMakeLists.txt
  4. 37
    0
      testing/GetNameCheck.h

+ 8
- 0
CMakeLists.txt Просмотреть файл

@@ -1,4 +1,5 @@
1 1
 if (LEMMA_VTK6_SUPPORT OR LEMMA_VTK7_SUPPORT)
2
+	
2 3
 	include_directories(${CMAKE_INSTALL_PREFIX}/include)
3 4
 
4 5
 	include_directories( "${CMAKE_CURRENT_SOURCE_DIR}/include" )
@@ -12,6 +13,13 @@ if (LEMMA_VTK6_SUPPORT OR LEMMA_VTK7_SUPPORT)
12 13
 	if (LEMMA_BUILD_EXAMPLES)
13 14
 		add_subdirectory(examples)
14 15
 	endif()
16
+	
17
+	if (LEMMA_ENABLE_TESTING)
18
+		add_subdirectory(testing)
19
+	endif()
20
+
21
+	install ( TARGETS dem4core DESTINATION ${CMAKE_INSTALL_PREFIX}/lib )
22
+
15 23
 else()
16 24
 	message( STATUS "DEM requires Lemma to be build with VTK" )
17 25
 endif()

+ 13
- 11
include/DEMParticle.h Просмотреть файл

@@ -43,6 +43,17 @@ namespace Lemma {
43 43
          */
44 44
         static std::shared_ptr< DEMParticle > NewSP();
45 45
 
46
+        /**
47
+         *  Uses YAML to serialize this object.
48
+         *  @return a YAML::Node
49
+         */
50
+        YAML::Node Serialize() const;
51
+
52
+        /**
53
+         *   Constructs an object from a YAML::Node.
54
+         */
55
+        static std::shared_ptr< DEMParticle > DeSerialize(const YAML::Node& node);
56
+
46 57
         // ====================  OPERATORS     =======================
47 58
 
48 59
         // ====================  OPERATIONS    =======================
@@ -59,17 +70,6 @@ namespace Lemma {
59 70
             return this->CName;
60 71
         }
61 72
 
62
-        /**
63
-         *  Uses YAML to serialize this object.
64
-         *  @return a YAML::Node
65
-         */
66
-        YAML::Node Serialize() const;
67
-
68
-        /**
69
-         *   Constructs an object from a YAML::Node.
70
-         */
71
-        static std::shared_ptr< DEMParticle > DeSerialize(const YAML::Node& node);
72
-
73 73
         protected:
74 74
 
75 75
         // ====================  LIFECYCLE     =======================
@@ -99,3 +99,5 @@ namespace Lemma {
99 99
 
100 100
 #endif   // ----- #ifndef DEMPARTICLE_INC  -----
101 101
 
102
+/* vim: set tabstop=4 expandtab: */
103
+/* vim: set filetype=cpp: */

+ 3
- 0
testing/CMakeLists.txt Просмотреть файл

@@ -0,0 +1,3 @@
1
+
2
+CXXTEST_ADD_TEST(unittestDEM_GetNameCheck GetNameCheck.cc ${CMAKE_CURRENT_SOURCE_DIR}/GetNameCheck.h)
3
+target_link_libraries(unittestDEM_GetNameCheck "lemmacore" "dem4core")

+ 37
- 0
testing/GetNameCheck.h Просмотреть файл

@@ -0,0 +1,37 @@
1
+/* This file is part of Lemma, a geophysical modelling and inversion API.
2
+ * More information is available at http://lemmasoftware.org
3
+ */
4
+
5
+/* This Source Code Form is subject to the terms of the Mozilla Public
6
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
7
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
8
+ */
9
+
10
+/**
11
+ * @file
12
+ * @date      06/23/2016 01:26:46 PM
13
+ * @version   $Id$
14
+ * @author    Trevor Irons (ti)
15
+ * @email     tirons@egi.utah.edu
16
+ * @copyright Copyright (c) 2016, University of Utah
17
+ * @copyright Copyright (c) 2016, Lemma Software, LLC
18
+ */
19
+
20
+#include <cxxtest/TestSuite.h>
21
+#include <LemmaCore>
22
+#include <DEM4Core>
23
+
24
+using namespace Lemma;
25
+
26
+class MyTestSuite : public CxxTest::TestSuite
27
+{
28
+    public:
29
+
30
+    void testDEMParticle( void )
31
+    {
32
+        auto Obj = DEMParticle::NewSP();
33
+        TS_ASSERT_EQUALS( Obj->GetName(), std::string("DEMParticle") );
34
+    }
35
+
36
+};
37
+

Загрузка…
Отмена
Сохранить