Skip to content

Commit b5fdb63

Browse files
committed
tests: add test case for pmdb::tpl::ensureFilesExist()
1 parent 93bc70b commit b5fdb63

File tree

3 files changed

+39
-0
lines changed

3 files changed

+39
-0
lines changed

tests/components/CMakeLists.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,9 +29,11 @@ set(component_tests_sources
2929
../../code/filters/FilterUser.cpp
3030
../../code/paths.cpp
3131
../../code/templates/defaults.hpp
32+
../../code/templates/functions.cpp
3233
../../libstriezel/common/DirectoryFileList.cpp
3334
../../libstriezel/common/StringUtils.cpp
3435
../../libstriezel/filesystem/directory.cpp
36+
../../libstriezel/filesystem/file.cpp
3537
../../libstriezel/hash/sha256/BufferSource.cpp
3638
../../libstriezel/hash/sha256/BufferSourceUtility.cpp
3739
../../libstriezel/hash/sha256/MessageSource.cpp
@@ -61,6 +63,7 @@ set(component_tests_sources
6163
names_to_controlsequences.cpp
6264
paths.cpp
6365
templates/defaults.cpp
66+
templates/functions.cpp
6467
main.cpp)
6568

6669
if (CMAKE_CXX_COMPILER_ID STREQUAL "GNU" OR CMAKE_CXX_COMPILER_ID STREQUAL "Clang")

tests/components/component_tests.cbp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,12 +85,16 @@
8585
<Unit filename="../../code/paths.cpp" />
8686
<Unit filename="../../code/paths.hpp" />
8787
<Unit filename="../../code/templates/defaults.hpp" />
88+
<Unit filename="../../code/templates/functions.cpp" />
89+
<Unit filename="../../code/templates/functions.hpp" />
8890
<Unit filename="../../libstriezel/common/DirectoryFileList.cpp" />
8991
<Unit filename="../../libstriezel/common/DirectoryFileList.hpp" />
9092
<Unit filename="../../libstriezel/common/StringUtils.cpp" />
9193
<Unit filename="../../libstriezel/common/StringUtils.hpp" />
9294
<Unit filename="../../libstriezel/filesystem/directory.cpp" />
9395
<Unit filename="../../libstriezel/filesystem/directory.hpp" />
96+
<Unit filename="../../libstriezel/filesystem/file.cpp" />
97+
<Unit filename="../../libstriezel/filesystem/file.hpp" />
9498
<Unit filename="../../libstriezel/hash/sha256/BufferSource.cpp" />
9599
<Unit filename="../../libstriezel/hash/sha256/BufferSource.hpp" />
96100
<Unit filename="../../libstriezel/hash/sha256/BufferSourceUtility.cpp" />
@@ -127,6 +131,7 @@
127131
<Unit filename="names_to_controlsequences.cpp" />
128132
<Unit filename="paths.cpp" />
129133
<Unit filename="templates/defaults.cpp" />
134+
<Unit filename="templates/functions.cpp" />
130135
<Extensions>
131136
<lib_finder disable_auto="1" />
132137
</Extensions>
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
/*
2+
-------------------------------------------------------------------------------
3+
This file is part of the Private Message Database test suite.
4+
Copyright (C) 2025 Dirk Stolle
5+
6+
This program is free software: you can redistribute it and/or modify
7+
it under the terms of the GNU General Public License as published by
8+
the Free Software Foundation, either version 3 of the License, or
9+
(at your option) any later version.
10+
11+
This program is distributed in the hope that it will be useful,
12+
but WITHOUT ANY WARRANTY; without even the implied warranty of
13+
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14+
GNU General Public License for more details.
15+
16+
You should have received a copy of the GNU General Public License
17+
along with this program. If not, see <http://www.gnu.org/licenses/>.
18+
-------------------------------------------------------------------------------
19+
*/
20+
21+
#include "../../locate_catch.hpp"
22+
#include "../../../code/templates/functions.hpp"
23+
24+
TEST_CASE("pmdb::tpl::functions")
25+
{
26+
SECTION("ensureFilesExist")
27+
{
28+
const int code = pmdb::tpl::ensureFilesExist();
29+
REQUIRE( code == 0 );
30+
}
31+
}

0 commit comments

Comments
 (0)