ifw-daq 3.1.0
IFW Data Acquisition modules
Loading...
Searching...
No Matches
testEventLogObserver.cpp
Go to the documentation of this file.
1/**
2 * @file
3 * @ingroup daq_ocm_libdaq_test
4 * @copyright 2022 ESO - European Southern Observatory
5 *
6 * @brief Unit test for types declared in daq/eventLogObserverLogger.hpp
7 */
9#include <sstream>
10
11#include <gtest/gtest.h>
12#include <gmock/gmock.h>
13
14using namespace ::testing;
15using namespace ::daq;
16
17class TestEventLogObserverLogger : public ::testing::Test {
18public:
19 TestEventLogObserverLogger() : m_logger(log4cplus::Logger::getInstance("test")) {
20 }
21 log4cplus::Logger m_logger;
22};
23
25 EXPECT_NO_THROW(EventLogObserverLogger{m_logger});
26}
27
28TEST_F(TestEventLogObserverLogger, LoggingDoesNotThrow) {
29 // Setup
30 auto logger = EventLogObserverLogger(m_logger);
31
32 // Run
33 EXPECT_NO_THROW(logger(ErrorEvent("id", "test error", {}, "location")));
34 EXPECT_NO_THROW(logger(GenericEvent("id", "test descriptionor", {})));
35 EXPECT_NO_THROW(logger(ActionEvent("id", "test description", {})));
36 EXPECT_NO_THROW(logger(UserActionEvent("id", "test description", {})));
37}
Contains declaration for EventLogObserverLogger.
TEST_F(TestEventLogObserverLogger, Construction)