Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
S
SeFHT
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Operate
Terraform modules
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
josc941e
SeFHT
Commits
6f933e85
Commit
6f933e85
authored
2 years ago
by
Jonathan Schöbel
Browse files
Options
Downloads
Patches
Plain Diff
added test for Fragment
parent
a4dac113
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
sefht.geany
+4
-3
4 additions, 3 deletions
sefht.geany
tests/Makefile.am
+6
-0
6 additions, 0 deletions
tests/Makefile.am
tests/test_fragment.c
+82
-0
82 additions, 0 deletions
tests/test_fragment.c
with
92 additions
and
3 deletions
sefht.geany
+
4
−
3
View file @
6f933e85
...
...
@@ -28,7 +28,7 @@ long_line_behaviour=1
long_line_column=72
[files]
current_page=1
5
current_page=1
6
FILE_NAME_0=839;Sh;0;EUTF-8;1;1;0;%2Fhome%2Fjonathan%2FDokumente%2Fprojekte%2Fprgm%2Finternet%2Fweb%2FSeFHT%2Fconfigure.ac;0;8
FILE_NAME_1=280;Make;0;EUTF-8;1;1;0;%2Fhome%2Fjonathan%2FDokumente%2Fprojekte%2Fprgm%2Finternet%2Fweb%2FSeFHT%2Fsrc%2FMakefile.am;0;8
FILE_NAME_2=1023;C;0;EUTF-8;1;1;0;%2Fhome%2Fjonathan%2FDokumente%2Fprojekte%2Fprgm%2Finternet%2Fweb%2FSeFHT%2Fsrc%2Fmain.c;0;8
...
...
@@ -42,10 +42,11 @@ FILE_NAME_9=902;C;0;EUTF-8;1;1;0;%2Fhome%2Fjonathan%2FDokumente%2Fprojekte%2Fprg
FILE_NAME_10=0;C;0;EUTF-8;1;1;0;%2Fhome%2Fjonathan%2FDokumente%2Fprojekte%2Fprgm%2Finternet%2Fweb%2FSeFHT%2Fsrc%2Flog.h;0;4
FILE_NAME_11=847;C;0;EUTF-8;1;1;0;%2Fhome%2Fjonathan%2FDokumente%2Fprojekte%2Fprgm%2Finternet%2Fweb%2FSeFHT%2Fsrc%2Fmacro.h;0;8
FILE_NAME_12=917;C;0;EUTF-8;1;1;0;%2Fhome%2Fjonathan%2FDokumente%2Fprojekte%2Fprgm%2Finternet%2Fweb%2FSeFHT%2Fsrc%2Fsefht.h;0;8
FILE_NAME_13=
515
;Make;0;EUTF-8;1;1;0;%2Fhome%2Fjonathan%2FDokumente%2Fprojekte%2Fprgm%2Finternet%2Fweb%2FSeFHT%2Ftests%2FMakefile.am;0;8
FILE_NAME_13=
804
;Make;0;EUTF-8;1;1;0;%2Fhome%2Fjonathan%2FDokumente%2Fprojekte%2Fprgm%2Finternet%2Fweb%2FSeFHT%2Ftests%2FMakefile.am;0;8
FILE_NAME_14=1253;C;0;EUTF-8;1;1;0;%2Fhome%2Fjonathan%2FDokumente%2Fprojekte%2Fprgm%2Finternet%2Fweb%2FSeFHT%2Ftests%2Ftest_cms.c;0;8
FILE_NAME_15=3391;C;0;EUTF-8;1;1;0;%2Fhome%2Fjonathan%2FDokumente%2Fprojekte%2Fprgm%2Finternet%2Fweb%2FSeFHT%2Ftests%2Ftest_data.c;0;8
FILE_NAME_16=26;None;0;EUTF-8;1;1;0;%2Fhome%2Fjonathan%2FDokumente%2Fprojekte%2Fprgm%2Finternet%2Fweb%2FSeFHT%2Ftodo.txt;0;8
FILE_NAME_16=1685;C;0;EUTF-8;1;1;0;%2Fhome%2Fjonathan%2FDokumente%2Fprojekte%2Fprgm%2Finternet%2Fweb%2FSeFHT%2Ftests%2Ftest_fragment.c;0;8
FILE_NAME_17=26;None;0;EUTF-8;1;1;0;%2Fhome%2Fjonathan%2FDokumente%2Fprojekte%2Fprgm%2Finternet%2Fweb%2FSeFHT%2Ftodo.txt;0;8
[VTE]
last_dir=/home/jonathan/Dokumente/projekte/prgm/internet/web/SeFHT/tests
...
...
This diff is collapsed.
Click to expand it.
tests/Makefile.am
+
6
−
0
View file @
6f933e85
...
...
@@ -5,6 +5,7 @@ AM_CFLAGS = -Wall -Wextra $(CHECK_CFLAGS)
TESTS
=
TESTS
+=
sefht_cms_test
TESTS
+=
sefht_data_test
TESTS
+=
sefht_fragment_test
check_PROGRAMS
=
$(
TESTS
)
...
...
@@ -23,3 +24,8 @@ sefht_data_test_SOURCES = test_data.c
sefht_data_test_LDADD
=
sefht_data_test_LDADD
+=
$(
top_builddir
)
/src/data.o
sefht_data_test_LDADD
+=
$(
LDADD
)
sefht_fragment_test_SOURCES
=
test_fragment.c
sefht_fragment_test_LDADD
=
sefht_fragment_test_LDADD
+=
$(
top_builddir
)
/src/fragment.o
sefht_fragment_test_LDADD
+=
$(
LDADD
)
This diff is collapsed.
Click to expand it.
tests/test_fragment.c
0 → 100644
+
82
−
0
View file @
6f933e85
/*
* test_fragment.c
*
* Copyright 2022 Jonathan Schöbel <jonathan@Ubermos-2019>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
* MA 02110-1301, USA.
*
*
*/
#include
<check.h>
#include
<stdlib.h>
#include
"error.h"
#include
"fragment.h"
START_TEST
(
test_fragment
)
{
struct
SH_Error
error
;
struct
SH_Fragment
*
fragment
;
fragment
=
SH_Fragment_new
(
NULL
);
ck_assert_int_ne
((
long
int
)
fragment
,
(
long
int
)
NULL
);
SH_Fragment_free
(
fragment
,
NULL
);
fragment
=
SH_Fragment_new
(
&
error
);
ck_assert_int_ne
((
long
int
)
fragment
,
(
long
int
)
NULL
);
ck_assert_int_eq
(
error
.
type
,
SUCCESS
);
SH_Fragment_free
(
fragment
,
&
error
);
ck_assert_int_eq
(
error
.
type
,
SUCCESS
);
}
END_TEST
Suite
*
fragment_suite
(
void
)
{
Suite
*
s
;
TCase
*
tc_core
;
s
=
suite_create
(
"Testsuite SeFHT Fragment"
);
/* Core test case */
tc_core
=
tcase_create
(
"Core"
);
tcase_add_test
(
tc_core
,
test_fragment
);
suite_add_tcase
(
s
,
tc_core
);
return
s
;
}
int
main
(
int
argc
,
char
**
argv
)
{
int
number_failed
;
Suite
*
s
;
SRunner
*
sr
;
s
=
fragment_suite
();
sr
=
srunner_create
(
s
);
srunner_run_all
(
sr
,
CK_NORMAL
);
number_failed
=
srunner_ntests_failed
(
sr
);
srunner_free
(
sr
);
return
(
number_failed
==
0
)
?
EXIT_SUCCESS
:
EXIT_FAILURE
;
}
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
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!
Save comment
Cancel
Please
register
or
sign in
to comment