Skip to content

Commit

Permalink
Remove Unicode content tests and related setup from FileUtilTest
Browse files Browse the repository at this point in the history
  • Loading branch information
barnasm1 committed Jan 29, 2025
1 parent bab5a77 commit b8cf8dc
Showing 1 changed file with 0 additions and 60 deletions.
60 changes: 0 additions & 60 deletions src/core/tests/file_util.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -509,13 +509,6 @@ INSTANTIATE_TEST_SUITE_P(
std::make_tuple(ov::util::Path(U"D:\\いろはにほへど\\猫!.txt"), ov::util::Path(U"D:\\いろはにほへど\\"))));

class FileUtilTest : public ::testing::Test {
public:
static constexpr auto char_unicode_content = "这是一个测试文件。"sv;
static constexpr auto u8_unicode_content = u8"这是一个测试文件。"sv;
static constexpr auto u16_unicode_content = u"这是一个测试文件。"sv;
static constexpr auto u32_unicode_content = U"这是一个测试文件。"sv;
static constexpr auto wchar_unicode_content = L"这是一个测试文件。"sv;

protected:
void SetUp() override {
// Create a temporary files for testing
Expand Down Expand Up @@ -563,28 +556,6 @@ class FileUtilTest : public ::testing::Test {
}
#endif

#ifdef OPENVINO_ENABLE_UNICODE_PATH_SUPPORT
{
std::ofstream outfile("test_file_char.txt");
outfile << char_unicode_content.data() << std::endl;
}
{
std::ofstream outfile("test_file_u8.txt");
outfile << u8_unicode_content.data() << std::endl;
}
{
std::ofstream outfile("test_file_u16.txt");
outfile << u16_unicode_content.data() << std::endl;
}
{
std::ofstream outfile("test_file_u32.txt");
outfile << u32_unicode_content.data() << std::endl;
}
{
std::ofstream outfile("test_file_wchar.txt");
outfile << wchar_unicode_content.data() << std::endl;
}
#endif
#if defined(__ANDROID__) || defined(ANDROID)
{
std::ofstream outfile("android_test_file_21.txt");
Expand All @@ -605,13 +576,6 @@ class FileUtilTest : public ::testing::Test {
std::filesystem::remove(U"这是_u32_.txt");
std::filesystem::remove(ov::util::make_path(L"这是_wstring_.txt"));
#endif
#ifdef OPENVINO_ENABLE_UNICODE_PATH_SUPPORT
std::filesystem::remove("test_file_char.txt");
std::filesystem::remove("test_file_u8.txt");
std::filesystem::remove("test_file_u16.txt");
std::filesystem::remove("test_file_u32.txt");
std::filesystem::remove("test_file_wchar.txt");
#endif
#if defined(__ANDROID__) || defined(ANDROID)
std::filesystem::remove("android_test_file_21.txt");
#endif
Expand Down Expand Up @@ -707,27 +671,3 @@ TEST_F(FileUtilTest, androidWithCutFileSizeTest) {
EXPECT_EQ(ov::util::file_size(ov::util::Path("android_test_file_21.txt!_to_cut.jar")), 21);
}
#endif

#ifdef OPENVINO_ENABLE_UNICODE_PATH_SUPPORT
TEST_F(FileUtilTest, FileSizeTestUnicodeContent) {
EXPECT_EQ(ov::util::file_size("test_file_char.txt"s), char_unicode_content.size() + 1);
}

# ifdef OPENVINO_CPP_VER_AT_LEAST_20
TEST_F(FileUtilTest, u8FileSizeTestUnicodeContent) {
EXPECT_EQ(ov::util::file_size("test_file_u8.txt"s), u8_unicode_content.size() + 1);
}
# endif

TEST_F(FileUtilTest, u16FileSizeTestUnicodeContent) {
EXPECT_EQ(ov::util::file_size("test_file_u16.txt"s), u16_unicode_content.size() + 1);
}

TEST_F(FileUtilTest, u32FileSizeTestUnicodeContent) {
EXPECT_EQ(ov::util::file_size("test_file_u32.txt"s), u32_unicode_content.size() + 1);
}

TEST_F(FileUtilTest, wstringFileSizeTestUnicodeContent) {
EXPECT_EQ(ov::util::file_size("test_file_wchar.txt"s), wchar_unicode_content.size() + 1);
}
#endif

0 comments on commit b8cf8dc

Please sign in to comment.