Skip to content
Snippets Groups Projects
Commit f629ac33 authored by Manuel Grizonnet's avatar Manuel Grizonnet
Browse files

TEST:add unitary tests for emptyparameter, parameterList and NumericalParameter test

parent 3caaf0e0
Branches
Tags
No related merge requests found
......@@ -28,8 +28,8 @@ namespace Wrapper
/** \class NumericalParameter
* \brief This class represents a numerical parameter
*/
template <typename T> NumericalParameter
: public Parameter
template <class T>
class ITK_EXPORT NumericalParameter : public Parameter
{
public:
/** Standard class typedef */
......@@ -80,8 +80,8 @@ public:
protected:
/** Constructor */
NumericalParameter()
: m_Value(itk::NumericTraits<T>::Zero()),
m_DefaultValue(itk::NumericTraits<T>::Zero()),
: m_Value(itk::NumericTraits<T>::Zero),
m_DefaultValue(itk::NumericTraits<T>::Zero),
m_MinimumValue(itk::NumericTraits<T>::min()),
m_MaximumValue(itk::NumericTraits<T>::max())
{}
......
......@@ -67,7 +67,7 @@ public:
itkNewMacro(Self);
/** RTTI support */
itkTypeMacro(Parameter,itk::LightObject);
itkTypeMacro(Parameter,itk::Object);
/** Set the parameter name */
itkSetStringMacro(Name);
......
......@@ -40,6 +40,12 @@ public:
typedef itk::SmartPointer<const Self> ConstPointer;
typedef Parameter ParameterType;
/** Defining ::New() static method */
itkNewMacro(Self);
/** RTTI support */
itkTypeMacro(ParameterList,itk::Object);
void AddParameter();
ParameterType * GetParameter(std::string & key);
......
......@@ -15,13 +15,32 @@ ADD_TEST(owTvParameter ${OTB_WRAPPER_TESTS}
"param1"
)
# ------- Source files CXX -----------------------------------
# NumericalParameter class test
ADD_TEST(owTuNumericalParameter ${OTB_WRAPPER_TESTS}
otbWrapperNumericalParameterNew
)
# EmptyParameter class test
ADD_TEST(owTuEmptyParameter ${OTB_WRAPPER_TESTS}
otbWrapperEmptyParameterNew
)
# NumericalParameter class test
ADD_TEST(owTuNumericalParameter ${OTB_WRAPPER_TESTS}
otbWrapperNumericalParameterNew
)
# ----------------Source files CXX -----------------------------------
SET(Wrapper_SRCS
otbWrapperTests.cxx
otbWrapperParameterTest.cxx
otbWrapperNumericalParameterTest.cxx
otbWrapperEmptyParameterTest.cxx
#otbWrapperApplicationTest.cxx
otbWrapperParameterListTest.cxx
)
ADD_EXECUTABLE(otbWrapperTests ${Wrapper_SRCS})
TARGET_LINK_LIBRARIES(otbWrapperTests OTBIO OTBCommon ITKIO ITKCommon OTBTesting)
TARGET_LINK_LIBRARIES(otbWrapperTests OTBIO OTBCommon ITKIO ITKCommon OTBTesting)
/*=========================================================================
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.
=========================================================================*/
#if defined(_MSC_VER)
#pragma warning ( disable : 4786 )
#endif
#include "otbWrapperEmptyParameter.h"
int otbWrapperEmptyParameterNew(int argc, char* argv[])
{
typedef otb::Wrapper::EmptyParameter EmptyParameterType;
EmptyParameterType::Pointer parameter = EmptyParameterType::New();
//std::cout << parameter << std::endl;
return EXIT_SUCCESS;
}
/*=========================================================================
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.
=========================================================================*/
#if defined(_MSC_VER)
#pragma warning ( disable : 4786 )
#endif
#include "otbWrapperNumericalParameter.h"
int otbWrapperNumericalParameterNew(int argc, char* argv[])
{
typedef otb::Wrapper::NumericalParameter <int> NumericalParameterType;
NumericalParameterType::Pointer parameter = NumericalParameterType::New();
return EXIT_SUCCESS;
}
/*=========================================================================
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.
=========================================================================*/
#if defined(_MSC_VER)
#pragma warning ( disable : 4786 )
#endif
#include "otbWrapperParameterList.h"
int otbWrapperParameterListNew(int argc, char* argv[])
{
typedef otb::Wrapper::ParameterList ParameterListType;
ParameterListType::Pointer parameter = ParameterListType::New();
//std::cout << parameter << std::endl;
return EXIT_SUCCESS;
}
......@@ -28,4 +28,8 @@ void RegisterTests()
{
REGISTER_TEST(otbWrapperParameterNew);
REGISTER_TEST(otbWrapperParameterTest1);
REGISTER_TEST(otbWrapperNumericalParameterNew);
REGISTER_TEST(otbWrapperEmptyParameterNew);
//REGISTER_TEST(otbWrapperApplicationNew);
REGISTER_TEST(otbWrapperParameterListNew);
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment