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

ENH:initial tests for otbWrapperParameter class

parent c03391f7
Branches
Tags
No related merge requests found
...@@ -20,12 +20,12 @@ ...@@ -20,12 +20,12 @@
namespace otb namespace otb
{ {
namespace wrapper namespace Wrapper
{ {
Application::Application() Application::Application()
{ {
m_ParameterList = ParameterList::New(); //m_ParameterList = ParameterList::New();
} }
Application::~Application() Application::~Application()
......
...@@ -24,7 +24,7 @@ ...@@ -24,7 +24,7 @@
namespace otb namespace otb
{ {
namespace wrapper namespace Wrapper
{ {
/** \class Application /** \class Application
...@@ -45,7 +45,7 @@ public: ...@@ -45,7 +45,7 @@ public:
itkNewMacro(Self); itkNewMacro(Self);
/** RTTI support */ /** RTTI support */
itkTypeMacro(Parameter,itk::LightObject); itkTypeMacro(Application,itk::Object);
std::string GetName() std::string GetName()
{ {
...@@ -59,12 +59,16 @@ public: ...@@ -59,12 +59,16 @@ public:
ParameterList* GetParameterList(); ParameterList* GetParameterList();
virtual int Execute() = 0; virtual int Execute() { return 0;}
protected: protected:
Application(); Application();
virtual ~Application(); virtual ~Application();
private:
Application(const Application &); //purposely not implemented
void operator =(const Application&); //purposely not implemented
void SetName(std::string s) void SetName(std::string s)
{ {
m_Name = s; m_Name = s;
......
...@@ -105,7 +105,7 @@ public: ...@@ -105,7 +105,7 @@ public:
/** Reset to the the default value. Default implementation does /** Reset to the the default value. Default implementation does
* nothing * nothing
*/ */
virtual void Reset(); virtual void Reset() {}
protected: protected:
/** Constructor */ /** Constructor */
......
...@@ -24,13 +24,13 @@ ...@@ -24,13 +24,13 @@
namespace otb namespace otb
{ {
namespace wrapper namespace Wrapper
{ {
/** /**
* \class WrapperParameterList * \class WrapperParameterList
*/ */
class ITK_EXPORT ParameterList : public itk::LightObject class ITK_EXPORT ParameterList : public itk::Object
{ {
public: public:
/** Standard class typedefs. */ /** Standard class typedefs. */
...@@ -38,12 +38,21 @@ public: ...@@ -38,12 +38,21 @@ public:
typedef itk::Object Superclass; typedef itk::Object Superclass;
typedef itk::SmartPointer<Self> Pointer; typedef itk::SmartPointer<Self> Pointer;
typedef itk::SmartPointer<const Self> ConstPointer; typedef itk::SmartPointer<const Self> ConstPointer;
typedef Parameter ParameterType;
void AddParameter(); void AddParameter();
Parameter* GetParameter(Key& key); ParameterType * GetParameter(std::string & key);
protected: protected:
ParameterList()
{}
virtual ~ParameterList()
{}
private:
ParameterList(const ParameterList &); //purposely not implemented
void operator =(const ParameterList&); //purposely not implemented
std::vector<Parameter::Pointer> m_ParameterList; std::vector<Parameter::Pointer> m_ParameterList;
......
...@@ -26,7 +26,7 @@ int otbWrapperParameterNew(int argc, char* argv[]) ...@@ -26,7 +26,7 @@ int otbWrapperParameterNew(int argc, char* argv[])
typedef otb::Wrapper::Parameter ParameterBaseType; typedef otb::Wrapper::Parameter ParameterBaseType;
ParameterBaseType::Pointer parameter = ParameterBaseType::New(); ParameterBaseType::Pointer parameter = ParameterBaseType::New();
std::cout << parameter << std::endl; //std::cout << parameter << std::endl;
return EXIT_SUCCESS; return EXIT_SUCCESS;
} }
...@@ -36,7 +36,7 @@ int otbWrapperParameterTest1(int argc, char* argv[]) ...@@ -36,7 +36,7 @@ int otbWrapperParameterTest1(int argc, char* argv[])
typedef otb::Wrapper::Parameter ParameterBaseType; typedef otb::Wrapper::Parameter ParameterBaseType;
ParameterBaseType::Pointer parameter = ParameterBaseType::New(); ParameterBaseType::Pointer parameter = ParameterBaseType::New();
const string name = argv[1]; const std::string name = argv[1];
parameter->SetName(name); parameter->SetName(name);
......
...@@ -27,4 +27,5 @@ ...@@ -27,4 +27,5 @@
void RegisterTests() void RegisterTests()
{ {
REGISTER_TEST(otbWrapperParameterNew); REGISTER_TEST(otbWrapperParameterNew);
REGISTER_TEST(otbWrapperParameterTest1);
} }
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment