Skip to content

Commit

Permalink
run precommit
Browse files Browse the repository at this point in the history
Signed-off-by: Yoshi Ri <[email protected]>
  • Loading branch information
YoshiRi committed Oct 17, 2022
1 parent 7bdb3a3 commit c1182c2
Showing 1 changed file with 30 additions and 31 deletions.
61 changes: 30 additions & 31 deletions common/perception_utils/test/src/test_object_classification.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -68,19 +68,19 @@ TEST(object_classification, test_isVehicle)
using autoware_auto_perception_msgs::msg::ObjectClassification;
using perception_utils::isVehicle;

{// True Case with uint8_t
EXPECT_TRUE(isVehicle(ObjectClassification::BICYCLE));
EXPECT_TRUE(isVehicle(ObjectClassification::BUS));
EXPECT_TRUE(isVehicle(ObjectClassification::CAR));
EXPECT_TRUE(isVehicle(ObjectClassification::MOTORCYCLE));
EXPECT_TRUE(isVehicle(ObjectClassification::TRAILER));
EXPECT_TRUE(isVehicle(ObjectClassification::TRUCK));
{ // True Case with uint8_t
EXPECT_TRUE(isVehicle(ObjectClassification::BICYCLE));
EXPECT_TRUE(isVehicle(ObjectClassification::BUS));
EXPECT_TRUE(isVehicle(ObjectClassification::CAR));
EXPECT_TRUE(isVehicle(ObjectClassification::MOTORCYCLE));
EXPECT_TRUE(isVehicle(ObjectClassification::TRAILER));
EXPECT_TRUE(isVehicle(ObjectClassification::TRUCK));
}

// False Case with uint8_t
{
EXPECT_FALSE(isVehicle(ObjectClassification::UNKNOWN));
EXPECT_FALSE(isVehicle(ObjectClassification::PEDESTRIAN));
EXPECT_FALSE(isVehicle(ObjectClassification::UNKNOWN));
EXPECT_FALSE(isVehicle(ObjectClassification::PEDESTRIAN));
}

// True Case with object_classifications
Expand All @@ -107,19 +107,19 @@ TEST(object_classification, test_isCarLikeVehicle)
using autoware_auto_perception_msgs::msg::ObjectClassification;
using perception_utils::isCarLikeVehicle;

{// True Case with uint8_t
EXPECT_TRUE(isCarLikeVehicle(ObjectClassification::BUS));
EXPECT_TRUE(isCarLikeVehicle(ObjectClassification::CAR));
EXPECT_TRUE(isCarLikeVehicle(ObjectClassification::TRAILER));
EXPECT_TRUE(isCarLikeVehicle(ObjectClassification::TRUCK));
{ // True Case with uint8_t
EXPECT_TRUE(isCarLikeVehicle(ObjectClassification::BUS));
EXPECT_TRUE(isCarLikeVehicle(ObjectClassification::CAR));
EXPECT_TRUE(isCarLikeVehicle(ObjectClassification::TRAILER));
EXPECT_TRUE(isCarLikeVehicle(ObjectClassification::TRUCK));
}

// False Case with uint8_t
{
EXPECT_FALSE(isCarLikeVehicle(ObjectClassification::UNKNOWN));
EXPECT_FALSE(isCarLikeVehicle(ObjectClassification::BICYCLE));
EXPECT_FALSE(isCarLikeVehicle(ObjectClassification::PEDESTRIAN));
EXPECT_FALSE(isCarLikeVehicle(ObjectClassification::MOTORCYCLE));
EXPECT_FALSE(isCarLikeVehicle(ObjectClassification::UNKNOWN));
EXPECT_FALSE(isCarLikeVehicle(ObjectClassification::BICYCLE));
EXPECT_FALSE(isCarLikeVehicle(ObjectClassification::PEDESTRIAN));
EXPECT_FALSE(isCarLikeVehicle(ObjectClassification::MOTORCYCLE));
}

// True Case with object_classifications
Expand All @@ -139,14 +139,13 @@ TEST(object_classification, test_isCarLikeVehicle)
EXPECT_FALSE(isCarLikeVehicle(classification));
}

// Edge case when car and non-car label has same probability
{
// Edge case when car and non-car label has same probability
{
std::vector<autoware_auto_perception_msgs::msg::ObjectClassification> classification;
classification.push_back(createObjectClassification(ObjectClassification::MOTORCYCLE, 0.8));
classification.push_back(createObjectClassification(ObjectClassification::CAR, 0.8));
EXPECT_FALSE(isCarLikeVehicle(classification));
}

} // TEST isCarLikeVehicle

// TEST isLargeVehicle
Expand All @@ -155,19 +154,19 @@ TEST(object_classification, test_isLargeVehicle)
using autoware_auto_perception_msgs::msg::ObjectClassification;
using perception_utils::isLargeVehicle;

{// True Case with uint8_t
EXPECT_TRUE(isLargeVehicle(ObjectClassification::BUS));
EXPECT_TRUE(isLargeVehicle(ObjectClassification::TRAILER));
EXPECT_TRUE(isLargeVehicle(ObjectClassification::TRUCK));
{ // True Case with uint8_t
EXPECT_TRUE(isLargeVehicle(ObjectClassification::BUS));
EXPECT_TRUE(isLargeVehicle(ObjectClassification::TRAILER));
EXPECT_TRUE(isLargeVehicle(ObjectClassification::TRUCK));
}

// False Case with uint8_t
{
EXPECT_FALSE(isLargeVehicle(ObjectClassification::UNKNOWN));
EXPECT_FALSE(isLargeVehicle(ObjectClassification::BICYCLE));
EXPECT_FALSE(isLargeVehicle(ObjectClassification::PEDESTRIAN));
EXPECT_FALSE(isLargeVehicle(ObjectClassification::MOTORCYCLE));
EXPECT_FALSE(isLargeVehicle(ObjectClassification::CAR));
EXPECT_FALSE(isLargeVehicle(ObjectClassification::UNKNOWN));
EXPECT_FALSE(isLargeVehicle(ObjectClassification::BICYCLE));
EXPECT_FALSE(isLargeVehicle(ObjectClassification::PEDESTRIAN));
EXPECT_FALSE(isLargeVehicle(ObjectClassification::MOTORCYCLE));
EXPECT_FALSE(isLargeVehicle(ObjectClassification::CAR));
}

{ // false case
Expand All @@ -177,4 +176,4 @@ TEST(object_classification, test_isLargeVehicle)
classification.push_back(createObjectClassification(ObjectClassification::CAR, 0.8));
EXPECT_FALSE(isLargeVehicle(classification));
}
} // TEST isLargeVehicle
} // TEST isLargeVehicle

0 comments on commit c1182c2

Please sign in to comment.