tests: Add C++ tests for the other INIT macros we have

This commit is contained in:
Sebastian Dröge 2016-04-07 20:29:10 +03:00
parent e1f4c2ce61
commit c78ff47a87
2 changed files with 14 additions and 1 deletions

View file

@ -23,9 +23,10 @@
GST_START_TEST (test_init_macros)
{
GstMapInfo map = GST_MAP_INFO_INIT;
GstPollFD poll_fd = GST_POLL_FD_INIT;
fail_unless_equals_int (map.size, 0);
fail_unless_equals_int (poll_fd.fd, -1);
}
GST_END_TEST;

View file

@ -36,6 +36,17 @@ GST_START_TEST (test_nothing)
GST_END_TEST;
GST_START_TEST (test_init_macros)
{
GstBitReader bit_reader = GST_BIT_READER_INIT (NULL, 0);
GstByteReader byte_reader = GST_BYTE_READER_INIT (NULL, 0);
fail_unless (bit_reader.data == NULL);
fail_unless (byte_reader.data == NULL);
}
GST_END_TEST;
static Suite *
libscpp_suite (void)
{
@ -44,6 +55,7 @@ libscpp_suite (void)
suite_add_tcase (s, tc_chain);
tcase_add_test (tc_chain, test_nothing);
tcase_add_test (tc_chain, test_init_macros);
return s;
}