Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Z
zathura
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
114
Issues
114
List
Boards
Labels
Milestones
Merge Requests
4
Merge Requests
4
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
pwmt
zathura
Commits
29472cdd
Commit
29472cdd
authored
Jan 28, 2012
by
Moritz Lipp
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added file_get_extension test cases
parent
8ddbb158
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
15 additions
and
2 deletions
+15
-2
tests/Makefile
tests/Makefile
+1
-1
tests/test_utils.c
tests/test_utils.c
+14
-1
No files found.
tests/Makefile
View file @
29472cdd
...
...
@@ -21,7 +21,7 @@ endif
all
:
options ${PROJECT} run
run
:
run
:
${PROJECT}
$(QUIET)
./
${PROJECT}
options
:
...
...
tests/test_utils.c
View file @
29472cdd
...
...
@@ -9,7 +9,18 @@ START_TEST(test_file_exists_null) {
}
END_TEST
START_TEST
(
test_file_get_extension_null
)
{
fail_unless
(
file_get_extension
(
NULL
)
==
false
);
fail_unless
(
file_get_extension
(
NULL
)
==
NULL
);
}
END_TEST
START_TEST
(
test_file_get_extension_none
)
{
const
char
*
path
=
"test"
;
fail_unless
(
file_get_extension
(
path
)
==
NULL
);
}
END_TEST
START_TEST
(
test_file_get_extension_single
)
{
const
char
*
path
=
"test.pdf"
;
const
char
*
extension
=
file_get_extension
(
path
);
fail_unless
(
strcmp
(
extension
,
"pdf"
)
==
0
);
}
END_TEST
Suite
*
suite_utils
()
...
...
@@ -25,6 +36,8 @@ Suite* suite_utils()
/* file exists */
tcase
=
tcase_create
(
"file_get_extension"
);
tcase_add_test
(
tcase
,
test_file_get_extension_null
);
tcase_add_test
(
tcase
,
test_file_get_extension_none
);
tcase_add_test
(
tcase
,
test_file_get_extension_single
);
suite_add_tcase
(
suite
,
tcase
);
return
suite
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a 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