Medical Imaging Interaction Toolkit  2018.4.99-389bf124
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 (DKFZ)
6 All rights reserved.
7 
8 Use of this source code is governed by a 3-clause BSD license that can be
9 found in the LICENSE file.
10 
11 ============================================================================*/
12 
13 #include "mitkStepper.h"
14 #include "mitkTestingMacros.h"
15 
16 int mitkStepperTest(int /*argc*/, char * /*argv*/ [])
17 {
18  MITK_TEST_BEGIN(StepperTest)
19 
20  mitk::Stepper::Pointer stepperA;
21  stepperA = mitk::Stepper::New();
22  MITK_TEST_CONDITION_REQUIRED(stepperA.IsNotNull(), "Stepper instantiation.")
23 
24  // number of steps defaults to zero, SetPos should have no effect, GetPos should return zero
25  stepperA->SetPos(10);
26  MITK_TEST_CONDITION_REQUIRED(stepperA->GetPos() == 0, "Pos remains zero if m_Steps is zero.")
27 
29  stepperA->SetSteps(4);
30  // stepperA->PingPongOn();
31  stepperB->SetSteps(6);
32  // stepperB->PingPongOn();
33  /* for (int i=0 ; i<10; i++) {
34  std::cout << i << ": A: " << stepperA->GetPos() << " B:" << stepperB->GetPos() << std::endl;
35  stepperA->Next();
36  stepperB->Next();
37  }*/
38 
40 }
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()