Medical Imaging Interaction Toolkit  2016.11.0
Medical Imaging Interaction Toolkit
mitkStepperTest.cpp
Go to the documentation of this file.
1 /*===================================================================
2 
3 The Medical Imaging Interaction Toolkit (MITK)
4 
5 Copyright (c) German Cancer Research Center,
6 Division of Medical and Biological Informatics.
7 All rights reserved.
8 
9 This software is distributed WITHOUT ANY WARRANTY; without
10 even the implied warranty of MERCHANTABILITY or FITNESS FOR
11 A PARTICULAR PURPOSE.
12 
13 See LICENSE.txt or http://www.mitk.org for details.
14 
15 ===================================================================*/
16 
17 #include "mitkStepper.h"
18 #include "mitkTestingMacros.h"
19 
20 int mitkStepperTest(int /*argc*/, char * /*argv*/ [])
21 {
22  MITK_TEST_BEGIN(StepperTest)
23 
24  mitk::Stepper::Pointer stepperA;
25  stepperA = mitk::Stepper::New();
26  MITK_TEST_CONDITION_REQUIRED(stepperA.IsNotNull(), "Stepper instantiation.")
27 
28  // number of steps defaults to zero, SetPos should have no effect, GetPos should return zero
29  stepperA->SetPos(10);
30  MITK_TEST_CONDITION_REQUIRED(stepperA->GetPos() == 0, "Pos remains zero if m_Steps is zero.")
31 
33  stepperA->SetSteps(4);
34  // stepperA->PingPongOn();
35  stepperB->SetSteps(6);
36  // stepperB->PingPongOn();
37  /* for (int i=0 ; i<10; i++) {
38  std::cout << i << ": A: " << stepperA->GetPos() << " B:" << stepperB->GetPos() << std::endl;
39  stepperA->Next();
40  stepperB->Next();
41  }*/
42 
44 }
int mitkStepperTest(int, char *[])
#define MITK_TEST_CONDITION_REQUIRED(COND, MSG)
section GeneralTestsDeprecatedOldTestingStyle Deprecated macros All tests with MITK_TEST_BEGIN()
static Pointer New()
and MITK_TEST_END()