GCC Code Coverage Report
Directory: ./ Exec Total Coverage
File: test/nolog/test_nolog_timed.cc Lines: 62 62 100.0 %
Date: 2025-03-04 18:34:12 Branches: 149 450 33.1 %

Line Branch Exec Source
1
//
2
// Created by acey on 07.09.23.
3
//
4
5
#include <gtest/gtest.h>
6
#include <log++.h>
7
#include <mutex>
8
#include <async_tests.h>
9
10
1
std::vector<AsyncTest> generateTests() {
11
  return {
12
30
      {"nolog_timed_lpp_syntax_severity_debug_Test","",[]() { LOG_TIMED(D, 1, "Test" << 123); }, EQUAL, STDOUT},
13
30
      {"nolog_timed_lpp_syntax_severity_info_Test","",[]() { LOG_TIMED(I, 1, "Test" << 123); }, EQUAL, STDOUT},
14
30
      {"nolog_timed_lpp_syntax_severity_warning_Test","",[]() { LOG_TIMED(W, 1, "Test" << 123); }, EQUAL, STDOUT},
15
30
      {"nolog_timed_lpp_syntax_severity_error_Test","",[]() { LOG_TIMED(E, 1, "Test" << 123); }, EQUAL, STDOUT},
16
30
      {"nolog_timed_lpp_syntax_severity_fatal_Test","",[]() { LOG_TIMED(F, 1, "Test" << 123); }, EQUAL, STDOUT},
17
18

30
      {"nolog_timed_glog_syntax_severity_debug_Test","",[]() { DLOG_EVERY_T(INFO, 1) << "Test" << 123; }, IS_SUBSTRING, STDERR},
19

30
      {"nolog_timed_glog_syntax_severity_info_Test","",[]() { LOG_EVERY_T(INFO, 1) << "Test" << 123; }, IS_SUBSTRING, STDOUT},
20

30
      {"nolog_timed_glog_syntax_severity_warning_Test","",[]() { LOG_EVERY_T(WARNING, 1) << "Test" << 123; }, IS_SUBSTRING, STDOUT},
21

30
      {"nolog_timed_glog_syntax_severity_error_Test","",[]() { LOG_EVERY_T(ERROR, 1) << "Test" << 123; }, IS_SUBSTRING, STDOUT},
22

30
      {"nolog_timed_glog_syntax_severity_fatal_Test","",[]() { LOG_EVERY_T(FATAL, 1) << "Test" << 123; }, IS_SUBSTRING, STDOUT},
23
24
30
      {"nolog_timed_ros_syntax_severity_debug_Test", "", []() {ROS_DEBUG_THROTTLE(1, "Test123"); }, IS_SUBSTRING, STDOUT},
25
30
      {"nolog_timed_ros_syntax_severity_debug_stream_Test", "", []() {ROS_DEBUG_STREAM_THROTTLE(1, "Test123"); }, IS_SUBSTRING, STDOUT},
26
30
      {"nolog_timed_ros_syntax_severity_info_Test", "", []() {ROS_INFO_THROTTLE(1, "Test123"); }, IS_SUBSTRING, STDOUT},
27
30
      {"nolog_timed_ros_syntax_severity_info_stream_Test", "", []() {ROS_INFO_STREAM_THROTTLE(1, "Test123"); }, IS_SUBSTRING, STDOUT},
28
30
      {"nolog_timed_ros_syntax_severity_warning_Test", "", []() {ROS_WARN_THROTTLE(1, "Test123"); }, IS_SUBSTRING, STDERR},
29
30
      {"nolog_timed_ros_syntax_severity_warning_stream_Test", "", []() {ROS_WARN_STREAM_THROTTLE(1, "Test123"); }, IS_SUBSTRING, STDERR},
30
30
      {"nolog_timed_ros_syntax_severity_error_Test", "", []() {ROS_ERROR_THROTTLE(1, "Test123"); }, IS_SUBSTRING, STDERR},
31
30
      {"nolog_timed_ros_syntax_severity_error_stream_Test", "", []() {ROS_ERROR_STREAM_THROTTLE(1, "Test123"); }, IS_SUBSTRING, STDERR},
32
30
      {"nolog_timed_ros_syntax_severity_fatal_Test", "", []() {ROS_FATAL_THROTTLE(1, "Test123"); }, IS_SUBSTRING, STDERR},
33
30
      {"nolog_timed_ros_syntax_severity_fatal_stream_Test", "", []() {ROS_FATAL_STREAM_THROTTLE(1, "Test123"); }, IS_SUBSTRING, STDERR},
34































21
  };
35
}
36
37
4
TEST(nolog_timed, lpp_syntax_severity_debug) {
38




2
  ASSERT_TRUE(TestResult::getInstance().get(GET_CLASS_NAME(*this, nullptr)));
39
}
40
41
4
TEST(nolog_timed, lpp_syntax_severity_info) {
42




2
  ASSERT_TRUE(TestResult::getInstance().get(GET_CLASS_NAME(*this, nullptr)));
43
}
44
45
4
TEST(nolog_timed, lpp_syntax_severity_warning) {
46




2
  ASSERT_TRUE(TestResult::getInstance().get(GET_CLASS_NAME(*this, nullptr)));
47
}
48
49
4
TEST(nolog_timed, lpp_syntax_severity_error) {
50




2
  ASSERT_TRUE(TestResult::getInstance().get(GET_CLASS_NAME(*this, nullptr)));
51
}
52
53
4
TEST(nolog_timed, lpp_syntax_severity_fatal) {
54




2
  ASSERT_TRUE(TestResult::getInstance().get(GET_CLASS_NAME(*this, nullptr)));
55
}
56
57
4
TEST(nolog_timed, glog_syntax_severity_debug) {
58




2
  ASSERT_TRUE(TestResult::getInstance().get(GET_CLASS_NAME(*this, nullptr)));
59
}
60
61
4
TEST(nolog_timed, glog_syntax_severity_info) {
62




2
  ASSERT_TRUE(TestResult::getInstance().get(GET_CLASS_NAME(*this, nullptr)));
63
}
64
65
4
TEST(nolog_timed, glog_syntax_severity_warning) {
66




2
  ASSERT_TRUE(TestResult::getInstance().get(GET_CLASS_NAME(*this, nullptr)));
67
}
68
69
4
TEST(nolog_timed, glog_syntax_severity_error) {
70




2
  ASSERT_TRUE(TestResult::getInstance().get(GET_CLASS_NAME(*this, nullptr)));
71
}
72
73
4
TEST(nolog_timed, glog_syntax_severity_fatal) {
74




2
  ASSERT_TRUE(TestResult::getInstance().get(GET_CLASS_NAME(*this, nullptr)));
75
}
76
77
4
TEST(nolog_timed, ros_syntax_severity_debug) {
78




2
  ASSERT_TRUE(TestResult::getInstance().get(GET_CLASS_NAME(*this, nullptr)));
79
}
80
81
4
TEST(nolog_timed, ros_syntax_severity_debug_stream) {
82




2
  ASSERT_TRUE(TestResult::getInstance().get(GET_CLASS_NAME(*this, nullptr)));
83
}
84
85
4
TEST(nolog_timed, ros_syntax_severity_info) {
86




2
  ASSERT_TRUE(TestResult::getInstance().get(GET_CLASS_NAME(*this, nullptr)));
87
}
88
89
4
TEST(nolog_timed, ros_syntax_severity_info_stream) {
90




2
  ASSERT_TRUE(TestResult::getInstance().get(GET_CLASS_NAME(*this, nullptr)));
91
}
92
93
4
TEST(nolog_timed, ros_syntax_severity_warning) {
94




2
  ASSERT_TRUE(TestResult::getInstance().get(GET_CLASS_NAME(*this, nullptr)));
95
}
96
97
4
TEST(nolog_timed, ros_syntax_severity_warning_stream) {
98




2
  ASSERT_TRUE(TestResult::getInstance().get(GET_CLASS_NAME(*this, nullptr)));
99
}
100
101
4
TEST(nolog_timed, ros_syntax_severity_error) {
102




2
  ASSERT_TRUE(TestResult::getInstance().get(GET_CLASS_NAME(*this, nullptr)));
103
}
104
105
4
TEST(nolog_timed, ros_syntax_severity_error_stream) {
106




2
  ASSERT_TRUE(TestResult::getInstance().get(GET_CLASS_NAME(*this, nullptr)));
107
}
108
109
4
TEST(nolog_timed, ros_syntax_severity_fatal) {
110




2
  ASSERT_TRUE(TestResult::getInstance().get(GET_CLASS_NAME(*this, nullptr)));
111
}
112
113
2
TEST(nolog_timed, ros_syntax_severity_fatal_stream) {
114
1
  ASSERT_TRUE(TestResult::getInstance().get(GET_CLASS_NAME(*this, nullptr)));
115
}