Skip to content

Commit

Permalink
update detector navigator unit test
Browse files Browse the repository at this point in the history
  • Loading branch information
andiwand committed Nov 25, 2024
1 parent 37ef3d9 commit b60681f
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 9 deletions.
2 changes: 1 addition & 1 deletion Tests/UnitTests/Core/Navigation/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@ add_unittest(DetectorVolumeFinders DetectorVolumeFindersTests.cpp)
add_unittest(NavigationState NavigationStateTests.cpp)
add_unittest(NavigationStream NavigationStreamTests.cpp)
add_unittest(NavigationStateUpdaters NavigationStateUpdatersTests.cpp)
#add_unittest(DetectorNavigator DetectorNavigatorTests.cpp)
add_unittest(DetectorNavigator DetectorNavigatorTests.cpp)
add_unittest(MultiWireNavigation MultiWireNavigationTests.cpp)
add_unittest(NavigationPolicy NavigationPolicyTests.cpp)
18 changes: 10 additions & 8 deletions Tests/UnitTests/Core/Navigation/DetectorNavigatorTests.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -117,17 +117,16 @@ BOOST_AUTO_TEST_CASE(DetectorNavigatorTestsInitialization) {

auto state = propagator.makeState(start, options);

navigator.initialize(state, stepper);
navigator.initialize(state.navigation, stepper.position(state.stepping),
stepper.direction(state.stepping),
state.options.direction);

navigator.preStep(state, stepper);
navigator.estimateNextTarget(state.navigation,
stepper.position(state.stepping),
stepper.direction(state.stepping));
auto preStepState = state.navigation;
BOOST_CHECK_EQUAL(preStepState.currentSurface, nullptr);
BOOST_CHECK_EQUAL(preStepState.currentPortal, nullptr);

navigator.postStep(state, stepper);
auto postStepState = state.navigation;
BOOST_CHECK_EQUAL(postStepState.currentSurface, nullptr);
BOOST_CHECK_EQUAL(postStepState.currentPortal, nullptr);
}

//
Expand Down Expand Up @@ -166,7 +165,10 @@ BOOST_AUTO_TEST_CASE(DetectorNavigatorTestsInitialization) {

auto state = propagator.makeState(start, options);

navigator.initialize(state, stepper);
navigator.initialize(state.navigation, stepper.position(state.stepping),
stepper.direction(state.stepping),
state.options.direction);

auto initState = state.navigation;
BOOST_CHECK_EQUAL(initState.currentDetector, detector.get());
BOOST_CHECK_EQUAL(
Expand Down

0 comments on commit b60681f

Please sign in to comment.