Skip to content

Commit 6b9c321

Browse files
committed
Fixed indentation.
1 parent f89c2f2 commit 6b9c321

File tree

5 files changed

+76
-76
lines changed

5 files changed

+76
-76
lines changed

include/network/logging/logging.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ class log_record
3131
public:
3232
log_record()
3333
: m_filename( UNKNOWN_FILE_NAME )
34-
, m_line(0)
34+
, m_line(0)
3535
{} // = default;
3636

3737
static const char* UNKNOWN_FILE_NAME;

libs/network/src/logging/logging.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313

1414
namespace network { namespace logging {
1515

16-
const char* log_record::UNKNOWN_FILE_NAME = "unknown";
16+
const char* log_record::UNKNOWN_FILE_NAME = "unknown";
1717

1818

1919
namespace handler
Lines changed: 22 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,29 @@
1-
# Copyright (c) A. Joel Lamotte 2012.
1+
# Copyright (c) A. Joel Lamotte 2012.
22
# Distributed under the Boost Software License, Version 1.0.
3-
# (See accompanying file LICENSE_1_0.txt or copy at
4-
# http://www.boost.org/LICENSE_1_0.txt)
3+
# (See accompanying file LICENSE_1_0.txt or copy at
4+
# http://www.boost.org/LICENSE_1_0.txt)
55

66
include_directories(${CPP-NETLIB_SOURCE_DIR}/include)
77
include_directories(${CPP-NETLIB_SOURCE_DIR})
88

99
if (Boost_FOUND)
10-
set(
11-
TESTS
12-
logging_log_record
13-
logging_custom_handler
14-
)
15-
foreach (test ${TESTS})
16-
if (${CMAKE_CXX_COMPILER_ID} MATCHES GNU)
17-
set_source_files_properties(${test}.cpp
18-
PROPERTIES COMPILE_FLAGS "-Wall")
19-
endif()
20-
add_executable(cpp-netlib-${test} ${test}.cpp)
21-
add_dependencies(cpp-netlib-${test} cppnetlib-logging)
22-
target_link_libraries(cpp-netlib-${test}
23-
${Boost_LIBRARIES} cppnetlib-logging)
24-
set_target_properties(cpp-netlib-${test}
25-
PROPERTIES RUNTIME_OUTPUT_DIRECTORY ${CPP-NETLIB_BINARY_DIR}/tests)
26-
add_test(cpp-netlib-${test}
27-
${CPP-NETLIB_BINARY_DIR}/tests/cpp-netlib-${test})
28-
endforeach (test)
10+
set(
11+
TESTS
12+
logging_log_record
13+
logging_custom_handler
14+
)
15+
foreach (test ${TESTS})
16+
if (${CMAKE_CXX_COMPILER_ID} MATCHES GNU)
17+
set_source_files_properties(${test}.cpp
18+
PROPERTIES COMPILE_FLAGS "-Wall")
19+
endif()
20+
add_executable(cpp-netlib-${test} ${test}.cpp)
21+
add_dependencies(cpp-netlib-${test} cppnetlib-logging)
22+
target_link_libraries(cpp-netlib-${test}
23+
${Boost_LIBRARIES} cppnetlib-logging)
24+
set_target_properties(cpp-netlib-${test}
25+
PROPERTIES RUNTIME_OUTPUT_DIRECTORY ${CPP-NETLIB_BINARY_DIR}/tests)
26+
add_test(cpp-netlib-${test}
27+
${CPP-NETLIB_BINARY_DIR}/tests/cpp-netlib-${test})
28+
endforeach (test)
2929
endif()

libs/network/test/logging/logging_custom_handler.cpp

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -15,23 +15,23 @@
1515
using namespace network::logging;
1616

1717
BOOST_AUTO_TEST_CASE(custom_log_handler_output) {
18-
19-
std::stringstream log_output;
20-
auto custom_log_handler = [&]( const log_record& log )
21-
{
22-
log_output << "[CPPNETLIB]<" << log.filename() << ":" << log.line() << "> "
23-
<< log.message();
24-
};
25-
26-
const auto line_num = 42;
27-
const auto file_name = "somewhere.cpp";
28-
const auto message = "At line " + std::to_string(line_num) + " we check the code.";
29-
30-
set_log_record_handler( custom_log_handler );
31-
log_record( file_name, line_num ) << "At line " << line_num << " we check the code.";
32-
33-
const auto result_output = log_output.str();
34-
35-
BOOST_CHECK( !result_output.empty() );
36-
BOOST_CHECK( result_output == "[CPPNETLIB]<somewhere.cpp:42> " + message );
18+
19+
std::stringstream log_output;
20+
auto custom_log_handler = [&]( const log_record& log )
21+
{
22+
log_output << "[CPPNETLIB]<" << log.filename() << ":" << log.line() << "> "
23+
<< log.message();
24+
};
25+
26+
const auto line_num = 42;
27+
const auto file_name = "somewhere.cpp";
28+
const auto message = "At line " + std::to_string(line_num) + " we check the code.";
29+
30+
set_log_record_handler( custom_log_handler );
31+
log_record( file_name, line_num ) << "At line " << line_num << " we check the code.";
32+
33+
const auto result_output = log_output.str();
34+
35+
BOOST_CHECK( !result_output.empty() );
36+
BOOST_CHECK( result_output == "[CPPNETLIB]<somewhere.cpp:42> " + message );
3737
}

libs/network/test/logging/logging_log_record.cpp

Lines changed: 33 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -14,54 +14,54 @@
1414
using namespace network::logging;
1515

1616
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 );
2121
}
2222

2323
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 );
2929
}
3030

3131
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 );
3737
}
3838

3939
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 );
4545
}
4646

4747
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 );
5454
}
5555

5656
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 );
6161

62-
record << "At line " << line_num << " we check the code.";
62+
record << "At line " << line_num << " we check the code.";
6363

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 );
6767
}

0 commit comments

Comments
 (0)