Skip to content

Instantly share code, notes, and snippets.

@JNeiger
Last active September 15, 2017 21:01
Show Gist options
  • Save JNeiger/2c8615e3e9e74396099dfcd5d637bee9 to your computer and use it in GitHub Desktop.
Save JNeiger/2c8615e3e9e74396099dfcd5d637bee9 to your computer and use it in GitHub Desktop.
TEST(WindowEvaluator, test_bug) {
SystemState state;
OurRobot* obstacleBot = state.self[0];
obstacleBot->visible = true;
obstacleBot->pos = Point(0, 3.5);
Segment ourGoalSegment(
Point(Field_Dimensions::Current_Dimensions.GoalWidth() / 2.0, 0),
Point(-Field_Dimensions::Current_Dimensions.GoalWidth() / 2.0, 0));
WindowEvaluator winEval(&state);
WindowingResult result =
winEval.eval_pt_to_seg(Point(0, 4), ourGoalSegment);
auto& windows = result.first;
// there should be no windows since the opponent robot is in the middle of the entire shot
EXPECT_NE(1, windows.size());
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment