Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit6b9c321

Browse files
committed
Fixed indentation.
1 parentf89c2f2 commit6b9c321

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
staticconstchar* 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
namespacenetwork {namespacelogging {
1515

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

1818

1919
namespacehandler
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-
PROPERTIESCOMPILE_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-
PROPERTIESRUNTIME_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+
PROPERTIESCOMPILE_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+
PROPERTIESRUNTIME_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
usingnamespacenetwork::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-
constauto line_num =42;
27-
constauto file_name ="somewhere.cpp";
28-
constauto 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-
constauto 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+
constauto line_num =42;
27+
constauto file_name ="somewhere.cpp";
28+
constauto 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+
constauto 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
usingnamespacenetwork::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-
constauto message ="This is a test.";
25-
log_recordrecord( message );
26-
BOOST_CHECK( record.message() == message );
27-
BOOST_CHECK( record.filename() == log_record::UNKNOWN_FILE_NAME );
28-
BOOST_CHECK( record.line() ==0 );
24+
constauto message ="This is a test.";
25+
log_recordrecord( 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::stringmessage("This is a test.");
33-
log_recordrecord( 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::stringmessage("This is a test.");
33+
log_recordrecord( 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-
constauto num =42;
41-
log_recordrecord( 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+
constauto num =42;
41+
log_recordrecord( 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-
constauto line_num =42;
49-
constauto file_name ="somewhere.cpp";
50-
log_recordrecord( file_name, line_num );
51-
BOOST_CHECK( record.message() =="" );
52-
BOOST_CHECK( record.filename() == file_name );
53-
BOOST_CHECK( record.line() == line_num );
48+
constauto line_num =42;
49+
constauto file_name ="somewhere.cpp";
50+
log_recordrecord( 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-
constauto line_num =42;
58-
constauto file_name ="somewhere.cpp";
59-
constauto message ="At line" +std::to_string(line_num) +" we check the code.";
60-
log_recordrecord( file_name, line_num );
57+
constauto line_num =42;
58+
constauto file_name ="somewhere.cpp";
59+
constauto message ="At line" +std::to_string(line_num) +" we check the code.";
60+
log_recordrecord( 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)

[8]ページ先頭

©2009-2025 Movatter.jp