Coverage Report

Created: 2024-09-19 09:45

/proc/self/cwd/test/mocks/server/config_tracker.cc
Line
Count
Source
1
#include "config_tracker.h"
2
3
#include <string>
4
5
#include "gmock/gmock.h"
6
#include "gtest/gtest.h"
7
8
namespace Envoy {
9
namespace Server {
10
11
using ::testing::_;
12
using ::testing::Invoke;
13
14
26.7k
MockConfigTracker::MockConfigTracker() {
15
26.7k
  ON_CALL(*this, add_(_, _))
16
26.7k
      .WillByDefault(Invoke([this](const std::string& key, Cb callback) -> EntryOwner* {
17
14.5k
        EXPECT_TRUE(config_tracker_callbacks_.find(key) == config_tracker_callbacks_.end());
18
14.5k
        config_tracker_callbacks_[key] = callback;
19
14.5k
        return new MockEntryOwner();
20
14.5k
      }));
21
26.7k
}
22
23
26.7k
MockConfigTracker::~MockConfigTracker() = default;
24
25
} // namespace Server
26
} // namespace Envoy