From fc83448117706f2e11e415fc730adf6c8c42efc0 Mon Sep 17 00:00:00 2001 From: Jinzhe Zeng Date: Tue, 28 Feb 2023 16:11:34 -0500 Subject: [PATCH 1/2] fix `TestReadFileToString.readfiletostring` Fix #2346. Signed-off-by: Jinzhe Zeng --- source/api_cc/tests/test_read_file_to_string.cc | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/source/api_cc/tests/test_read_file_to_string.cc b/source/api_cc/tests/test_read_file_to_string.cc index 2aa6be7e6f..9535606c17 100644 --- a/source/api_cc/tests/test_read_file_to_string.cc +++ b/source/api_cc/tests/test_read_file_to_string.cc @@ -12,10 +12,8 @@ #include "common.h" TEST(TestReadFileToString, readfiletostring) { - std::string file_name = "../../tests/infer/deeppot.pbtxt"; - deepmd::convert_pbtxt_to_pb(file_name, "deeppot.pb"); std::string file_content; - deepmd::read_file_to_string("deeppot.pb", file_content); + deepmd::read_file_to_string("../../tests/infer/deeppot.txt", file_content); remove("deeppot.pb"); std::string file_name_2 = "../../tests/infer/deeppot.txt"; From 8fa8e38567d0a0ca5e9535f004a0a362d1061684 Mon Sep 17 00:00:00 2001 From: Jinzhe Zeng Date: Tue, 28 Feb 2023 17:15:01 -0500 Subject: [PATCH 2/2] remove remove Signed-off-by: Jinzhe Zeng --- source/api_cc/tests/test_read_file_to_string.cc | 1 - 1 file changed, 1 deletion(-) diff --git a/source/api_cc/tests/test_read_file_to_string.cc b/source/api_cc/tests/test_read_file_to_string.cc index 9535606c17..b4ceda5598 100644 --- a/source/api_cc/tests/test_read_file_to_string.cc +++ b/source/api_cc/tests/test_read_file_to_string.cc @@ -14,7 +14,6 @@ TEST(TestReadFileToString, readfiletostring) { std::string file_content; deepmd::read_file_to_string("../../tests/infer/deeppot.txt", file_content); - remove("deeppot.pb"); std::string file_name_2 = "../../tests/infer/deeppot.txt"; std::stringstream buffer;