From a2812cbbc17eb09284f698bf2478501b566001c5 Mon Sep 17 00:00:00 2001 From: Aurelien Bricier <aurelien.bricier@c-s.fr> Date: Mon, 16 May 2011 18:06:11 +0200 Subject: [PATCH] TEST: added test on StandardDSCostFunction --- Testing/Code/Fuzzy/CMakeLists.txt | 3 ++ Testing/Code/Fuzzy/otbFuzzyTests2.cxx | 1 + .../Code/Fuzzy/otbStandardDSCostFunction.cxx | 39 +++++++++++++++++++ 3 files changed, 43 insertions(+) create mode 100644 Testing/Code/Fuzzy/otbStandardDSCostFunction.cxx diff --git a/Testing/Code/Fuzzy/CMakeLists.txt b/Testing/Code/Fuzzy/CMakeLists.txt index 8d438a90d9..e9ee389fc0 100644 --- a/Testing/Code/Fuzzy/CMakeLists.txt +++ b/Testing/Code/Fuzzy/CMakeLists.txt @@ -124,6 +124,8 @@ ADD_TEST(fzTvFuzzyDescriptorsModelManagerTest ${Fuzzy_TESTS2} ${TEMP}/fzTvFuzzyDescriptorsModelManager.xml ) +ADD_TEST(fzTuStandardDSCostFunctionNew ${Fuzzy_TESTS2} + otbStandardDSCostFunctionNew) SET(BasicFuzzy_SRCS1 @@ -144,6 +146,7 @@ otbVectorDataToDSValidatedVectorDataFilter.cxx otbVectorDataToSpecificDescriptionFilterBase.cxx otbVectorDataToRoadDescriptionFilter.cxx otbFuzzyDescriptorsModelManager.cxx +otbStandardDSCostFunction.cxx ) ADD_EXECUTABLE(otbFuzzyTests1 otbFuzzyTests1.cxx ${BasicFuzzy_SRCS1}) diff --git a/Testing/Code/Fuzzy/otbFuzzyTests2.cxx b/Testing/Code/Fuzzy/otbFuzzyTests2.cxx index 6f257b81a6..e6054e28d2 100644 --- a/Testing/Code/Fuzzy/otbFuzzyTests2.cxx +++ b/Testing/Code/Fuzzy/otbFuzzyTests2.cxx @@ -34,4 +34,5 @@ void RegisterTests() REGISTER_TEST(otbVectorDataToRoadDescriptionFilter); REGISTER_TEST(otbFuzzyDescriptorsModelManagerNew); REGISTER_TEST(otbFuzzyDescriptorsModelManagerTest); + REGISTER_TEST(otbStandardDSCostFunctionNew); } diff --git a/Testing/Code/Fuzzy/otbStandardDSCostFunction.cxx b/Testing/Code/Fuzzy/otbStandardDSCostFunction.cxx new file mode 100644 index 0000000000..b86046b680 --- /dev/null +++ b/Testing/Code/Fuzzy/otbStandardDSCostFunction.cxx @@ -0,0 +1,39 @@ +/*========================================================================= + + Program: ORFEO Toolbox + Language: C++ + Date: $Date$ + Version: $Revision$ + + + Copyright (c) Centre National d'Etudes Spatiales. All rights reserved. + See OTBCopyright.txt for details. + + + This software is distributed WITHOUT ANY WARRANTY; without even + the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR + PURPOSE. See the above copyright notices for more information. + +=========================================================================*/ + + +#include "otbStandardDSCostFunction.h" + +#include "otbVectorData.h" +#include "otbVectorDataToDSValidatedVectorDataFilter.h" + +int otbStandardDSCostFunctionNew(int argc, char* argv[]) +{ + typedef double PrecisionType; + typedef otb::VectorData<PrecisionType> VectorDataType; + typedef otb::VectorDataToDSValidatedVectorDataFilter<VectorDataType, PrecisionType> + VectorDataValidationFilterType; + typedef otb::StandardDSCostFunction<VectorDataValidationFilterType> + CostFunctionType; + + CostFunctionType::Pointer costFunction = CostFunctionType::New(); + + std::cout<<costFunction<<std::endl; + + return EXIT_SUCCESS; +} -- GitLab