From 191e58bc761330ed51dd3a30e64cb6db7401e623 Mon Sep 17 00:00:00 2001 From: Scott K Logan Date: Tue, 30 Jan 2024 14:50:33 -0600 Subject: [PATCH] In parser config test, use a filename less likely to exist (#1362) * 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 | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/test/integration/parser_config.cc b/test/integration/parser_config.cc index 577bbd01a..31a3e2a64 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,10 @@ 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());