Skip to content

Commit

Permalink
In parser config test, use a filename less likely to exist
Browse files Browse the repository at this point in the history
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]>
  • Loading branch information
cottsay committed Jan 30, 2024
1 parent e7d7cef commit 5d79d18
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions test/integration/parser_config.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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));
}

/////////////////////////////////////////////////
Expand Down Expand Up @@ -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());
Expand Down

0 comments on commit 5d79d18

Please sign in to comment.