Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
MPAI-Private
MPAI-CAE
arp
Video Analyzer
Commits
ea06c519
Commit
ea06c519
authored
Jun 08, 2023
by
Matteo
Browse files
update unit tests
parent
97f6b447
Changes
2
Hide whitespace changes
Inline
Side-by-side
CMakeLists.txt
View file @
ea06c519
...
...
@@ -70,6 +70,7 @@ ADD_EXECUTABLE(
tests/irregularity_test.cpp
tests/enums_test.cpp
tests/core_test.cpp
tests/files_test.cpp
)
TARGET_LINK_LIBRARIES
(
...
...
tests/files_test.cpp
0 → 100644
View file @
ea06c519
#include
"../src/lib/files.hpp"
#include
<gtest/gtest.h>
using
namespace
files
;
TEST
(
Files
,
SaveFile
)
{
std
::
string
content
=
"test"
;
std
::
filesystem
::
path
fileName
=
"tests/test.txt"
;
save_file
(
fileName
,
content
);
std
::
ifstream
file
(
fileName
);
std
::
string
line
;
std
::
getline
(
file
,
line
);
EXPECT_EQ
(
line
,
content
);
file
.
close
();
std
::
filesystem
::
remove
(
fileName
);
}
TEST
(
Files
,
GetFilenameAndExtension
)
{
std
::
string
videoPath
=
"tests/images/test_scene_01.jpg"
;
std
::
pair
<
std
::
string
,
std
::
string
>
result
=
get_filename_and_extension
(
videoPath
);
EXPECT_EQ
(
result
.
first
,
"test_scene_01"
);
EXPECT_EQ
(
result
.
second
,
"jpg"
);
}
\ No newline at end of file
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment