Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
girara
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
4
Issues
4
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
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
girara
Commits
62982432
Commit
62982432
authored
Sep 10, 2018
by
Sebastian Ramacher
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Print glib CRITICALs with a note that they are expected
parent
a2d37b8e
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
28 additions
and
2 deletions
+28
-2
tests/test_datastructures.c
tests/test_datastructures.c
+28
-2
No files found.
tests/test_datastructures.c
View file @
62982432
...
...
@@ -4,6 +4,8 @@
#include <glib.h>
#include <stdint.h>
#include <datastructures.h>
#include <macros.h>
#include <log.h>
#include "tests.h"
...
...
@@ -361,13 +363,28 @@ START_TEST(test_datastructures_list_prepend) {
girara_list_free
(
list
);
}
END_TEST
static
Suite
*
suite_datastructures
(
void
)
static
void
critical_print
(
const
gchar
*
GIRARA_UNUSED
(
log_domain
),
GLogLevelFlags
GIRARA_UNUSED
(
log_level
),
const
gchar
*
message
,
gpointer
GIRARA_UNUSED
(
user_data
))
{
girara_debug
(
"expected glib critical: %s"
,
message
);
}
static
void
setup_logger
(
void
)
{
g_log_set_handler
(
NULL
,
G_LOG_LEVEL_CRITICAL
,
critical_print
,
NULL
);
}
static
Suite
*
suite_datastructures
(
void
)
{
TCase
*
tcase
=
NULL
;
Suite
*
suite
=
suite_create
(
"Datastructures"
);
/* list free */
tcase
=
tcase_create
(
"list_free_function"
);
tcase_add_checked_fixture
(
tcase
,
setup_logger
,
NULL
);
tcase_add_test
(
tcase
,
test_datastructures_list_free_empty
);
tcase_add_test
(
tcase
,
test_datastructures_list_free_already_cleared
);
tcase_add_test
(
tcase
,
test_datastructures_list_free_free_function
);
...
...
@@ -376,48 +393,57 @@ static Suite* suite_datastructures(void)
/* list create */
tcase
=
tcase_create
(
"list_basics"
);
tcase_add_checked_fixture
(
tcase
,
setup_logger
,
NULL
);
tcase_add_test
(
tcase
,
test_datastructures_list
);
suite_add_tcase
(
suite
,
tcase
);
/* sorted list */
tcase
=
tcase_create
(
"list_sorted"
);
tcase_add_checked_fixture
(
tcase
,
setup_logger
,
NULL
);
tcase_add_test
(
tcase
,
test_datastructures_sorted_list_basic
);
tcase_add_test
(
tcase
,
test_datastructures_sorted_list
);
suite_add_tcase
(
suite
,
tcase
);
/* merge lists */
tcase
=
tcase_create
(
"list_merge"
);
tcase_add_checked_fixture
(
tcase
,
setup_logger
,
NULL
);
tcase_add_test
(
tcase
,
test_datastructures_list_merge
);
suite_add_tcase
(
suite
,
tcase
);
/* search lists */
tcase
=
tcase_create
(
"list_find"
);
tcase_add_checked_fixture
(
tcase
,
setup_logger
,
NULL
);
tcase_add_test
(
tcase
,
test_datastructures_list_find
);
suite_add_tcase
(
suite
,
tcase
);
/* prepend lists */
tcase
=
tcase_create
(
"list_prepend"
);
tcase_add_checked_fixture
(
tcase
,
setup_logger
,
NULL
);
tcase_add_test
(
tcase
,
test_datastructures_list_prepend
);
suite_add_tcase
(
suite
,
tcase
);
/* list iterators */
tcase
=
tcase_create
(
"list_iterators"
);
tcase_add_checked_fixture
(
tcase
,
setup_logger
,
NULL
);
suite_add_tcase
(
suite
,
tcase
);
/* node free */
tcase
=
tcase_create
(
"node_free"
);
tcase_add_checked_fixture
(
tcase
,
setup_logger
,
NULL
);
tcase_add_test
(
tcase
,
test_datastructures_sorted_list
);
suite_add_tcase
(
suite
,
tcase
);
/* node basics */
tcase
=
tcase_create
(
"node_basics"
);
tcase_add_checked_fixture
(
tcase
,
setup_logger
,
NULL
);
tcase_add_test
(
tcase
,
test_datastructures_node
);
suite_add_tcase
(
suite
,
tcase
);
return
suite
;
}
int
main
()
int
main
()
{
return
run_suite
(
suite_datastructures
());
}
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