From b9bbf802bd9cdc8e487ccb06a94569586be561e1 Mon Sep 17 00:00:00 2001 From: Megvii Engine Team Date: Fri, 26 Feb 2021 19:02:09 +0800 Subject: [PATCH] fix(mgb/opr): fix string append error GitOrigin-RevId: 295a941eddead18a3691d0b789278d505bbb48a8 --- src/core/include/megbrain/utils/metahelper.h | 2 +- src/plugin/test/opr_io_dump.cpp | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/core/include/megbrain/utils/metahelper.h b/src/core/include/megbrain/utils/metahelper.h index b9909b14..b44d5288 100644 --- a/src/core/include/megbrain/utils/metahelper.h +++ b/src/core/include/megbrain/utils/metahelper.h @@ -122,7 +122,7 @@ class DynTypeObj { //! get class name from class object #define _MGB_TYPEINFO_CLASS_NAME(_cls) #_cls #else -#define _MGB_TYPEINFO_CLASS_NAME(_cls) nullptr +#define _MGB_TYPEINFO_CLASS_NAME(_cls) "" #endif //! put in the impl file of a class that needs static typeinfo() diff --git a/src/plugin/test/opr_io_dump.cpp b/src/plugin/test/opr_io_dump.cpp index 78d65e68..3b05ceb6 100644 --- a/src/plugin/test/opr_io_dump.cpp +++ b/src/plugin/test/opr_io_dump.cpp @@ -147,7 +147,7 @@ std::vector getlines(std::istream& inp, size_t skip_head = 0) { } } // anonymous namespace - +#if MGB_VERBOSE_TYPEINFO_NAME TEST(TestOprIODump, Text) { auto fname_base = output_file("test_opr_iodump"); std::array fnames; @@ -180,8 +180,10 @@ TEST(TestOprIODump, Text) { run_test(make_plugin, check_result); } +#endif TEST(TestOprIODump, StdErr) { + MGB_MARK_USED_VAR(EXPECTED_TEXT_OUT_REC); HostTensorGenerator<> gen; auto host_x = gen({5}); auto host_y = gen({5});