Skip to content

Commit

Permalink
Fixes to tests:
Browse files Browse the repository at this point in the history
- Fix xodr map.
- Adds error serialization to assertions.

Signed-off-by: Agustin Alba Chicar <ag.albachicar@gmail.com>
  • Loading branch information
agalbachicar committed Jun 3, 2024
1 parent a2a220f commit 9a3cb03
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 10 deletions.
7 changes: 3 additions & 4 deletions test/resources/odr/MultipleStraightSegments.xodr
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,6 @@
<road name="Road 2" length="100.0" id="2" junction="-1">
<link>
<predecessor elementType="road" elementId="1" contactPoint="end" />
<successor elementType="road" elementId="3" contactPoint="start" />
</link>
<planView>
<geometry s="0.0" x="100.0" y="0.0" hdg="0.0" length="100.0">
Expand All @@ -107,7 +106,7 @@
<left>
<lane id="1" type="driving" level= "0">
<link>
<successor id="1" />
<predecessor id="1" />
</link>
<width sOffset="0.0" a="3.5" b="0.0" c="0.0" d="0.0"/>
<roadMark sOffset="0.0" type="solid" weight="standard" color="standard" width="2.e-01"/>
Expand All @@ -119,7 +118,7 @@
<center>
<lane id="0" type="driving" level= "0">
<link>
<successor id="0" />
<predecessor id="0" />
</link>
<roadMark sOffset="0.0" type="broken" weight="standard" color="standard" width="1.e-01"/>
<userData>
Expand All @@ -130,7 +129,7 @@
<right>
<lane id="-1" type="driving" level= "0">
<link>
<successor id="-1" />
<predecessor id="-1" />
</link>
<width sOffset="0.0" a="3.5" b="0.0" c="0.0" d="0.0"/>
<roadMark sOffset="0.0" type="solid" weight="standard" color="standard" width="2.e-01"/>
Expand Down
12 changes: 6 additions & 6 deletions test/route_end_to_end_connectivity_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ TEST_F(SinglePhaseTest, SinglePhaseWithTwoLanesAndStartPositionsIsNotConnectedEn

const std::vector<std::string> errors = dut.ValidateEndToEndConnectivity();

ASSERT_FALSE(errors.empty());
ASSERT_FALSE(errors.empty()) << SerializeErrors(errors);
}

TEST_F(SinglePhaseTest, SinglePhaseWithTwoLanesAndEndPositionsIsNotConnectedEndToEnd) {
Expand All @@ -170,7 +170,7 @@ TEST_F(SinglePhaseTest, SinglePhaseWithTwoLanesAndEndPositionsIsNotConnectedEndT

const std::vector<std::string> errors = dut.ValidateEndToEndConnectivity();

ASSERT_FALSE(errors.empty());
ASSERT_FALSE(errors.empty()) << SerializeErrors(errors);
}

class MultiPhaseTest : public MultipleStraightSegmentsTest {};
Expand Down Expand Up @@ -208,7 +208,7 @@ TEST_F(MultiPhaseTest, MultiPhaseWithOneLaneEachIsNotGeometricallyConnectedEndTo

const std::vector<std::string> errors = dut.ValidateEndToEndConnectivity();

ASSERT_FALSE(errors.empty());
ASSERT_FALSE(errors.empty()) << SerializeErrors(errors);
}

TEST_F(MultiPhaseTest, MultiPhaseWithOneLaneEachIsNotTopologicallyConnectedEndToEnd) {
Expand All @@ -226,7 +226,7 @@ TEST_F(MultiPhaseTest, MultiPhaseWithOneLaneEachIsNotTopologicallyConnectedEndTo

const std::vector<std::string> errors = dut.ValidateEndToEndConnectivity();

ASSERT_FALSE(errors.empty());
ASSERT_FALSE(errors.empty()) << SerializeErrors(errors);
}

TEST_F(MultiPhaseTest, MultiPhaseWithDifferrentNumberOfPositionsAtInterfaceIsNotConnectedEndToEnd) {
Expand All @@ -247,7 +247,7 @@ TEST_F(MultiPhaseTest, MultiPhaseWithDifferrentNumberOfPositionsAtInterfaceIsNot

const std::vector<std::string> errors = dut.ValidateEndToEndConnectivity();

ASSERT_FALSE(errors.empty());
ASSERT_FALSE(errors.empty()) << SerializeErrors(errors);
}

TEST_F(MultiPhaseTest, MultiPhaseWithinSameLaneIsConnectedEndToEnd) {
Expand Down Expand Up @@ -283,7 +283,7 @@ TEST_F(MultiPhaseTest, MultiPhaseWithinSameLaneIsNotGeometricallyConnectedEndToE

const std::vector<std::string> errors = dut.ValidateEndToEndConnectivity();

ASSERT_FALSE(errors.empty());
ASSERT_FALSE(errors.empty()) << SerializeErrors(errors);
}

} // namespace
Expand Down

0 comments on commit 9a3cb03

Please sign in to comment.