[fix] test api log to stderr
Some checks failed
Verification / Is-Buildable (push) Failing after 2m45s
Some checks failed
Verification / Is-Buildable (push) Failing after 2m45s
This commit is contained in:
parent
1f2245e342
commit
be4dc501ae
@ -4,7 +4,6 @@
|
|||||||
|
|
||||||
#include <condition_variable>
|
#include <condition_variable>
|
||||||
#include <glog/logging.h>
|
#include <glog/logging.h>
|
||||||
#include <list>
|
|
||||||
#include <mutex>
|
#include <mutex>
|
||||||
#include <queue>
|
#include <queue>
|
||||||
#include <set>
|
#include <set>
|
||||||
@ -17,7 +16,7 @@ class TestThread {
|
|||||||
{{
|
{{
|
||||||
"jsonrpc": "2.0",
|
"jsonrpc": "2.0",
|
||||||
"method": "{}",
|
"method": "{}",
|
||||||
"params": {{}},
|
"params": {{}},
|
||||||
"id": 1
|
"id": 1
|
||||||
}}
|
}}
|
||||||
)",
|
)",
|
||||||
@ -48,9 +47,8 @@ class TestThread {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (state.load() && calls_queue.empty())
|
if (state.load() && calls_queue.empty())
|
||||||
cv.wait_for(lock, thr_sleep, [&] {
|
cv.wait_for(lock, thr_sleep,
|
||||||
return stoken.stop_requested();
|
[&] { return stoken.stop_requested(); });
|
||||||
});
|
|
||||||
|
|
||||||
lock.unlock();
|
lock.unlock();
|
||||||
}
|
}
|
||||||
@ -138,8 +136,10 @@ class TestThread {
|
|||||||
extern "C" {
|
extern "C" {
|
||||||
|
|
||||||
void crpc_test_init() {
|
void crpc_test_init() {
|
||||||
if (!google::IsGoogleLoggingInitialized())
|
if (!google::IsGoogleLoggingInitialized()) {
|
||||||
google::InitGoogleLogging("TestRPC");
|
google::InitGoogleLogging("TestRPC");
|
||||||
|
google::LogToStderr();
|
||||||
|
}
|
||||||
try {
|
try {
|
||||||
test.start();
|
test.start();
|
||||||
} catch (const std::exception &e) {
|
} catch (const std::exception &e) {
|
||||||
@ -171,4 +171,4 @@ void crpc_test_schedule_call(rpc_string *name) { test.add_queue_call(name->s); }
|
|||||||
void crpc_test_auto_call(uint32_t state) {
|
void crpc_test_auto_call(uint32_t state) {
|
||||||
test.auto_call(static_cast<bool>(state));
|
test.auto_call(static_cast<bool>(state));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user