From cd2419137d68781354325d77c0392ab0ee1b65de Mon Sep 17 00:00:00 2001 From: Rachel Powers <508861+Ryex@users.noreply.github.com> Date: Thu, 9 Feb 2023 20:12:36 -0700 Subject: [PATCH] fix: better test compareison (also qt5 compat) Signed-off-by: Rachel Powers <508861+Ryex@users.noreply.github.com> --- tests/FileSystem_test.cpp | 38 +++++++++++++++++++------------------- 1 file changed, 19 insertions(+), 19 deletions(-) diff --git a/tests/FileSystem_test.cpp b/tests/FileSystem_test.cpp index 4418dd627..ab78c1509 100644 --- a/tests/FileSystem_test.cpp +++ b/tests/FileSystem_test.cpp @@ -755,28 +755,28 @@ slots: } void test_path_depth() { - QCOMPARE_EQ(FS::PathDepth(""), 0); - QCOMPARE_EQ(FS::PathDepth("."), 0); - QCOMPARE_EQ(FS::PathDepth("foo.txt"), 0); - QCOMPARE_EQ(FS::PathDepth("./foo.txt"), 0); - QCOMPARE_EQ(FS::PathDepth("./bar/foo.txt"), 1); - QCOMPARE_EQ(FS::PathDepth("../bar/foo.txt"), 0); - QCOMPARE_EQ(FS::PathDepth("/bar/foo.txt"), 1); - QCOMPARE_EQ(FS::PathDepth("baz/bar/foo.txt"), 2); - QCOMPARE_EQ(FS::PathDepth("/baz/bar/foo.txt"), 2); - QCOMPARE_EQ(FS::PathDepth("./baz/bar/foo.txt"), 2); - QCOMPARE_EQ(FS::PathDepth("/baz/../bar/foo.txt"), 1); + QCOMPARE(FS::PathDepth(""), 0); + QCOMPARE(FS::PathDepth("."), 0); + QCOMPARE(FS::PathDepth("foo.txt"), 0); + QCOMPARE(FS::PathDepth("./foo.txt"), 0); + QCOMPARE(FS::PathDepth("./bar/foo.txt"), 1); + QCOMPARE(FS::PathDepth("../bar/foo.txt"), 0); + QCOMPARE(FS::PathDepth("/bar/foo.txt"), 1); + QCOMPARE(FS::PathDepth("baz/bar/foo.txt"), 2); + QCOMPARE(FS::PathDepth("/baz/bar/foo.txt"), 2); + QCOMPARE(FS::PathDepth("./baz/bar/foo.txt"), 2); + QCOMPARE(FS::PathDepth("/baz/../bar/foo.txt"), 1); } void test_path_trunc() { - QCOMPARE_EQ(FS::PathTruncate("", 0), ""); - QCOMPARE_EQ(FS::PathTruncate("foo.txt", 0), ""); - QCOMPARE_EQ(FS::PathTruncate("foo.txt", 1), ""); - QCOMPARE_EQ(FS::PathTruncate("./bar/foo.txt", 0), "./bar"); - QCOMPARE_EQ(FS::PathTruncate("./bar/foo.txt", 1), "./bar"); - QCOMPARE_EQ(FS::PathTruncate("/bar/foo.txt", 1), "/bar"); - QCOMPARE_EQ(FS::PathTruncate("bar/foo.txt", 1), "bar"); - QCOMPARE_EQ(FS::PathTruncate("baz/bar/foo.txt", 2), "baz/bar"); + QCOMPARE(FS::PathTruncate("", 0), ""); + QCOMPARE(FS::PathTruncate("foo.txt", 0), ""); + QCOMPARE(FS::PathTruncate("foo.txt", 1), ""); + QCOMPARE(FS::PathTruncate("./bar/foo.txt", 0), "./bar"); + QCOMPARE(FS::PathTruncate("./bar/foo.txt", 1), "./bar"); + QCOMPARE(FS::PathTruncate("/bar/foo.txt", 1), "/bar"); + QCOMPARE(FS::PathTruncate("bar/foo.txt", 1), "bar"); + QCOMPARE(FS::PathTruncate("baz/bar/foo.txt", 2), "baz/bar"); } };