fix(formatting): Fix simple formatting errors

This commit is contained in:
2025-11-28 09:34:34 +01:00
parent 881346b284
commit 45f5397d58
3 changed files with 5 additions and 8 deletions

View File

@@ -1,8 +1,6 @@
#include "Simulator.hpp" #include "Simulator.hpp"
#include <algorithm>
namespace assignments::three namespace assignments::three {
{
Simulator::Simulator(rclcpp::Node* node, const std::vector<std::string>& objects) { Simulator::Simulator(rclcpp::Node* node, const std::vector<std::string>& objects) {
load_intervals(node, objects); load_intervals(node, objects);

View File

@@ -3,9 +3,9 @@
#include <vector> #include <vector>
#include <string> #include <string>
#include <map> #include <map>
#include <algorithm>
namespace assignments::three namespace assignments::three {
{
enum class SimType { enum class SimType {
CONSTANT, CONSTANT,
@@ -32,11 +32,10 @@ public:
private: private:
int max_intervals_; int max_intervals_;
std::map<std::string, std::vector<IntervalConfig>> object_intervals_;
void load_intervals(rclcpp::Node* node, const std::vector<std::string>& objects); void load_intervals(rclcpp::Node* node, const std::vector<std::string>& objects);
double compute_value(double t, const IntervalConfig& interval); double compute_value(double t, const IntervalConfig& interval);
std::map<std::string, std::vector<IntervalConfig>> object_intervals_;
}; };
} // namespace assignments::three } // namespace assignments::three

View File

@@ -248,7 +248,7 @@ TEST_F(SimulatorTest, MaxIntervalsLimit) {
// Only first 2 intervals should be loaded // Only first 2 intervals should be loaded
EXPECT_DOUBLE_EQ(sim.get_object_value("test_channel", 5.0), 1.0); // First interval EXPECT_DOUBLE_EQ(sim.get_object_value("test_channel", 5.0), 1.0); // First interval
EXPECT_DOUBLE_EQ(sim.get_object_value("test_channel", 15.0), 2.0); // Second interval EXPECT_DOUBLE_EQ(sim.get_object_value("test_channel", 15.0), 2.0); // Second interval
EXPECT_DOUBLE_EQ(sim.get_object_value("test_channel", 25.0), 2.0); // Third interval should not exist, holds second EXPECT_DOUBLE_EQ(sim.get_object_value("test_channel", 25.0), 2.0); // Third interval should not exist
} }
int main(int argc, char** argv) { int main(int argc, char** argv) {