From 5d79d1889fc6aa30324c25ecfed35191b088c7b2 Mon Sep 17 00:00:00 2001 From: Scott K Logan Date: Tue, 30 Jan 2024 12:53:43 -0600 Subject: [PATCH 1/2] In parser config test, use a filename less likely to exist The file /usr/share/empty is not unique enough to guarantee that it does not exist, and the test seems to require that there be no file or directory with that name. On Fedora, the file /usr/share/empty is present on every single system. Signed-off-by: Scott K Logan --- test/integration/parser_config.cc | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/test/integration/parser_config.cc b/test/integration/parser_config.cc index 577bbd01a..8982e60f7 100644 --- a/test/integration/parser_config.cc +++ b/test/integration/parser_config.cc @@ -50,10 +50,10 @@ TEST(ParserConfig, GlobalConfig) ASSERT_TRUE(sdf::ParserConfig::GlobalConfig().FindFileCallback()); EXPECT_EQ("test/dir2", - sdf::ParserConfig::GlobalConfig().FindFileCallback()("empty")); + sdf::ParserConfig::GlobalConfig().FindFileCallback()("should_not_exist")); // sdf::findFile requires explicitly enabling callbacks - EXPECT_EQ("test/dir2", sdf::findFile("empty", false, true)); - EXPECT_EQ("test/dir2", sdf::findFile("empty", true, true)); + EXPECT_EQ("test/dir2", sdf::findFile("should_not_exist", false, true)); + EXPECT_EQ("test/dir2", sdf::findFile("should_not_exist", true, true)); } ///////////////////////////////////////////////// @@ -81,9 +81,9 @@ TEST(ParserConfig, NonGlobalConfig) EXPECT_EQ(it->second.front(), testDir); ASSERT_TRUE(config.FindFileCallback()); - EXPECT_EQ("test/dir2", config.FindFileCallback()("empty")); - EXPECT_EQ("test/dir2", sdf::findFile("empty", false, true, config)); - EXPECT_EQ("test/dir2", sdf::findFile("empty", true, true, config)); + EXPECT_EQ("test/dir2", config.FindFileCallback()("should_not_exist")); + EXPECT_EQ("test/dir2", sdf::findFile("should_not_exist", false, true, config)); + EXPECT_EQ("test/dir2", sdf::findFile("should_not_exist", true, true, config)); EXPECT_TRUE(sdf::ParserConfig::GlobalConfig().URIPathMap().empty()); EXPECT_FALSE(sdf::ParserConfig::GlobalConfig().FindFileCallback()); From 0ec8b40d9464176c965020bf11116fb939c9e7df Mon Sep 17 00:00:00 2001 From: Scott K Logan Date: Tue, 30 Jan 2024 13:44:51 -0600 Subject: [PATCH 2/2] Break a long line to please the linters Signed-off-by: Scott K Logan --- test/integration/parser_config.cc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/test/integration/parser_config.cc b/test/integration/parser_config.cc index 8982e60f7..31a3e2a64 100644 --- a/test/integration/parser_config.cc +++ b/test/integration/parser_config.cc @@ -82,7 +82,8 @@ TEST(ParserConfig, NonGlobalConfig) ASSERT_TRUE(config.FindFileCallback()); EXPECT_EQ("test/dir2", config.FindFileCallback()("should_not_exist")); - EXPECT_EQ("test/dir2", sdf::findFile("should_not_exist", false, true, config)); + EXPECT_EQ("test/dir2", + sdf::findFile("should_not_exist", false, true, config)); EXPECT_EQ("test/dir2", sdf::findFile("should_not_exist", true, true, config)); EXPECT_TRUE(sdf::ParserConfig::GlobalConfig().URIPathMap().empty());