mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-28 04:31:06 +00:00
tests: video: Test video format enum stability
It is really easy to break the API and insert a new video format in the middle of the enum instead of at the end. This minimal test should catch the most obvious errors. Ideally, this test should be updated after new format have been added, so that it won't allow further modification to the enumeration API.
This commit is contained in:
parent
79365f9b41
commit
fcaf938e8c
1 changed files with 11 additions and 0 deletions
|
@ -2942,6 +2942,16 @@ GST_START_TEST (test_overlay_composition_over_transparency)
|
|||
|
||||
GST_END_TEST;
|
||||
|
||||
GST_START_TEST (test_video_format_enum_stability)
|
||||
{
|
||||
/* When adding new formats, adding a format in the middle of the enum will
|
||||
* break the API. This check picks the last known format and checks that
|
||||
* it's value isn't changing. This test should ideall be updated when a new
|
||||
* format is added, though will stay valid. */
|
||||
fail_unless_equals_int (GST_VIDEO_FORMAT_Y210, 82);
|
||||
}
|
||||
|
||||
GST_END_TEST;
|
||||
|
||||
static Suite *
|
||||
video_suite (void)
|
||||
|
@ -2982,6 +2992,7 @@ video_suite (void)
|
|||
tcase_add_test (tc_chain, test_overlay_blend);
|
||||
tcase_add_test (tc_chain, test_video_center_rect);
|
||||
tcase_add_test (tc_chain, test_overlay_composition_over_transparency);
|
||||
tcase_add_test (tc_chain, test_video_format_enum_stability);
|
||||
|
||||
return s;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue