diff options
author | Arne Juul <arnej@verizonmedia.com> | 2021-02-15 13:54:24 +0000 |
---|---|---|
committer | Arne Juul <arnej@verizonmedia.com> | 2021-02-15 14:16:17 +0000 |
commit | c0b8734987176a93588909739af143c6b0a1a6ff (patch) | |
tree | 33340f0cfc5e9e4b8691abdaa378712f3bf8ded5 /vespalib/src/tests/executor | |
parent | e385cf1498861b27da4312828613bdabab9b2161 (diff) |
use size literals in vespalib
Diffstat (limited to 'vespalib/src/tests/executor')
-rw-r--r-- | vespalib/src/tests/executor/blockingthreadstackexecutor_test.cpp | 7 | ||||
-rw-r--r-- | vespalib/src/tests/executor/threadstackexecutor_test.cpp | 5 |
2 files changed, 7 insertions, 5 deletions
diff --git a/vespalib/src/tests/executor/blockingthreadstackexecutor_test.cpp b/vespalib/src/tests/executor/blockingthreadstackexecutor_test.cpp index a0ef200ab83..e26a0931090 100644 --- a/vespalib/src/tests/executor/blockingthreadstackexecutor_test.cpp +++ b/vespalib/src/tests/executor/blockingthreadstackexecutor_test.cpp @@ -4,6 +4,7 @@ #include <vespa/vespalib/util/blockingthreadstackexecutor.h> #include <vespa/vespalib/util/executor.h> #include <vespa/vespalib/util/backtrace.h> +#include <vespa/vespalib/util/size_literals.h> #include <thread> using namespace vespalib; @@ -122,14 +123,14 @@ vespalib::string get_worker_stack_trace(BlockingThreadStackExecutor &executor) { VESPA_THREAD_STACK_TAG(my_stack_tag); -TEST_F("require that executor has appropriate default thread stack tag", BlockingThreadStackExecutor(1, 128*1024, 10)) { +TEST_F("require that executor has appropriate default thread stack tag", BlockingThreadStackExecutor(1, 128_Ki, 10)) { vespalib::string trace = get_worker_stack_trace(f1); if (!EXPECT_TRUE(trace.find("unnamed_blocking_executor") != vespalib::string::npos)) { fprintf(stderr, "%s\n", trace.c_str()); } } -TEST_F("require that executor thread stack tag can be set", BlockingThreadStackExecutor(1, 128*1024, 10, my_stack_tag)) { +TEST_F("require that executor thread stack tag can be set", BlockingThreadStackExecutor(1, 128_Ki, 10, my_stack_tag)) { vespalib::string trace = get_worker_stack_trace(f1); if (!EXPECT_TRUE(trace.find("my_stack_tag") != vespalib::string::npos)) { fprintf(stderr, "%s\n", trace.c_str()); @@ -139,7 +140,7 @@ TEST_F("require that executor thread stack tag can be set", BlockingThreadStackE TEST_F("require that tasks posted from internal worker thread will not block executor", TimeBomb(60)) { size_t cnt = 0; Gate fork_done; - BlockingThreadStackExecutor executor(1, 128*1024, 10); + BlockingThreadStackExecutor executor(1, 128_Ki, 10); struct IncTask : Executor::Task { size_t &cnt; IncTask(size_t &cnt_in) : cnt(cnt_in) {} diff --git a/vespalib/src/tests/executor/threadstackexecutor_test.cpp b/vespalib/src/tests/executor/threadstackexecutor_test.cpp index e860a25c83c..a830a7a6c2b 100644 --- a/vespalib/src/tests/executor/threadstackexecutor_test.cpp +++ b/vespalib/src/tests/executor/threadstackexecutor_test.cpp @@ -3,6 +3,7 @@ #include <vespa/vespalib/util/threadstackexecutor.h> #include <vespa/vespalib/util/backtrace.h> +#include <vespa/vespalib/util/size_literals.h> #include <atomic> using namespace vespalib; @@ -171,14 +172,14 @@ vespalib::string get_worker_stack_trace(ThreadStackExecutor &executor) { VESPA_THREAD_STACK_TAG(my_stack_tag); -TEST_F("require that executor has appropriate default thread stack tag", ThreadStackExecutor(1, 128*1024)) { +TEST_F("require that executor has appropriate default thread stack tag", ThreadStackExecutor(1, 128_Ki)) { vespalib::string trace = get_worker_stack_trace(f1); if (!EXPECT_TRUE(trace.find("unnamed_nonblocking_executor") != vespalib::string::npos)) { fprintf(stderr, "%s\n", trace.c_str()); } } -TEST_F("require that executor thread stack tag can be set", ThreadStackExecutor(1, 128*1024, my_stack_tag)) { +TEST_F("require that executor thread stack tag can be set", ThreadStackExecutor(1, 128_Ki, my_stack_tag)) { vespalib::string trace = get_worker_stack_trace(f1); if (!EXPECT_TRUE(trace.find("my_stack_tag") != vespalib::string::npos)) { fprintf(stderr, "%s\n", trace.c_str()); |