logger_test.cpp
Go to the documentation of this file.
1 #include <gtest/gtest.h>
3 
4 class StanInterfaceCallbacksLogger: public ::testing::Test {
5 public:
6  void SetUp() { }
7  void TearDown() { }
9 };
10 
12  EXPECT_NO_THROW(logger.debug("message"));
13 
14  std::string msg = "message";
15  EXPECT_NO_THROW(logger.debug(msg));
16 }
17 
18 TEST_F(StanInterfaceCallbacksLogger, debug_stringstream) {
19  std::stringstream msg;
20  msg << "message";
21  EXPECT_NO_THROW(logger.debug(msg));
22 }
23 
25  EXPECT_NO_THROW(logger.info("message"));
26 
27  std::string msg = "message";
28  EXPECT_NO_THROW(logger.info(msg));
29 }
30 
31 TEST_F(StanInterfaceCallbacksLogger, info_stringstream) {
32  std::stringstream msg;
33  msg << "message";
34  EXPECT_NO_THROW(logger.info(msg));
35 }
36 
38  EXPECT_NO_THROW(logger.warn("message"));
39 
40  std::string msg = "message";
41  EXPECT_NO_THROW(logger.warn(msg));
42 }
43 
44 TEST_F(StanInterfaceCallbacksLogger, warn_stringstream) {
45  std::stringstream msg;
46  msg << "message";
47  EXPECT_NO_THROW(logger.warn(msg));
48 }
49 
51  EXPECT_NO_THROW(logger.error("message"));
52 
53  std::string msg = "message";
54  EXPECT_NO_THROW(logger.error(msg));
55 }
56 
57 TEST_F(StanInterfaceCallbacksLogger, error_stringstream) {
58  std::stringstream msg;
59  msg << "message";
60  EXPECT_NO_THROW(logger.error(msg));
61 }
62 
64  EXPECT_NO_THROW(logger.fatal("message"));
65 
66  std::string msg = "message";
67  EXPECT_NO_THROW(logger.fatal(msg));
68 }
69 
70 TEST_F(StanInterfaceCallbacksLogger, fatal_stringstream) {
71  std::stringstream msg;
72  msg << "message";
73  EXPECT_NO_THROW(logger.fatal(msg));
74 }
virtual void debug(const std::string &message)
Definition: logger.hpp:33
stan::callbacks::logger logger
Definition: logger_test.cpp:8
virtual void warn(const std::string &message)
Definition: logger.hpp:61
virtual void error(const std::string &message)
Definition: logger.hpp:75
virtual void info(const std::string &message)
Definition: logger.hpp:47
virtual void fatal(const std::string &message)
Definition: logger.hpp:89
TEST_F(StanInterfaceCallbacksLogger, debug_string)
Definition: logger_test.cpp:11
enum BeamMode string