Skip to content

Commit 191e58b

Browse files
authored
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 <[email protected]>
1 parent e7d7cef commit 191e58b

File tree

1 file changed

+7
-6
lines changed

1 file changed

+7
-6
lines changed

test/integration/parser_config.cc

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -50,10 +50,10 @@ TEST(ParserConfig, GlobalConfig)
5050

5151
ASSERT_TRUE(sdf::ParserConfig::GlobalConfig().FindFileCallback());
5252
EXPECT_EQ("test/dir2",
53-
sdf::ParserConfig::GlobalConfig().FindFileCallback()("empty"));
53+
sdf::ParserConfig::GlobalConfig().FindFileCallback()("should_not_exist"));
5454
// sdf::findFile requires explicitly enabling callbacks
55-
EXPECT_EQ("test/dir2", sdf::findFile("empty", false, true));
56-
EXPECT_EQ("test/dir2", sdf::findFile("empty", true, true));
55+
EXPECT_EQ("test/dir2", sdf::findFile("should_not_exist", false, true));
56+
EXPECT_EQ("test/dir2", sdf::findFile("should_not_exist", true, true));
5757
}
5858

5959
/////////////////////////////////////////////////
@@ -81,9 +81,10 @@ TEST(ParserConfig, NonGlobalConfig)
8181
EXPECT_EQ(it->second.front(), testDir);
8282

8383
ASSERT_TRUE(config.FindFileCallback());
84-
EXPECT_EQ("test/dir2", config.FindFileCallback()("empty"));
85-
EXPECT_EQ("test/dir2", sdf::findFile("empty", false, true, config));
86-
EXPECT_EQ("test/dir2", sdf::findFile("empty", true, true, config));
84+
EXPECT_EQ("test/dir2", config.FindFileCallback()("should_not_exist"));
85+
EXPECT_EQ("test/dir2",
86+
sdf::findFile("should_not_exist", false, true, config));
87+
EXPECT_EQ("test/dir2", sdf::findFile("should_not_exist", true, true, config));
8788

8889
EXPECT_TRUE(sdf::ParserConfig::GlobalConfig().URIPathMap().empty());
8990
EXPECT_FALSE(sdf::ParserConfig::GlobalConfig().FindFileCallback());

0 commit comments

Comments
 (0)