changeset 1403:5630c2fb7b0f

cleanup + reactivate UnitTests
author Alain Mazy <alain@mazy.be>
date Wed, 29 Apr 2020 21:10:49 +0200
parents 65e1e4b08302
children e4fe346c021e
files .hgignore Resources/CMake/OrthancStoneConfiguration.cmake UnitTestsSources/CMakeLists.txt UnitTestsSources/GenericToolboxTests.cpp UnitTestsSources/UnitTestsMain.cpp
diffstat 5 files changed, 8 insertions(+), 30 deletions(-) [+]
line wrap: on
line diff
--- a/.hgignore	Wed Apr 29 20:50:53 2020 +0200
+++ b/.hgignore	Wed Apr 29 21:10:49 2020 +0200
@@ -4,19 +4,8 @@
 *.h.orig
 .vs/
 .vscode/
-Applications/Qt/archive/
-Applications/Samples/Deprecated/ThirdPartyDownloads/
-Applications/Samples/Deprecated/build-wasm/
-Applications/Samples/Deprecated/build-web/
-Applications/Samples/Deprecated/node_modules/
-Applications/Samples/Deprecated/rt-viewer-demo/ThirdPartyDownloads/
-Applications/Samples/Deprecated/rt-viewer-demo/build-sdl-msvc15/
-Applications/Samples/Deprecated/rt-viewer-demo/build-tsc-output/
-Applications/Samples/Deprecated/rt-viewer-demo/build-wasm/
-Applications/Samples/Deprecated/rt-viewer-demo/build-web/
-Applications/build-*
+build*/
 CMakeLists.txt.user
-Platforms/Generic/ThirdPartyDownloads/
 Resources/CodeGeneration/.env
 Resources/CodeGeneration/.idea
 Resources/CodeGeneration/__pycache__
@@ -42,6 +31,6 @@
 Samples/Deprecated/WebAssembly/build/
 Samples/Deprecated/WebAssembly/ThirdPartyDownloads/
 Samples/Deprecated/WebAssembly/installDir/
-
+UnitTestsSources/ThirdPartyDownloads/
 node_modules/
 
--- a/Resources/CMake/OrthancStoneConfiguration.cmake	Wed Apr 29 20:50:53 2020 +0200
+++ b/Resources/CMake/OrthancStoneConfiguration.cmake	Wed Apr 29 21:10:49 2020 +0200
@@ -288,8 +288,6 @@
 endif()
 
 list(APPEND ORTHANC_STONE_SOURCES
-  #${ORTHANC_STONE_ROOT}/Framework/Layers/SeriesFrameRendererFactory.cpp
-  #${ORTHANC_STONE_ROOT}/Framework/Layers/SingleFrameRendererFactory.cpp
 
   ${ORTHANC_ROOT}/Plugins/Samples/Common/DicomDatasetReader.cpp
   ${ORTHANC_ROOT}/Plugins/Samples/Common/DicomPath.cpp
--- a/UnitTestsSources/CMakeLists.txt	Wed Apr 29 20:50:53 2020 +0200
+++ b/UnitTestsSources/CMakeLists.txt	Wed Apr 29 21:10:49 2020 +0200
@@ -1,6 +1,10 @@
 cmake_minimum_required(VERSION 2.8.3)
 project(OrthancStone)
 
+set(ORTHANC_FRAMEWORK_SOURCE "path")
+set(ORTHANC_FRAMEWORK_ROOT ${CMAKE_CURRENT_LIST_DIR}/../../orthanc)
+set(STONE_ROOT ${CMAKE_CURRENT_LIST_DIR}/../)
+
 include(../Resources/CMake/OrthancStoneParameters.cmake)
 
 set(ENABLE_STONE_DEPRECATED ON)  # Need deprecated classes for these samples
@@ -11,7 +15,7 @@
 
 set(ENABLE_SDL OFF CACHE BOOL "Target SDL Native application")
 set(ENABLE_WASM OFF CACHE BOOL "Target WASM application")
-set(ENABLE_UNITTESTS ON 
+set(ENABLE_UNITTESTS ON BOOL "Enable unit tests")
 
 
 if (ENABLE_WASM)
--- a/UnitTestsSources/GenericToolboxTests.cpp	Wed Apr 29 20:50:53 2020 +0200
+++ b/UnitTestsSources/GenericToolboxTests.cpp	Wed Apr 29 21:10:49 2020 +0200
@@ -3846,7 +3846,7 @@
   }
 }
 
-static const size_t NUM_TIMINGS_CONVS = 2000;
+static const size_t NUM_TIMINGS_CONVS = 1; // set to 2000 if you want to measure perfs;
 
 
 //4444444444444444$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$
--- a/UnitTestsSources/UnitTestsMain.cpp	Wed Apr 29 20:50:53 2020 +0200
+++ b/UnitTestsSources/UnitTestsMain.cpp	Wed Apr 29 21:10:49 2020 +0200
@@ -21,15 +21,10 @@
 
 #include "gtest/gtest.h"
 
-#include "../Framework/Deprecated/Layers/FrameRenderer.h"
-#include "../Framework/Deprecated/Toolbox/DownloadStack.h"
-#include "../Framework/Deprecated/Toolbox/MessagingToolbox.h"
-#include "../Framework/Deprecated/Toolbox/OrthancSlicesLoader.h"
 #include "../Framework/StoneInitialization.h"
 #include "../Framework/Toolbox/FiniteProjectiveCamera.h"
 #include "../Framework/Toolbox/GeometryToolbox.h"
 #include "../Framework/Volumes/ImageBuffer3D.h"
-#include "../Platforms/Generic/OracleWebService.h"
 
 #include <Core/HttpClient.h>
 #include <Core/Images/ImageProcessing.h>
@@ -633,14 +628,6 @@
   */
 }
 
-TEST(MessagingToolbox, ParseJson)
-{
-  Json::Value response;
-  std::string source = "{\"command\":\"panel:takeDarkImage\",\"commandType\":\"simple\",\"args\":{}}";
-  ASSERT_TRUE(Deprecated::MessagingToolbox::ParseJson(response, source.c_str(), source.size()));
-}
-
-
 
 static bool IsEqualVectorL1(OrthancStone::Vector a,
                             OrthancStone::Vector b)