|
14 | 14 | using namespace network::logging;
|
15 | 15 |
|
16 | 16 | BOOST_AUTO_TEST_CASE(default_constructor) {
|
17 |
| - log_record record; |
18 |
| - BOOST_CHECK( record.message() == "" ); |
19 |
| - BOOST_CHECK( record.filename() == log_record::UNKNOWN_FILE_NAME ); |
20 |
| - BOOST_CHECK( record.line() == 0 ); |
| 17 | + log_record record; |
| 18 | + BOOST_CHECK( record.message() == "" ); |
| 19 | + BOOST_CHECK( record.filename() == log_record::UNKNOWN_FILE_NAME ); |
| 20 | + BOOST_CHECK( record.line() == 0 ); |
21 | 21 | }
|
22 | 22 |
|
23 | 23 | BOOST_AUTO_TEST_CASE(cstring_constructor) {
|
24 |
| - const auto message = "This is a test."; |
25 |
| - log_record record( message ); |
26 |
| - BOOST_CHECK( record.message() == message ); |
27 |
| - BOOST_CHECK( record.filename() == log_record::UNKNOWN_FILE_NAME ); |
28 |
| - BOOST_CHECK( record.line() == 0 ); |
| 24 | + const auto message = "This is a test."; |
| 25 | + log_record record( message ); |
| 26 | + BOOST_CHECK( record.message() == message ); |
| 27 | + BOOST_CHECK( record.filename() == log_record::UNKNOWN_FILE_NAME ); |
| 28 | + BOOST_CHECK( record.line() == 0 ); |
29 | 29 | }
|
30 | 30 |
|
31 | 31 | BOOST_AUTO_TEST_CASE(string_constructor) {
|
32 |
| - const std::string message("This is a test."); |
33 |
| - log_record record( message ); |
34 |
| - BOOST_CHECK( record.message() == message ); |
35 |
| - BOOST_CHECK( record.filename() == log_record::UNKNOWN_FILE_NAME ); |
36 |
| - BOOST_CHECK( record.line() == 0 ); |
| 32 | + const std::string message("This is a test."); |
| 33 | + log_record record( message ); |
| 34 | + BOOST_CHECK( record.message() == message ); |
| 35 | + BOOST_CHECK( record.filename() == log_record::UNKNOWN_FILE_NAME ); |
| 36 | + BOOST_CHECK( record.line() == 0 ); |
37 | 37 | }
|
38 | 38 |
|
39 | 39 | BOOST_AUTO_TEST_CASE(int_constructor) {
|
40 |
| - const auto num = 42; |
41 |
| - log_record record( num ); |
42 |
| - BOOST_CHECK( record.message() == std::to_string( num ) ); |
43 |
| - BOOST_CHECK( record.filename() == log_record::UNKNOWN_FILE_NAME ); |
44 |
| - BOOST_CHECK( record.line() == 0 ); |
| 40 | + const auto num = 42; |
| 41 | + log_record record( num ); |
| 42 | + BOOST_CHECK( record.message() == std::to_string( num ) ); |
| 43 | + BOOST_CHECK( record.filename() == log_record::UNKNOWN_FILE_NAME ); |
| 44 | + BOOST_CHECK( record.line() == 0 ); |
45 | 45 | }
|
46 | 46 |
|
47 | 47 | BOOST_AUTO_TEST_CASE(info_constructor) {
|
48 |
| - const auto line_num = 42; |
49 |
| - const auto file_name = "somewhere.cpp"; |
50 |
| - log_record record( file_name, line_num ); |
51 |
| - BOOST_CHECK( record.message() == "" ); |
52 |
| - BOOST_CHECK( record.filename() == file_name ); |
53 |
| - BOOST_CHECK( record.line() == line_num ); |
| 48 | + const auto line_num = 42; |
| 49 | + const auto file_name = "somewhere.cpp"; |
| 50 | + log_record record( file_name, line_num ); |
| 51 | + BOOST_CHECK( record.message() == "" ); |
| 52 | + BOOST_CHECK( record.filename() == file_name ); |
| 53 | + BOOST_CHECK( record.line() == line_num ); |
54 | 54 | }
|
55 | 55 |
|
56 | 56 | BOOST_AUTO_TEST_CASE(text_stream) {
|
57 |
| - const auto line_num = 42; |
58 |
| - const auto file_name = "somewhere.cpp"; |
59 |
| - const auto message = "At line " + std::to_string(line_num) + " we check the code."; |
60 |
| - log_record record( file_name, line_num ); |
| 57 | + const auto line_num = 42; |
| 58 | + const auto file_name = "somewhere.cpp"; |
| 59 | + const auto message = "At line " + std::to_string(line_num) + " we check the code."; |
| 60 | + log_record record( file_name, line_num ); |
61 | 61 |
|
62 |
| - record << "At line " << line_num << " we check the code."; |
| 62 | + record << "At line " << line_num << " we check the code."; |
63 | 63 |
|
64 |
| - BOOST_CHECK( record.message() == message ); |
65 |
| - BOOST_CHECK( record.filename() == file_name ); |
66 |
| - BOOST_CHECK( record.line() == line_num ); |
| 64 | + BOOST_CHECK( record.message() == message ); |
| 65 | + BOOST_CHECK( record.filename() == file_name ); |
| 66 | + BOOST_CHECK( record.line() == line_num ); |
67 | 67 | }
|
0 commit comments