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
3ad24ae3
Commit
3ad24ae3
authored
1 year ago
by
Jonathan Schöbel
Browse files
Options
Downloads
Patches
Plain Diff
TextMark: added tests
parent
0f585173
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
sefht.geany
+7
-6
7 additions, 6 deletions
sefht.geany
src/lib/sefht/text_mark_internal.c
+0
-1
0 additions, 1 deletion
src/lib/sefht/text_mark_internal.c
tests/Makefile.am
+5
-0
5 additions, 0 deletions
tests/Makefile.am
tests/test_text_mark.c
+107
-0
107 additions, 0 deletions
tests/test_text_mark.c
with
119 additions
and
7 deletions
sefht.geany
+
7
−
6
View file @
3ad24ae3
...
...
@@ -28,7 +28,7 @@ long_line_behaviour=1
long_line_column=72
[files]
current_page=
25
current_page=
46
FILE_NAME_0=139;None;0;EUTF-8;1;1;0;%2Fhome%2Fjonathan%2FDokumente%2Fprojekte%2Fprgm%2Finternet%2Fweb%2FSeFHT%2FREADME;0;8
FILE_NAME_1=134;None;0;EUTF-8;1;1;0;%2Fhome%2Fjonathan%2FDokumente%2Fprojekte%2Fprgm%2Finternet%2Fweb%2FSeFHT%2F.gitignore;0;8
FILE_NAME_2=1737;Sh;0;EUTF-8;1;1;0;%2Fhome%2Fjonathan%2FDokumente%2Fprojekte%2Fprgm%2Finternet%2Fweb%2FSeFHT%2Fconfigure.ac;0;8
...
...
@@ -57,7 +57,7 @@ FILE_NAME_24=1036;C;0;EUTF-8;1;1;0;%2Fhome%2Fjonathan%2FDokumente%2Fprojekte%2Fp
FILE_NAME_25=7040;C;0;EUTF-8;1;1;0;%2Fhome%2Fjonathan%2FDokumente%2Fprojekte%2Fprgm%2Finternet%2Fweb%2FSeFHT%2Fsrc%2Flib%2Fsefht%2Ftext_segment.c;0;8
FILE_NAME_26=1083;C;0;EUTF-8;1;1;0;%2Fhome%2Fjonathan%2FDokumente%2Fprojekte%2Fprgm%2Finternet%2Fweb%2FSeFHT%2Fsrc%2Flib%2Fsefht%2Ftext_segment.h;0;8
FILE_NAME_27=903;C;0;EUTF-8;1;1;0;%2Fhome%2Fjonathan%2FDokumente%2Fprojekte%2Fprgm%2Finternet%2Fweb%2FSeFHT%2Fsrc%2Flib%2Fsefht%2Ftext_mark.c;0;8
FILE_NAME_28=1
892
;C;0;EUTF-8;1;1;0;%2Fhome%2Fjonathan%2FDokumente%2Fprojekte%2Fprgm%2Finternet%2Fweb%2FSeFHT%2Fsrc%2Flib%2Fsefht%2Ftext_mark_internal.c;0;8
FILE_NAME_28=1
156
;C;0;EUTF-8;1;1;0;%2Fhome%2Fjonathan%2FDokumente%2Fprojekte%2Fprgm%2Finternet%2Fweb%2FSeFHT%2Fsrc%2Flib%2Fsefht%2Ftext_mark_internal.c;0;8
FILE_NAME_29=24;C;0;EUTF-8;1;1;0;%2Fhome%2Fjonathan%2FDokumente%2Fprojekte%2Fprgm%2Finternet%2Fweb%2FSeFHT%2Fsrc%2Flib%2Fsefht%2Fvalidator.c;0;8
FILE_NAME_30=24;C;0;EUTF-8;1;1;0;%2Fhome%2Fjonathan%2FDokumente%2Fprojekte%2Fprgm%2Finternet%2Fweb%2FSeFHT%2Fsrc%2Flib%2Fsefht%2Fvalidator.h;0;8
FILE_NAME_31=28;C;0;EUTF-8;1;1;0;%2Fhome%2Fjonathan%2FDokumente%2Fprojekte%2Fprgm%2Finternet%2Fweb%2FSeFHT%2Fsrc%2Flib%2Fsefht%2Fvalidator_tag.c;0;8
...
...
@@ -75,10 +75,11 @@ FILE_NAME_42=33;C;0;EUTF-8;1;1;0;%2Fhome%2Fjonathan%2FDokumente%2Fprojekte%2Fprg
FILE_NAME_43=4771;C;0;EUTF-8;1;1;0;%2Fhome%2Fjonathan%2FDokumente%2Fprojekte%2Fprgm%2Finternet%2Fweb%2FSeFHT%2Ftests%2Ftest_text_fragment.c;0;8
FILE_NAME_44=24;C;0;EUTF-8;1;1;0;%2Fhome%2Fjonathan%2FDokumente%2Fprojekte%2Fprgm%2Finternet%2Fweb%2FSeFHT%2Ftests%2Ftest_attr.c;0;8
FILE_NAME_45=3584;C;0;EUTF-8;1;1;0;%2Fhome%2Fjonathan%2FDokumente%2Fprojekte%2Fprgm%2Finternet%2Fweb%2FSeFHT%2Ftests%2Ftest_text.c;0;8
FILE_NAME_46=29;C;0;EUTF-8;1;1;0;%2Fhome%2Fjonathan%2FDokumente%2Fprojekte%2Fprgm%2Finternet%2Fweb%2FSeFHT%2Ftests%2Ftest_validator.c;0;8
FILE_NAME_47=536;None;0;EUTF-8;1;1;0;%2Fhome%2Fjonathan%2FDokumente%2Fprojekte%2Fprgm%2Finternet%2Fweb%2FSeFHT%2Ftodo.txt;0;8
FILE_NAME_48=2425;YAML;0;EUTF-8;0;1;0;%2Fhome%2Fjonathan%2FDokumente%2Fprojekte%2Fprgm%2Finternet%2Fweb%2FSeFHT%2F.gitlab-ci.yml;0;4
FILE_NAME_49=354;Sh;0;EUTF-8;1;1;0;%2Fhome%2Fjonathan%2FDokumente%2Fprojekte%2Fprgm%2Finternet%2Fweb%2FSeFHT%2Fgitlab-ci%2Fupload.sh.in;0;8
FILE_NAME_46=2108;C;0;EUTF-8;1;1;0;%2Fhome%2Fjonathan%2FDokumente%2Fprojekte%2Fprgm%2Finternet%2Fweb%2FSeFHT%2Ftests%2Ftest_text_mark.c;0;8
FILE_NAME_47=29;C;0;EUTF-8;1;1;0;%2Fhome%2Fjonathan%2FDokumente%2Fprojekte%2Fprgm%2Finternet%2Fweb%2FSeFHT%2Ftests%2Ftest_validator.c;0;8
FILE_NAME_48=536;None;0;EUTF-8;1;1;0;%2Fhome%2Fjonathan%2FDokumente%2Fprojekte%2Fprgm%2Finternet%2Fweb%2FSeFHT%2Ftodo.txt;0;8
FILE_NAME_49=2425;YAML;0;EUTF-8;0;1;0;%2Fhome%2Fjonathan%2FDokumente%2Fprojekte%2Fprgm%2Finternet%2Fweb%2FSeFHT%2F.gitlab-ci.yml;0;4
FILE_NAME_50=354;Sh;0;EUTF-8;1;1;0;%2Fhome%2Fjonathan%2FDokumente%2Fprojekte%2Fprgm%2Finternet%2Fweb%2FSeFHT%2Fgitlab-ci%2Fupload.sh.in;0;8
[VTE]
last_dir=/home/jonathan/Documents/projects/prgm/internet/web/SeFHT/tests
...
...
This diff is collapsed.
Click to expand it.
src/lib/sefht/text_mark_internal.c
+
0
−
1
View file @
3ad24ae3
...
...
@@ -73,7 +73,6 @@ text_mark_new (const enum SH_MARK_TYPE type,
mark
->
next
=
NULL
;
set_success
(
status
);
return
mark
;
}
...
...
This diff is collapsed.
Click to expand it.
tests/Makefile.am
+
5
−
0
View file @
3ad24ae3
...
...
@@ -18,6 +18,7 @@ check_PROGRAMS += sefht_fragment_test
check_PROGRAMS
+=
sefht_node_fragment_test
check_PROGRAMS
+=
sefht_text_fragment_test
check_PROGRAMS
+=
sefht_text_test
check_PROGRAMS
+=
sefht_text_mark_test
XFAIL_TESTS
=
XFAIL_TESTS
+=
sefht_fragment_test
...
...
@@ -79,3 +80,7 @@ sefht_text_fragment_test_LDADD += $(LDADD)
sefht_text_test_SOURCES
=
test_text.c
sefht_text_test_LDADD
=
sefht_text_test_LDADD
+=
$(
LDADD
)
sefht_text_mark_test_SOURCES
=
test_text_mark.c
sefht_text_mark_test_LDADD
=
sefht_text_mark_test_LDADD
+=
$(
LDADD
)
This diff is collapsed.
Click to expand it.
tests/test_text_mark.c
0 → 100644
+
107
−
0
View file @
3ad24ae3
/*
* test_text_mark.c
*
* Copyright 2023 Jonathan Schöbel <jonathan@xn--schbel-yxa.info>
*
* 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
<limits.h>
#include
<stdbool.h>
#include
<stdlib.h>
#include
"log.h"
#include
"macro.h"
#include
"status.h"
#include
"text_mark_internal.c"
START_TEST
(
test_text_mark_no_status
)
{
struct
text_mark
*
mark
;
mark
=
text_mark_new
(
SH_MARK_TYPE_ABS
,
5
,
NULL
);
ck_assert_ptr_ne
(
NULL
,
mark
);
ck_assert_int_eq
(
SH_MARK_TYPE_ABS
,
mark
->
type
);
ck_assert_int_eq
(
5
,
mark
->
offset
);
ck_assert_int_eq
(
0
,
mark
->
mark_n
);
ck_assert_ptr_ne
(
NULL
,
mark
->
marks
);
ck_assert_ptr_eq
(
NULL
,
mark
->
next
);
text_mark_free
(
mark
);
}
END_TEST
START_TEST
(
test_text_mark_with_status
)
{
struct
SH_Status
status
;
struct
text_mark
*
mark
;
_status_preinit
(
status
);
mark
=
text_mark_new
(
SH_MARK_TYPE_ABS
,
5
,
&
status
);
ck_assert_ptr_ne
(
NULL
,
mark
);
ck_assert_int_eq
(
status
.
status
,
UNDEFINED
);
ck_assert_int_eq
(
SH_MARK_TYPE_ABS
,
mark
->
type
);
ck_assert_int_eq
(
5
,
mark
->
offset
);
ck_assert_int_eq
(
0
,
mark
->
mark_n
);
ck_assert_ptr_ne
(
NULL
,
mark
->
marks
);
ck_assert_ptr_eq
(
NULL
,
mark
->
next
);
text_mark_free
(
mark
);
}
END_TEST
Suite
*
test_suite
(
void
)
{
Suite
*
s
;
TCase
*
tc_core
;
s
=
suite_create
(
"Testsuite SeFHT Text Mark (internal) "
);
/* Core test case */
tc_core
=
tcase_create
(
"Core"
);
tcase_add_test
(
tc_core
,
test_text_mark_no_status
);
tcase_add_test
(
tc_core
,
test_text_mark_with_status
);
suite_add_tcase
(
s
,
tc_core
);
return
s
;
}
int
main
(
void
)
{
int
number_failed
;
Suite
*
s
;
SRunner
*
sr
;
s
=
test_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