This is an automated email from the ASF dual-hosted git repository.
emmenlau pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/thrift.git
The following commit(s) were added to refs/heads/master by this push:
new d327636da lib/cpp/test/concurrency/Tests.cpp: Very minor code cleanup
(whitespace changes only)
new 35b319baa Merge pull request #2866 from
BioDataAnalysis/emmenlau_minor_test_improvement
d327636da is described below
commit d327636dad1933a2a1211b7a91a48a51ee2aa3be
Author: Mario Emmenlauer <[email protected]>
AuthorDate: Sun Sep 25 18:58:55 2022 +0200
lib/cpp/test/concurrency/Tests.cpp: Very minor code cleanup (whitespace
changes only)
---
lib/cpp/test/concurrency/Tests.cpp | 13 +++++++------
1 file changed, 7 insertions(+), 6 deletions(-)
diff --git a/lib/cpp/test/concurrency/Tests.cpp
b/lib/cpp/test/concurrency/Tests.cpp
index 8c734c2d5..45054a92a 100644
--- a/lib/cpp/test/concurrency/Tests.cpp
+++ b/lib/cpp/test/concurrency/Tests.cpp
@@ -20,6 +20,7 @@
#include <iostream>
#include <vector>
#include <string>
+#include <chrono>
#include "ThreadFactoryTests.h"
#include "TimerManagerTests.h"
@@ -31,7 +32,7 @@ static int WEIGHT = 10;
int main(int argc, char** argv) {
- std::vector<std::string> args(argc - 1 > 1 ? argc - 1 : 1);
+ std::vector<std::string> args((argc - 1) > 1 ? (argc - 1) : 1);
args[0] = "all";
@@ -44,7 +45,7 @@ int main(int argc, char** argv) {
WEIGHT = 1;
}
- bool runAll = args[0].compare("all") == 0;
+ const bool runAll = args[0].compare("all") == 0;
if (runAll || args[0].compare("thread-factory") == 0) {
@@ -52,10 +53,10 @@ int main(int argc, char** argv) {
std::cout << "ThreadFactory tests..." << std::endl;
- int reapLoops = 2 * WEIGHT;
- int reapCount = 100 * WEIGHT;
- size_t floodLoops = 3;
- size_t floodCount = 500 * WEIGHT;
+ const int reapLoops = 2 * WEIGHT;
+ const int reapCount = 100 * WEIGHT;
+ const size_t floodLoops = 3;
+ const size_t floodCount = 500 * WEIGHT;
std::cout << "\t\tThreadFactory reap N threads test: N = " << reapLoops <<
"x" << reapCount << std::endl;