MCPcopy Create free account
hub / github.com/MITK/MITK / mitkLevelWindowTest

Function mitkLevelWindowTest

Modules/Core/test/mitkLevelWindowTest.cpp:32–966  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

30}
31
32int mitkLevelWindowTest(int, char *[])
33{
34 std::cout << "Testing mitk::LevelWindow " << std::endl;
35
36 std::cout << "Testing mitk::LevelWindow constructor with Level and Window ";
37 auto levWin = new mitk::LevelWindow(256, 500);
38 std::cout << "[PASSED]" << std::endl;
39
40 std::cout << "Testing mitk::LevelWindow GetDefaultWindow ";
41 mitk::ScalarType defaultWindow = levWin->GetDefaultWindow();
42 if (!(defaultWindow == 500))
43 {
44 std::cout << defaultWindow << " [FAILED]" << std::endl;
45 return EXIT_FAILURE;
46 }
47 std::cout << "[PASSED]" << std::endl;
48
49 std::cout << "Testing mitk::LevelWindow GetDefaultLevel ";
50 mitk::ScalarType defaultLevel = levWin->GetDefaultLevel();
51 if (!(defaultLevel == 256))
52 {
53 std::cout << "[FAILED]" << std::endl;
54 return EXIT_FAILURE;
55 }
56 std::cout << "[PASSED]" << std::endl;
57
58 std::cout << "Testing mitk::LevelWindow GetWindow ";
59 mitk::ScalarType window = levWin->GetWindow();
60 if (!(window == 500))
61 {
62 std::cout << "[FAILED]" << std::endl;
63 return EXIT_FAILURE;
64 }
65 std::cout << "[PASSED]" << std::endl;
66
67 std::cout << "Testing mitk::LevelWindow GetMin ";
68 if (!(levWin->GetLowerWindowBound() == 6))
69 {
70 std::cout << "[FAILED]" << std::endl;
71 return EXIT_FAILURE;
72 }
73 std::cout << "[PASSED]" << std::endl;
74
75 std::cout << "Testing mitk::LevelWindow GetMax ";
76 if (!(levWin->GetUpperWindowBound() == 506))
77 {
78 std::cout << "[FAILED]" << std::endl;
79 return EXIT_FAILURE;
80 }
81 std::cout << "[PASSED]" << std::endl;
82
83 std::cout << "Testing mitk::LevelWindow GetLevel ";
84 mitk::ScalarType level = levWin->GetLevel();
85 if (!(level == 256))
86 {
87 std::cout << "[FAILED]" << std::endl;
88 return EXIT_FAILURE;
89 }

Callers

nothing calls this directly

Calls 15

resetLevelWindowFunction · 0.85
GetDefaultWindowMethod · 0.80
GetDefaultLevelMethod · 0.80
GetLowerWindowBoundMethod · 0.80
GetUpperWindowBoundMethod · 0.80
GetLevelMethod · 0.80
SetDefaultLevelWindowMethod · 0.80
SetWindowBoundsMethod · 0.80
SetRangeMinMaxMethod · 0.80
SetDefaultBoundariesMethod · 0.80
GetDefaultLowerBoundMethod · 0.80

Tested by

no test coverage detected