Skip to content

Commit

Permalink
add unit test
Browse files Browse the repository at this point in the history
  • Loading branch information
dan-du-car committed Jul 26, 2023
1 parent f5840ff commit 7a1fc37
Showing 1 changed file with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -105,8 +105,9 @@ namespace CDASimAdapter {
}

TEST_F(TestCARMASimulationConnection, populate_sensors_with_file)
{
{
Json::Value sensorJsonV;
connection->populate_sensors_with_file("Invalid_file_path", sensorJsonV );
ASSERT_TRUE(sensorJsonV.empty());
std::ifstream in_strm;
in_strm.open(sensors_file_path, std::ifstream::binary);
Expand All @@ -121,11 +122,12 @@ namespace CDASimAdapter {
{
//Populate connection with sensors upon connect call.
connection->connect();
std::string sensor_id = "SomeID";
connection->get_sensor_by_id(sensor_id);
std::ifstream in_strm;
in_strm.open(sensors_file_path, std::ifstream::binary);
if(in_strm.is_open())
{
std::string sensor_id = "SomeID";
auto sensor = connection->get_sensor_by_id(sensor_id);
ASSERT_FALSE(sensor.empty());
ASSERT_EQ("SematicLidar", sensor["type"].asString());
Expand Down

0 comments on commit 7a1fc37

Please sign in to comment.