blob: 8c18fd5228a44f9648999453a279fbbda2f7ca31 [file] [log] [blame]
Patrick Williamsd0ac4bf2025-11-05 00:24:25 -05001#include <systemd/sd-bus-protocol.h>
2
3#include <sdbusplus/message.hpp>
4#include <sdbusplus/test/sdbus_mock.hpp>
5
6#include <flat_map>
7#include <string>
8
9#include <gmock/gmock.h>
10#include <gtest/gtest.h>
11
12namespace
13{
14
15using testing::DoAll;
16using testing::Return;
17using testing::StrEq;
18
19ACTION_TEMPLATE(SetReadValue, HAS_1_TEMPLATE_PARAMS(typename, T),
20 AND_1_VALUE_PARAMS(value))
21{
22 *static_cast<T*>(arg2) = value;
23}
24
25class FlatMapTest : public testing::Test
26{
27 protected:
28 testing::StrictMock<sdbusplus::SdBusMock> mock;
29
30 void SetUp() override
31 {
32 EXPECT_CALL(mock, sd_bus_message_new_method_call(testing::_, testing::_,
33 nullptr, nullptr,
34 nullptr, nullptr))
35 .WillRepeatedly(Return(0));
36 }
37
38 sdbusplus::message_t new_message()
39 {
40 return sdbusplus::get_mocked_new(&mock).new_method_call(
41 nullptr, nullptr, nullptr, nullptr);
42 }
43};
44
45// Test that flat_map compiles with the read/append functions
46TEST_F(FlatMapTest, CompileTest)
47{
48 std::flat_map<std::string, int> fmap{{"key1", 100}, {"key2", 200}};
49 // This test just verifies that the code compiles
50 SUCCEED();
51}
52
53} // namespace