9#include <framework/dataobjects/EventExtraInfo.h>
11#include <gtest/gtest.h>
18TEST(EventExtraInfoTest, GetAddHasTest)
22 EXPECT_FALSE(eventExtraInfo.hasExtraInfo(
"a"));
23 EXPECT_THROW(eventExtraInfo.getExtraInfo(
"a"), std::runtime_error);
24 EXPECT_NO_THROW(eventExtraInfo.addExtraInfo(
"a", 3));
25 EXPECT_FLOAT_EQ(eventExtraInfo.getExtraInfo(
"a"), 3);
26 EXPECT_TRUE(eventExtraInfo.hasExtraInfo(
"a"));
27 EXPECT_THROW(eventExtraInfo.addExtraInfo(
"a", 4), std::out_of_range);
28 EXPECT_NO_THROW(eventExtraInfo.setExtraInfo(
"a", 4));
29 EXPECT_FLOAT_EQ(eventExtraInfo.getExtraInfo(
"a"), 4);
31 EXPECT_FALSE(eventExtraInfo.hasExtraInfo(
"b"));
32 EXPECT_THROW(eventExtraInfo.getExtraInfo(
"b"), std::runtime_error);
33 EXPECT_NO_THROW(eventExtraInfo.addExtraInfo(
"b", 3.7));
34 EXPECT_FLOAT_EQ(eventExtraInfo.getExtraInfo(
"b"), 3.7);
35 EXPECT_TRUE(eventExtraInfo.hasExtraInfo(
"b"));
36 EXPECT_THROW(eventExtraInfo.addExtraInfo(
"b", 4.6), std::out_of_range);
37 EXPECT_FLOAT_EQ(eventExtraInfo.getExtraInfo(
"b"), 3.7);
39 EXPECT_FLOAT_EQ(eventExtraInfo.getExtraInfo(
"a"), 4);
Abstract base class for different kinds of events.