Skip to content

Commit

Permalink
fix: change all informations to information
Browse files Browse the repository at this point in the history
  • Loading branch information
bekirbostanci committed Jan 30, 2024
1 parent 1029dfe commit 0b57900
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
8 changes: 4 additions & 4 deletions vda5050_connector/include/vda5050_connector/handler.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -97,13 +97,13 @@ class SafeState
}

/**
* @brief Add a new information msg into the informations array of the order state
* @brief Add a new information msg into the information array of the order state
* Only one thread/writer can modify the order_state.
*/
void add_information(const vda5050_msgs::msg::Info & info)
{
std::unique_lock lock(mutex);
order_state_.informations.push_back(info);
order_state_.information.push_back(info);
}

/**
Expand All @@ -127,14 +127,14 @@ class SafeState
}

/**
* @brief Clear the order state arrays (load, informations and errors).
* @brief Clear the order state arrays (load, information and errors).
* Only one thread/writer can clear the order_state.
*/
void clear()
{
std::unique_lock lock(mutex);
order_state_.loads.clear();
order_state_.informations.clear();
order_state_.information.clear();
order_state_.errors.clear();
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,14 +72,14 @@ TEST_F(AdapterTest, HandlerExecution)

// Check handlers could modify global current state on configure
auto order_state = adapter_node->get_current_state();
EXPECT_EQ(static_cast<int>(order_state.informations.size()), 1);
EXPECT_EQ(static_cast<int>(order_state.information.size()), 1);
EXPECT_FLOAT_EQ(static_cast<int>(order_state.battery_state.battery_charge), 100.0);

// Check handlers could modify global current state on execute
ASSERT_NO_THROW(adapter_node->call_update_current_state());
order_state = adapter_node->get_current_state();
// Update current state should clear previous loads, error and informations
EXPECT_EQ(static_cast<int>(order_state.informations.size()), 1);
// Update current state should clear previous loads, error and information
EXPECT_EQ(static_cast<int>(order_state.information.size()), 1);
EXPECT_FLOAT_EQ(static_cast<int>(order_state.battery_state.battery_charge), 90.0);

// Test vda action execute state machine: Transitions and call of state funcs
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ TEST_F(AdapterTest, HandlerLoadHandlers)

// Check handlers could modify global current state on configure
auto order_state = adapter_node->get_current_state();
EXPECT_EQ(static_cast<int>(order_state.informations.size()), 1);
EXPECT_EQ(static_cast<int>(order_state.information.size()), 1);
EXPECT_FLOAT_EQ(order_state.distance_since_last_node, 10.0);
EXPECT_EQ(order_state.paused, true);

Expand Down

0 comments on commit 0b57900

Please sign in to comment.