File tree Expand file tree Collapse file tree 10 files changed +13
-20
lines changed
Expand file tree Collapse file tree 10 files changed +13
-20
lines changed Original file line number Diff line number Diff line change @@ -83,14 +83,11 @@ int main() {
8383 logSomeMessages ();
8484
8585 /* remove tmp file */
86- bool removed = std::filesystem::remove ( tmpFile );
87- if ( !removed ) {
86+ if ( !std::filesystem::remove ( tmpFile ) ) {
8887
8988 std::cout << " Tmp file cannot be removed: " << tmpFile << std::endl;
9089 return EXIT_FAILURE;
9190 }
9291 std::cout << " Tmp file was removed: " << tmpFile << std::endl;
9392 return EXIT_SUCCESS;
94-
95- return EXIT_SUCCESS;
9693}
Original file line number Diff line number Diff line change @@ -102,8 +102,7 @@ int main() {
102102 threads.clear ();
103103
104104 /* remove tmp file */
105- bool removed = std::filesystem::remove ( tmpFile );
106- if ( !removed ) {
105+ if ( !std::filesystem::remove ( tmpFile ) ) {
107106
108107 std::cout << " Tmp file cannot be removed: " << tmpFile << std::endl;
109108 return EXIT_FAILURE;
Original file line number Diff line number Diff line change @@ -85,7 +85,7 @@ namespace vx {
8585 * @brief Create thread-safe timestamp.
8686 * @return Timestamp as 'Y-m-dThh:mm:ss.xxxxxx'
8787 */
88- inline const std::string timestamp () noexcept {
88+ inline std::string timestamp () noexcept {
8989
9090 /* get a precise timestamp as a string */
9191 struct std ::tm currentLocalTime {};
Original file line number Diff line number Diff line change 3131/* stl header */
3232#include < algorithm>
3333#include < fstream>
34+ #include < iostream>
3435
3536/* local header */
3637#include " TestHelper.h"
@@ -51,7 +52,7 @@ namespace vx::TestHelper {
5152 catch ( [[maybe_unused]] const std::exception &_exception ) {
5253
5354 /* nothing to do, file cannot be closed. */
54- // std::cout << _exception.what() << std::endl;
55+ std::cout << _exception.what () << std::endl;
5556 }
5657 }
5758 return count;
Original file line number Diff line number Diff line change @@ -119,8 +119,7 @@ namespace vx {
119119
120120 std::size_t count = TestHelper::countNewLines ( tmpFile );
121121
122- bool removed = std::filesystem::remove ( tmpFile );
123- if ( !removed ) {
122+ if ( !std::filesystem::remove ( tmpFile ) ) {
124123
125124 CPPUNIT_FAIL ( " Tmp file cannot be removed: " + tmpFile );
126125 }
Original file line number Diff line number Diff line change @@ -118,8 +118,7 @@ namespace vx {
118118
119119 std::size_t count = TestHelper::countNewLines ( tmpFile );
120120
121- bool removed = std::filesystem::remove ( tmpFile );
122- if ( !removed ) {
121+ if ( !std::filesystem::remove ( tmpFile ) ) {
123122
124123 CPPUNIT_FAIL ( " Tmp file cannot be removed: " + tmpFile );
125124 }
Original file line number Diff line number Diff line change @@ -110,7 +110,7 @@ namespace vx {
110110 threads.reserve ( hardwareThreadCount );
111111 for ( unsigned int n = 0 ; n < hardwareThreadCount; ++n ) {
112112
113- threads.emplace_back ( std::thread ( [&] {
113+ threads.emplace_back ( std::thread ( [&hardwareThreadCount ] {
114114
115115 std::ostringstream s;
116116 s << logMessage;
@@ -135,8 +135,7 @@ namespace vx {
135135
136136 std::size_t count = TestHelper::countNewLines ( tmpFile );
137137
138- bool removed = std::filesystem::remove ( tmpFile );
139- if ( !removed ) {
138+ if ( !std::filesystem::remove ( tmpFile ) ) {
140139
141140 CPPUNIT_FAIL ( " Tmp file cannot be removed: " + tmpFile );
142141 }
Original file line number Diff line number Diff line change @@ -93,7 +93,7 @@ namespace vx {
9393 threads.reserve ( hardwareThreadCount );
9494 for ( unsigned int n = 0 ; n < hardwareThreadCount; ++n ) {
9595
96- threads.emplace_back ( std::thread ( [&] {
96+ threads.emplace_back ( std::thread ( [&hardwareThreadCount ] {
9797
9898 std::ostringstream s;
9999 s << logMessage;
Original file line number Diff line number Diff line change @@ -93,7 +93,7 @@ namespace vx {
9393 threads.reserve ( hardwareThreadCount );
9494 for ( unsigned int n = 0 ; n < hardwareThreadCount; ++n ) {
9595
96- threads.emplace_back ( std::thread ( [&] {
96+ threads.emplace_back ( std::thread ( [&hardwareThreadCount ] {
9797
9898 std::ostringstream s;
9999 s << logMessage;
Original file line number Diff line number Diff line change @@ -109,7 +109,7 @@ namespace vx {
109109 threads.reserve ( hardwareThreadCount );
110110 for ( unsigned int n = 0 ; n < hardwareThreadCount; ++n ) {
111111
112- threads.emplace_back ( std::thread ( [&] {
112+ threads.emplace_back ( std::thread ( [&hardwareThreadCount ] {
113113
114114 std::ostringstream s;
115115 s << logMessage;
@@ -134,8 +134,7 @@ namespace vx {
134134
135135 std::size_t count = TestHelper::countNewLines ( tmpFile );
136136
137- bool removed = std::filesystem::remove ( tmpFile );
138- if ( !removed ) {
137+ if ( !std::filesystem::remove ( tmpFile ) ) {
139138
140139 CPPUNIT_FAIL ( " Tmp file cannot be removed: " + tmpFile );
141140 }
You can’t perform that action at this time.
0 commit comments