From c78ff47a87e4274fca902d2086052a2adc9677a8 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Sebastian=20Dr=C3=B6ge?= Date: Thu, 7 Apr 2016 20:29:10 +0300 Subject: [PATCH] tests: Add C++ tests for the other INIT macros we have --- tests/check/gst/gstcpp.cc | 3 ++- tests/check/libs/gstlibscpp.cc | 12 ++++++++++++ 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/tests/check/gst/gstcpp.cc b/tests/check/gst/gstcpp.cc index 829654e..a96667a 100644 --- a/tests/check/gst/gstcpp.cc +++ b/tests/check/gst/gstcpp.cc @@ -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; diff --git a/tests/check/libs/gstlibscpp.cc b/tests/check/libs/gstlibscpp.cc index 00243b0..bee2588 100644 --- a/tests/check/libs/gstlibscpp.cc +++ b/tests/check/libs/gstlibscpp.cc @@ -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; } -- 2.7.4