changeset 1581:e04c8fec263e

remove OrthancStone/UnitTestsSources/TestCommands.cpp
author Sebastien Jodogne <s.jodogne@gmail.com>
date Fri, 16 Oct 2020 17:27:01 +0200
parents c6b29bf58914
children cdd1932c530c
files Applications/Resources/RunCppCheck.sh Applications/Samples/Sdl/CMakeLists.txt OrthancStone/Resources/OrthancStone.doxygen OrthancStone/Resources/RunCppCheck.sh OrthancStone/UnitTestsSources/CMakeLists.txt OrthancStone/UnitTestsSources/TestCommands.cpp
diffstat 6 files changed, 62 insertions(+), 174 deletions(-) [+]
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Applications/Resources/RunCppCheck.sh	Fri Oct 16 17:27:01 2020 +0200
@@ -0,0 +1,60 @@
+#!/bin/bash
+
+set -ex
+
+CPPCHECK=cppcheck
+
+if [ $# -ge 1 ]; then
+    CPPCHECK=$1
+fi
+
+cat <<EOF > /tmp/cppcheck-suppressions.txt
+stlFindInsert:../../Applications/Samples/WebAssembly/SingleFrameViewer/SingleFrameViewerApplication.h
+stlFindInsert:../../Applications/StoneWebViewer/WebAssembly/StoneWebViewer.cpp:658
+unpreciseMathCall:../../OrthancStone/Sources/Scene2D/Internals/CairoFloatTextureRenderer.cpp
+unpreciseMathCall:../../OrthancStone/Sources/Scene2D/LookupTableTextureSceneLayer.cpp
+unreadVariable:../../OrthancStone/Sources/Viewport/SdlViewport.cpp:135
+unreadVariable:../../OrthancStone/Sources/Viewport/SdlViewport.cpp:193
+unusedFunction
+useInitializationList:../../OrthancStone/Sources/OpenGL/OpenGLProgram.cpp:36
+EOF
+
+${CPPCHECK} --enable=all --quiet --std=c++11 \
+            --suppressions-list=/tmp/cppcheck-suppressions.txt \
+            -DHAS_ORTHANC_EXCEPTION=1 \
+            -DORTHANC_BUILDING_FRAMEWORK_LIBRARY=1 \
+            -DORTHANC_ENABLE_BASE64=1 \
+            -DORTHANC_ENABLE_CIVETWEB=0 \
+            -DORTHANC_ENABLE_CURL=1 \
+            -DORTHANC_ENABLE_DCMTK=1 \
+            -DORTHANC_ENABLE_DCMTK_JPEG=1 \
+            -DORTHANC_ENABLE_DCMTK_JPEG_LOSSLESS=1 \
+            -DORTHANC_ENABLE_GLEW=1 \
+            -DORTHANC_ENABLE_JPEG=1 \
+            -DORTHANC_ENABLE_LOCALE=1 \
+            -DORTHANC_ENABLE_LOGGING=1 \
+            -DORTHANC_ENABLE_LOGGING_STDIO=1 \
+            -DORTHANC_ENABLE_MD5=1 \
+            -DORTHANC_ENABLE_MONGOOSE=0 \
+            -DORTHANC_ENABLE_OPENGL=1 \
+            -DORTHANC_ENABLE_PKCS11=0 \
+            -DORTHANC_ENABLE_PNG=1 \
+            -DORTHANC_ENABLE_PUGIXML=0 \
+            -DORTHANC_ENABLE_SDL=1 \
+            -DORTHANC_ENABLE_SSL=1 \
+            -DORTHANC_ENABLE_THREADS=1 \
+            -DORTHANC_ENABLE_WASM=1 \
+            -DORTHANC_ENABLE_ZLIB=1 \
+            -DORTHANC_SANDBOXED=0 \
+            -D__GNUC__ \
+            -D__cplusplus=201103 \
+            -D__linux__ \
+            -DEM_ASM \
+            -UNDEBUG \
+            -I/home/jodogne/Subversion/orthanc/OrthancFramework/Sources \
+            \
+            ../../OrthancStone/Sources \
+            ../../Applications/Samples \
+            ../../Applications/StoneWebViewer \
+            \
+            2>&1
--- a/Applications/Samples/Sdl/CMakeLists.txt	Thu Oct 01 18:48:15 2020 +0200
+++ b/Applications/Samples/Sdl/CMakeLists.txt	Fri Oct 16 17:27:01 2020 +0200
@@ -90,7 +90,6 @@
   ${ORTHANC_STONE_ROOT}/UnitTestsSources/GenericToolboxTests.cpp
   ${ORTHANC_STONE_ROOT}/UnitTestsSources/ImageToolboxTests.cpp
   ${ORTHANC_STONE_ROOT}/UnitTestsSources/PixelTestPatternsTests.cpp
-  ${ORTHANC_STONE_ROOT}/UnitTestsSources/TestCommands.cpp
   ${ORTHANC_STONE_ROOT}/UnitTestsSources/TestMessageBroker.cpp
   ${ORTHANC_STONE_ROOT}/UnitTestsSources/TestStrategy.cpp
   ${ORTHANC_STONE_ROOT}/UnitTestsSources/TestStructureSet.cpp
--- a/OrthancStone/Resources/OrthancStone.doxygen	Thu Oct 01 18:48:15 2020 +0200
+++ b/OrthancStone/Resources/OrthancStone.doxygen	Fri Oct 16 17:27:01 2020 +0200
@@ -655,8 +655,7 @@
 # directories like "/usr/src/myproject". Separate the files or directories
 # with spaces.
 
-INPUT                  = @ORTHANC_STONE_ROOT@/Applications \
-                         @ORTHANC_STONE_ROOT@/Framework \
+INPUT                  = @ORTHANC_STONE_ROOT@/Framework \
                          @ORTHANC_STONE_ROOT@/Platforms
 
 # This tag can be used to specify the character encoding of the source files
@@ -689,8 +688,7 @@
 # Note that relative paths are relative to the directory from which doxygen is
 # run.
 
-EXCLUDE                = @ORTHANC_STONE_ROOT@/Framework/Orthanc/Resources/ \
-                         @ORTHANC_STONE_ROOT@/Applications/Samples/build-wasm/
+EXCLUDE                = @ORTHANC_STONE_ROOT@/Framework/Orthanc/Resources/
 
 # The EXCLUDE_SYMLINKS tag can be used to select whether or not files or
 # directories that are symbolic links (a Unix file system feature) are excluded
--- a/OrthancStone/Resources/RunCppCheck.sh	Thu Oct 01 18:48:15 2020 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,60 +0,0 @@
-#!/bin/bash
-
-set -ex
-
-CPPCHECK=cppcheck
-
-if [ $# -ge 1 ]; then
-    CPPCHECK=$1
-fi
-
-cat <<EOF > /tmp/cppcheck-suppressions.txt
-stlFindInsert:../../Applications/Samples/WebAssembly/SingleFrameViewer/SingleFrameViewerApplication.h
-stlFindInsert:../../Applications/StoneWebViewer/WebAssembly/StoneWebViewer.cpp:658
-unpreciseMathCall:../../OrthancStone/Sources/Scene2D/Internals/CairoFloatTextureRenderer.cpp
-unpreciseMathCall:../../OrthancStone/Sources/Scene2D/LookupTableTextureSceneLayer.cpp
-unreadVariable:../../OrthancStone/Sources/Viewport/SdlViewport.cpp:135
-unreadVariable:../../OrthancStone/Sources/Viewport/SdlViewport.cpp:193
-unusedFunction
-useInitializationList:../../OrthancStone/Sources/OpenGL/OpenGLProgram.cpp:36
-EOF
-
-${CPPCHECK} --enable=all --quiet --std=c++11 \
-            --suppressions-list=/tmp/cppcheck-suppressions.txt \
-            -DHAS_ORTHANC_EXCEPTION=1 \
-            -DORTHANC_BUILDING_FRAMEWORK_LIBRARY=1 \
-            -DORTHANC_ENABLE_BASE64=1 \
-            -DORTHANC_ENABLE_CIVETWEB=0 \
-            -DORTHANC_ENABLE_CURL=1 \
-            -DORTHANC_ENABLE_DCMTK=1 \
-            -DORTHANC_ENABLE_DCMTK_JPEG=1 \
-            -DORTHANC_ENABLE_DCMTK_JPEG_LOSSLESS=1 \
-            -DORTHANC_ENABLE_GLEW=1 \
-            -DORTHANC_ENABLE_JPEG=1 \
-            -DORTHANC_ENABLE_LOCALE=1 \
-            -DORTHANC_ENABLE_LOGGING=1 \
-            -DORTHANC_ENABLE_LOGGING_STDIO=1 \
-            -DORTHANC_ENABLE_MD5=1 \
-            -DORTHANC_ENABLE_MONGOOSE=0 \
-            -DORTHANC_ENABLE_OPENGL=1 \
-            -DORTHANC_ENABLE_PKCS11=0 \
-            -DORTHANC_ENABLE_PNG=1 \
-            -DORTHANC_ENABLE_PUGIXML=0 \
-            -DORTHANC_ENABLE_SDL=1 \
-            -DORTHANC_ENABLE_SSL=1 \
-            -DORTHANC_ENABLE_THREADS=1 \
-            -DORTHANC_ENABLE_WASM=1 \
-            -DORTHANC_ENABLE_ZLIB=1 \
-            -DORTHANC_SANDBOXED=0 \
-            -D__GNUC__ \
-            -D__cplusplus=201103 \
-            -D__linux__ \
-            -DEM_ASM \
-            -UNDEBUG \
-            -I/home/jodogne/Subversion/orthanc/OrthancFramework/Sources \
-            \
-            ../../OrthancStone/Sources \
-            ../../Applications/Samples \
-            ../../Applications/StoneWebViewer \
-            \
-            2>&1
--- a/OrthancStone/UnitTestsSources/CMakeLists.txt	Thu Oct 01 18:48:15 2020 +0200
+++ b/OrthancStone/UnitTestsSources/CMakeLists.txt	Fri Oct 16 17:27:01 2020 +0200
@@ -29,7 +29,6 @@
   ${ORTHANC_STONE_ROOT}/UnitTestsSources/ImageToolboxTests.cpp
   ${ORTHANC_STONE_ROOT}/UnitTestsSources/PixelTestPatternsTests.cpp
   ${ORTHANC_STONE_ROOT}/UnitTestsSources/SortedFramesTests.cpp
-  ${ORTHANC_STONE_ROOT}/UnitTestsSources/TestCommands.cpp
   ${ORTHANC_STONE_ROOT}/UnitTestsSources/TestMessageBroker.cpp
   ${ORTHANC_STONE_ROOT}/UnitTestsSources/TestStrategy.cpp
   ${ORTHANC_STONE_ROOT}/UnitTestsSources/TestStructureSet.cpp
--- a/OrthancStone/UnitTestsSources/TestCommands.cpp	Thu Oct 01 18:48:15 2020 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,108 +0,0 @@
-/**
- * Stone of Orthanc
- * Copyright (C) 2012-2016 Sebastien Jodogne, Medical Physics
- * Department, University Hospital of Liege, Belgium
- * Copyright (C) 2017-2020 Osimis S.A., Belgium
- *
- * This program is free software: you can redistribute it and/or
- * modify it under the terms of the GNU Affero General Public License
- * as published by the Free Software Foundation, either version 3 of
- * the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Affero General Public License for more details.
- *
- * You should have received a copy of the GNU Affero General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- **/
-
-
-#include <gtest/gtest.h>
-
-//#include "../Applications/Commands/BaseCommandFactory.h"
-//#include "OrthancException.h"
-
-//class CommandIncrement: public OrthancStone::BaseCommand<CommandIncrement>
-//{
-//public:
-//  static int counter;
-//  int increment_;
-//public:
-//  CommandIncrement()
-//    : OrthancStone::BaseCommand<CommandIncrement>("increment"),
-//      increment_(0)
-//  {}
-
-//  virtual void Execute()
-//  {
-//    counter += increment_;
-//  }
-//  virtual void Configure(const Json::Value& arguments)
-//  {
-//    increment_ = arguments["increment"].asInt();
-//  }
-//};
-
-//// COMMAND("name", "arg1", "int", "arg2", "string")
-//// COMMAND(name, arg1, arg2)
-
-
-//int CommandIncrement::counter = 0;
-
-//TEST(Commands, CreateNoop)
-//{
-//  OrthancStone::BaseCommandFactory factory;
-
-//  factory.RegisterCommandClass<OrthancStone::NoopCommand>();
-
-//  Json::Value cmdJson;
-//  cmdJson["command"] = "noop";
-
-//  std::unique_ptr<OrthancStone::ICommand> command(factory.CreateFromJson(cmdJson));
-
-//  ASSERT_TRUE(command.get() != NULL);
-//  ASSERT_EQ("noop", command->GetName());
-//}
-
-//TEST(Commands, Execute)
-//{
-//  OrthancStone::BaseCommandFactory factory;
-
-//  factory.RegisterCommandClass<OrthancStone::NoopCommand>();
-//  factory.RegisterCommandClass<CommandIncrement>();
-
-//  Json::Value cmdJson;
-//  cmdJson["command"] = "increment";
-//  cmdJson["args"]["increment"] = 2;
-
-//  std::unique_ptr<OrthancStone::ICommand> command(factory.CreateFromJson(cmdJson));
-
-//  ASSERT_TRUE(command.get() != NULL);
-//  CommandIncrement::counter = 0;
-//  command->Execute();
-//  ASSERT_EQ(2, CommandIncrement::counter);
-//}
-
-//TEST(Commands, TryCreateUnknowCommand)
-//{
-//  OrthancStone::BaseCommandFactory factory;
-//  factory.RegisterCommandClass<OrthancStone::NoopCommand>();
-
-//  Json::Value cmdJson;
-//  cmdJson["command"] = "unknown";
-
-//  ASSERT_THROW(std::unique_ptr<OrthancStone::ICommand> command(factory.CreateFromJson(cmdJson)), Orthanc::OrthancException);
-//}
-
-//TEST(Commands, TryCreateCommandFromInvalidJson)
-//{
-//  OrthancStone::BaseCommandFactory factory;
-//  factory.RegisterCommandClass<OrthancStone::NoopCommand>();
-
-//  Json::Value cmdJson;
-//  cmdJson["command-name"] = "noop";
-
-//  ASSERT_THROW(std::unique_ptr<OrthancStone::ICommand> command(factory.CreateFromJson(cmdJson)), Orthanc::OrthancException);
-//}