Skip to content

Commit 45ee0b2

Browse files
committed
Add unit tests for subdirectory lookup
1 parent 62f1d5c commit 45ee0b2

5 files changed

Lines changed: 35 additions & 0 deletions

File tree

‎test/src/cfile/test_cfile.cpp‎

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
2+
#include <gtest/gtest.h>
3+
4+
#include <cfile/cfile.h>
5+
6+
#include "util/FSTestFixture.h"
7+
8+
class CFileTest : public test::FSTestFixture {
9+
public:
10+
CFileTest() : test::FSTestFixture(0) {
11+
pushModDir("cfile");
12+
}
13+
};
14+
15+
TEST_F(CFileTest, temp_subdir) {
16+
ASSERT_FALSE(cf_exists_full("test_001.dds", CF_TYPE_ANY));
17+
18+
ASSERT_TRUE(cf_set_temp_subdir_pathtype("test.eff"));
19+
20+
ASSERT_TRUE(cf_exists_full("test_001.dds", CF_TYPE_ANY));
21+
}
22+
23+
TEST_F(CFileTest, temp_subdir_vps) {
24+
ASSERT_FALSE(cf_exists_full("test_001.dds", CF_TYPE_ANY));
25+
26+
ASSERT_TRUE(cf_set_temp_subdir_pathtype("test.eff"));
27+
28+
ASSERT_TRUE(cf_exists_full("test_001.dds", CF_TYPE_ANY));
29+
}

‎test/src/source_groups.cmake‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,10 @@ add_file_folder(root ""
1212
test_stubs.cpp
1313
)
1414

15+
add_file_folder(graphics "CFile"
16+
cfile/test_cfile.cpp
17+
)
18+
1519
add_file_folder(graphics "Globalincs"
1620
globalincs/test_flagset.cpp
1721
globalincs/test_safe_strings.cpp
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Dummy file
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
dummy content
391 Bytes
Binary file not shown.

0 commit comments

Comments
 (0)