File: clog.cc

package info (click to toggle)
pytorch 1.13.1%2Bdfsg-4
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 139,252 kB
  • sloc: cpp: 1,100,274; python: 706,454; ansic: 83,052; asm: 7,618; java: 3,273; sh: 2,841; javascript: 612; makefile: 323; xml: 269; ruby: 185; yacc: 144; objc: 68; lex: 44
file content (46 lines) | stat: -rw-r--r-- 1,820 bytes parent folder | download | duplicates (12)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
#include <gtest/gtest.h>

#include <clog.h>

CLOG_DEFINE_LOG_DEBUG(named_log_debug, "Unit Test", CLOG_DEBUG);
CLOG_DEFINE_LOG_INFO(named_log_info, "Unit Test", CLOG_INFO);
CLOG_DEFINE_LOG_WARNING(named_log_warning, "Unit Test", CLOG_WARNING);
CLOG_DEFINE_LOG_ERROR(named_log_error, "Unit Test", CLOG_ERROR);
CLOG_DEFINE_LOG_FATAL(named_log_fatal, "Unit Test", CLOG_FATAL);

CLOG_DEFINE_LOG_DEBUG(nameless_log_debug, NULL, CLOG_DEBUG);
CLOG_DEFINE_LOG_INFO(nameless_log_info, NULL, CLOG_INFO);
CLOG_DEFINE_LOG_WARNING(nameless_log_warning, NULL, CLOG_WARNING);
CLOG_DEFINE_LOG_ERROR(nameless_log_error, NULL, CLOG_ERROR);
CLOG_DEFINE_LOG_FATAL(nameless_log_fatal, NULL, CLOG_FATAL);

CLOG_DEFINE_LOG_DEBUG(suppressed_log_debug, NULL, CLOG_INFO);
CLOG_DEFINE_LOG_INFO(suppressed_log_info, NULL, CLOG_WARNING);
CLOG_DEFINE_LOG_WARNING(suppressed_log_warning, NULL, CLOG_ERROR);
CLOG_DEFINE_LOG_ERROR(suppressed_log_error, NULL, CLOG_FATAL);
CLOG_DEFINE_LOG_FATAL(suppressed_log_fatal, NULL, CLOG_NONE);


TEST(CLOG, debug) {
	named_log_debug("test debug message with a module name");
	nameless_log_debug("test debug message without a module name");
	suppressed_log_debug("test suppressed debug message");
}

TEST(CLOG, info) {
	named_log_info("test info message with a module name");
	nameless_log_info("test info message without a module name");
	suppressed_log_info("test suppressed info message");
}

TEST(CLOG, warning) {
	named_log_warning("test warning message with a module name");
	nameless_log_warning("test warning message without a module name");
	suppressed_log_warning("test suppressed warning message");
}

TEST(CLOG, error) {
	named_log_error("test error message with a module name");
	nameless_log_error("test error message without a module name");
	suppressed_log_error("test suppressed error message");
}