From 2c49458b6cfa5164d425248051c9c48ea84819b3 Mon Sep 17 00:00:00 2001 From: Lukasz Gromanowski Date: Sat, 31 Aug 2013 00:13:42 +0200 Subject: [PATCH] Added unittests for FileFinder::FileFinderStrict class. Signed-off-by: Lukasz Gromanowski --- .../components/file_finder/test_filefinder.cpp | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/apps/openmw_test_suite/components/file_finder/test_filefinder.cpp b/apps/openmw_test_suite/components/file_finder/test_filefinder.cpp index cf34570d7..2d151988b 100644 --- a/apps/openmw_test_suite/components/file_finder/test_filefinder.cpp +++ b/apps/openmw_test_suite/components/file_finder/test_filefinder.cpp @@ -1,4 +1,3 @@ -//FileFinderT #include #include #include "components/file_finder/file_finder.hpp" @@ -50,3 +49,18 @@ TEST_F(FileFinderTest, FileFinder_does_not_have_file) ASSERT_TRUE(fileFinder.lookup(mTestFileNotFound).empty()); } +TEST_F(FileFinderTest, FileFinderStrict_has_file) +{ + FileFinder::FileFinderStrict fileFinder(mTestDir); + ASSERT_TRUE(fileFinder.has(mTestFile)); + ASSERT_FALSE(fileFinder.has(mTestFileUppercase)); + ASSERT_TRUE(fileFinder.lookup(mTestFile) == std::string(mTestDir + mTestFile)); + ASSERT_FALSE(fileFinder.lookup(mTestFileUppercase) == std::string(mTestDir + mTestFile)); +} + +TEST_F(FileFinderTest, FileFinderStrict_does_not_have_file) +{ + FileFinder::FileFinderStrict fileFinder(mTestDir); + ASSERT_FALSE(fileFinder.has(mTestFileNotFound)); + ASSERT_TRUE(fileFinder.lookup(mTestFileNotFound).empty()); +}