From ba3204a5c20bed282b733d657ad3195cd991cf88 Mon Sep 17 00:00:00 2001 From: levlam Date: Sun, 17 Nov 2019 23:42:48 +0300 Subject: [PATCH] Fix tests. GitOrigin-RevId: bb970d6d9f0881c260ba92c7c53291444f2f6e84 --- tdutils/test/SharedSlice.cpp | 4 ++++ tdutils/test/log.cpp | 4 ++++ test/main.cpp | 5 +++-- 3 files changed, 11 insertions(+), 2 deletions(-) diff --git a/tdutils/test/SharedSlice.cpp b/tdutils/test/SharedSlice.cpp index e303eda7..440483c2 100644 --- a/tdutils/test/SharedSlice.cpp +++ b/tdutils/test/SharedSlice.cpp @@ -9,6 +9,9 @@ #include "td/utils/SharedSlice.h" #include "td/utils/tests.h" +char disable_linker_warning_about_empty_file_tdutils_test_shared_slice_cpp TD_UNUSED; + +#if !TD_THREAD_UNSUPPORTED TEST(SharedSlice, Hands) { { td::SharedSlice h("hello"); @@ -84,3 +87,4 @@ TEST(SharedSlice, Hands) { } } } +#endif diff --git a/tdutils/test/log.cpp b/tdutils/test/log.cpp index 4d276221..5a771a70 100644 --- a/tdutils/test/log.cpp +++ b/tdutils/test/log.cpp @@ -22,6 +22,9 @@ // LOG uses thread local LogInterface // void append(CSlice slice, int log_level); +char disable_linker_warning_about_empty_file_tdutils_test_log_cpp TD_UNUSED; + +#if !TD_THREAD_UNSUPPORTED template class LogBenchmark : public td::Benchmark { public: @@ -125,3 +128,4 @@ TEST(Log, TsLogger) { return td::make_unique(); }); } +#endif diff --git a/test/main.cpp b/test/main.cpp index c0f31cea..e10b116d 100644 --- a/test/main.cpp +++ b/test/main.cpp @@ -30,8 +30,9 @@ int main(int argc, char **argv) { } #if TD_EMSCRIPTEN emscripten_set_main_loop( - [&runner] { - if (!runner.run_all_step()) { + [] { + td::TestsRunner &default_runner = td::TestsRunner::get_default(); + if (!default_runner.run_all_step()) { emscripten_cancel_main_loop(); } },