From: Lucian Petrut Date: Mon, 24 Apr 2023 14:36:43 +0000 (+0000) Subject: test/dokan: avoid runtime dependent assertion X-Git-Tag: v19.0.0~575^2~7 X-Git-Url: http://git.apps.os.sepia.ceph.com/?a=commitdiff_plain;h=82ef35db701cdf16a606522504cc1b4ea18e38ce;p=ceph.git test/dokan: avoid runtime dependent assertion We're checking a permission denied exception message that's runtime specific: /mnt/data/workspace/ceph_mingw_clang/src/test/dokan/dokan.cc:252: Failure Expected equality of these values: e.what() Which is: "filesystem error: in remove: Permission denied [\"Z:\\ro_success_b76223c4-c590-45e0-ab78-4d281ac512b5\"]" exception_msg.c_str() Which is: "filesystem error: cannot remove: No such device [Z:\\ro_success_b76223c4-c590-45e0-ab78-4d281ac512b5]" In order to support libc++, we'll drop the exception message assertion and rely on the exception type. Signed-off-by: Lucian Petrut --- diff --git a/src/test/dokan/dokan.cc b/src/test/dokan/dokan.cc index 1a1d39580e6dd..18f206985e8b1 100644 --- a/src/test/dokan/dokan.cc +++ b/src/test/dokan/dokan.cc @@ -242,16 +242,9 @@ TEST_F(DokanTests, test_mount_read_only) { ASSERT_TRUE(fs::exists(mountpoint + success_file_path)); ASSERT_EQ(read_file(mountpoint + success_file_path), data); - std::string exception_msg( - "filesystem error: cannot remove: No such device [" - + mountpoint + success_file_path + "]"); + // The actual exception message is runtime dependent. EXPECT_THROW({ - try { - fs::remove(mountpoint + success_file_path); - } catch(const fs::filesystem_error &e) { - EXPECT_STREQ(e.what(), exception_msg.c_str()); - throw; - } + fs::remove(mountpoint + success_file_path); }, fs::filesystem_error); unmap_dokan(mount, mountpoint.c_str());