ecore_drm: Added test case calling ecore_drm_shutdown before calling ecore_drm_init.

Summary:
_ecore_drm_init_count should not go below zero. So added test case to verify that.

Signed-off-by: Srivardhan Hebbar <sri.hebbar@samsung.com>

Reviewers: devilhorns

Subscribers: cedric

Differential Revision: https://phab.enlightenment.org/D1589
This commit is contained in:
Srivardhan Hebbar 2014-10-28 10:26:39 -04:00 committed by Chris Michael
parent e164d14208
commit 17d0b98971
1 changed files with 19 additions and 0 deletions

View File

@ -11,6 +11,24 @@
#define MAX_ITER 10
START_TEST(ecore_test_ecore_drm_shutdown_bef_init)
{
int ret = 0;
ret = ecore_drm_shutdown();
fprintf(stderr, "Calling ecore_drm_shutdown without calling ecore_drm_init.\n");
fail_if(ret != 0);
ret = ecore_drm_init();
fprintf(stderr, "Calling ecore_drm_init.\n");
fail_if(ret != 1);
ret = ecore_drm_shutdown();
fprintf(stderr, "Calling ecore_drm_shutdown after ecore_drm_init.\n");
fail_if(ret != 0);
}
END_TEST
START_TEST(ecore_test_ecore_drm_init)
{
int ret, i, j;
@ -34,4 +52,5 @@ END_TEST
void ecore_test_ecore_drm(TCase *tc)
{
tcase_add_test(tc, ecore_test_ecore_drm_init);
tcase_add_test(tc, ecore_test_ecore_drm_shutdown_bef_init);
}