changeset 1881:a05529952510

fix build of unit tests in SDL project
author Sebastien Jodogne <s.jodogne@gmail.com>
date Wed, 12 Jan 2022 10:01:25 +0100
parents 93c3f9234286
children 4e80b8afd0da
files Applications/Platforms/WebAssembly/UnitTests/CMakeLists.txt Applications/Samples/Sdl/CMakeLists.txt OrthancStone/UnitTestsSources/CMakeLists.txt OrthancStone/UnitTestsSources/TestStructureSet.cpp OrthancStone/UnitTestsSources/UnitTestsSources.cmake
diffstat 5 files changed, 16 insertions(+), 10 deletions(-) [+]
line wrap: on
line diff
--- a/Applications/Platforms/WebAssembly/UnitTests/CMakeLists.txt	Wed Jan 12 09:47:36 2022 +0100
+++ b/Applications/Platforms/WebAssembly/UnitTests/CMakeLists.txt	Wed Jan 12 10:01:25 2022 +0100
@@ -77,6 +77,11 @@
 
 
 include(${CMAKE_SOURCE_DIR}/../../../../OrthancStone/UnitTestsSources/UnitTestsSources.cmake)
+
+EmbedResources(
+  RT_STRUCT_00 ${CMAKE_SOURCE_DIR}/../../../../OrthancStone/UnitTestsSources/TestStructureSet.json
+  )
+
 add_executable(UnitTests
   # Testing Stone
   ${UNIT_TESTS_SOURCES}
--- a/Applications/Samples/Sdl/CMakeLists.txt	Wed Jan 12 09:47:36 2022 +0100
+++ b/Applications/Samples/Sdl/CMakeLists.txt	Wed Jan 12 10:01:25 2022 +0100
@@ -66,6 +66,7 @@
 EmbedResources(
   COLORMAP_HOT ${CMAKE_SOURCE_DIR}/../../Resources/Colormaps/hot.lut
   UBUNTU_FONT  ${CMAKE_BINARY_DIR}/ubuntu-font-family-0.83/Ubuntu-R.ttf
+  RT_STRUCT_00 ${CMAKE_SOURCE_DIR}/../../../OrthancStone/UnitTestsSources/TestStructureSet.json
   )
 
 SortFilesInSourceGroups()
--- a/OrthancStone/UnitTestsSources/CMakeLists.txt	Wed Jan 12 09:47:36 2022 +0100
+++ b/OrthancStone/UnitTestsSources/CMakeLists.txt	Wed Jan 12 10:01:25 2022 +0100
@@ -47,6 +47,10 @@
 include(${ORTHANC_STONE_ROOT}/../Resources/CMake/OrthancStoneConfiguration.cmake)
 include(${CMAKE_CURRENT_SOURCE_DIR}/UnitTestsSources.cmake)
 
+EmbedResources(
+  RT_STRUCT_00 ${CMAKE_CURRENT_SOURCE_DIR}/TestStructureSet.json
+  )
+
 add_executable(UnitTests
   ${UNIT_TESTS_SOURCES}
   ${AUTOGENERATED_SOURCES}
--- a/OrthancStone/UnitTestsSources/TestStructureSet.cpp	Wed Jan 12 09:47:36 2022 +0100
+++ b/OrthancStone/UnitTestsSources/TestStructureSet.cpp	Wed Jan 12 10:01:25 2022 +0100
@@ -126,7 +126,7 @@
   */
 
   // (0x3006, 0x0080) seq. size
-  EXPECT_EQ(7, structures.size());
+  EXPECT_EQ(7u, structures.size());
 
   // (0x3006, 0x0080)[i]/(0x3006, 0x00a4)
   for (size_t i = 0; i < 5; ++i)
@@ -286,7 +286,7 @@
 {
   // see https://www.dropbox.com/s/1o1vg53hsbvx4cc/test-rtstruct-polygons.jpg?dl=0
   EXPECT_EQ(pointsCoord1Count, pointsCoord2Count);
-  EXPECT_EQ(11, pointsCoord2Count);
+  EXPECT_EQ(11u, pointsCoord2Count);
 
   for (size_t slice = 0; slice < 3; ++slice)
   {
@@ -383,7 +383,7 @@
   bool ok = structure.Project(segments, cuttingPlane);
   EXPECT_TRUE(ok);
 
-  EXPECT_EQ(11, segments.size());
+  EXPECT_EQ(11u, segments.size());
   for (size_t i = 0; i < segments.size(); ++i)
   {
     EXPECT_LT(i, pointsCoord1Count);
@@ -471,7 +471,7 @@
 
   // compute intersection
   ASSERT_TRUE(structure.Project(segments, cuttingPlane));
-  EXPECT_EQ(24, segments.size());
+  EXPECT_EQ(24u, segments.size());
 
   size_t numberOfVeryShortSegments = 0;
   for (size_t iSegment = 0; iSegment < segments.size(); ++iSegment)
@@ -485,7 +485,7 @@
       }
     }
   }
-  EXPECT_EQ(8, numberOfVeryShortSegments);
+  EXPECT_EQ(8u, numberOfVeryShortSegments);
 }
 
 #endif 
@@ -1179,7 +1179,7 @@
   structureSet.FillStructuresFromDataset(dicom);
   structureSet.ComputeDependentProperties();
 
-  const std::vector<DicomStructure2>& structures = structureSet.structures_;
+  //const std::vector<DicomStructure2>& structures = structureSet.structures_;
 }
 
 #endif 
--- a/OrthancStone/UnitTestsSources/UnitTestsSources.cmake	Wed Jan 12 09:47:36 2022 +0100
+++ b/OrthancStone/UnitTestsSources/UnitTestsSources.cmake	Wed Jan 12 10:01:25 2022 +0100
@@ -34,10 +34,6 @@
   ${CMAKE_CURRENT_LIST_DIR}/VolumeRenderingTests.cpp
   )
 
-EmbedResources(
-  RT_STRUCT_00 ${CMAKE_CURRENT_LIST_DIR}/TestStructureSet.json
-  )
-
 add_definitions(
   -DBGO_ENABLE_DICOMSTRUCTURESETLOADER2=1
   )