Add ThreadIdGuard to tests and tg_cli.
This commit is contained in:
parent
6f3dc2afb1
commit
2b9b9f0c31
@ -31,6 +31,7 @@
|
|||||||
#include "td/utils/misc.h"
|
#include "td/utils/misc.h"
|
||||||
#include "td/utils/NullLog.h"
|
#include "td/utils/NullLog.h"
|
||||||
#include "td/utils/OptionParser.h"
|
#include "td/utils/OptionParser.h"
|
||||||
|
#include "td/utils/port/detail/ThreadIdGuard.h"
|
||||||
#include "td/utils/port/FileFd.h"
|
#include "td/utils/port/FileFd.h"
|
||||||
#include "td/utils/port/PollFlags.h"
|
#include "td/utils/port/PollFlags.h"
|
||||||
#include "td/utils/port/signals.h"
|
#include "td/utils/port/signals.h"
|
||||||
@ -4593,6 +4594,7 @@ static void on_log_message(int verbosity_level, const char *message) {
|
|||||||
|
|
||||||
void main(int argc, char **argv) {
|
void main(int argc, char **argv) {
|
||||||
ExitGuard exit_guard;
|
ExitGuard exit_guard;
|
||||||
|
detail::ThreadIdGuard thread_id_guard;
|
||||||
ignore_signal(SignalType::HangUp).ensure();
|
ignore_signal(SignalType::HangUp).ensure();
|
||||||
ignore_signal(SignalType::Pipe).ensure();
|
ignore_signal(SignalType::Pipe).ensure();
|
||||||
set_signal_handler(SignalType::Error, fail_signal).ensure();
|
set_signal_handler(SignalType::Error, fail_signal).ensure();
|
||||||
|
@ -11,6 +11,7 @@
|
|||||||
#include "td/utils/common.h"
|
#include "td/utils/common.h"
|
||||||
#include "td/utils/crypto.h"
|
#include "td/utils/crypto.h"
|
||||||
#include "td/utils/logging.h"
|
#include "td/utils/logging.h"
|
||||||
|
#include "td/utils/port/detail/ThreadIdGuard.h"
|
||||||
#include "td/utils/ScopeGuard.h"
|
#include "td/utils/ScopeGuard.h"
|
||||||
#include "td/utils/SharedSlice.h"
|
#include "td/utils/SharedSlice.h"
|
||||||
#include "td/utils/Slice.h"
|
#include "td/utils/Slice.h"
|
||||||
@ -274,6 +275,7 @@ static HandshakeTest pregenerated_test() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
int main() {
|
int main() {
|
||||||
|
td::detail::ThreadIdGuard thread_id_guard;
|
||||||
auto test = gen_test();
|
auto test = gen_test();
|
||||||
run_test(test);
|
run_test(test);
|
||||||
run_test(pregenerated_test());
|
run_test(pregenerated_test());
|
||||||
|
@ -8,6 +8,7 @@
|
|||||||
#include "td/utils/crypto.h"
|
#include "td/utils/crypto.h"
|
||||||
#include "td/utils/logging.h"
|
#include "td/utils/logging.h"
|
||||||
#include "td/utils/OptionParser.h"
|
#include "td/utils/OptionParser.h"
|
||||||
|
#include "td/utils/port/detail/ThreadIdGuard.h"
|
||||||
#include "td/utils/Slice.h"
|
#include "td/utils/Slice.h"
|
||||||
#include "td/utils/tests.h"
|
#include "td/utils/tests.h"
|
||||||
|
|
||||||
@ -16,6 +17,7 @@
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
int main(int argc, char **argv) {
|
int main(int argc, char **argv) {
|
||||||
|
td::detail::ThreadIdGuard thread_id_guard;
|
||||||
td::init_openssl_threads();
|
td::init_openssl_threads();
|
||||||
|
|
||||||
td::TestsRunner &runner = td::TestsRunner::get_default();
|
td::TestsRunner &runner = td::TestsRunner::get_default();
|
||||||
|
Loading…
Reference in New Issue
Block a user