#include "cpptest.h"

CPPTEST_CONTEXT("/UT_DFBProject/IDirectFBImageProvider/idirectfbimageprovider_gif.c");
CPPTEST_TEST_SUITE_INCLUDED_TO("/UT_DFBProject/IDirectFBImageProvider/idirectfbimageprovider_gif.c");

CPPTEST_TEST_SUITE(TestSuit_idirectfbimageprovider_gif_c);
CPPTEST_TEST(TestSuit_idirectfbimageprovider_gif_c_test__IDirectFBImageProvider_GIF_AddRef_default);
CPPTEST_TEST(TestSuit_idirectfbimageprovider_gif_c_test__IDirectFBImageProvider_GIF_GetImageDescription_default);
CPPTEST_TEST(TestSuit_idirectfbimageprovider_gif_c_test__IDirectFBImageProvider_GIF_GetImageDescription_Image_transparency);
CPPTEST_TEST(TestSuit_idirectfbimageprovider_gif_c_test__IDirectFBImageProvider_GIF_GetSurfaceDescription_default);
CPPTEST_TEST(TestSuit_idirectfbimageprovider_gif_c_test__IDirectFBImageProvider_GIF_SetRenderCallback_default);
CPPTEST_TEST(TestSuit_idirectfbimageprovider_gif_c_test__IDirectFBImageProvider_GIF_Release_default);
CPPTEST_TEST(TestSuit_idirectfbimageprovider_gif_c_test__IDirectFBImageProvider_GIF_RenderTo_default);
CPPTEST_TEST_SUITE_END();
        

void TestSuit_idirectfbimageprovider_gif_c_test__IDirectFBImageProvider_GIF_AddRef_default();
void TestSuit_idirectfbimageprovider_gif_c_test__IDirectFBImageProvider_GIF_GetImageDescription_default();
void TestSuit_idirectfbimageprovider_gif_c_test__IDirectFBImageProvider_GIF_GetImageDescription_Image_transparency();
void TestSuit_idirectfbimageprovider_gif_c_test__IDirectFBImageProvider_GIF_GetSurfaceDescription_default();
void TestSuit_idirectfbimageprovider_gif_c_test__IDirectFBImageProvider_GIF_SetRenderCallback_default();
void TestSuit_idirectfbimageprovider_gif_c_test__IDirectFBImageProvider_GIF_Release_default();
void TestSuit_idirectfbimageprovider_gif_c_test__IDirectFBImageProvider_GIF_RenderTo_default();
CPPTEST_TEST_SUITE_REGISTRATION(TestSuit_idirectfbimageprovider_gif_c);

void TestSuit_idirectfbimageprovider_gif_c_setUp()
{
}

void TestSuit_idirectfbimageprovider_gif_c_tearDown()
{
}


/* CPPTEST_TEST_CASE_BEGIN test__IDirectFBImageProvider_GIF_AddRef_default */
/* CPPTEST_TEST_CASE_CONTEXT DirectResult _IDirectFBImageProvider_GIF_AddRef(IDirectFBImageProvider *) */
void TestSuit_idirectfbimageprovider_gif_c_test__IDirectFBImageProvider_GIF_AddRef_default()
{
    /* Pre-condition initialization */
    /* Initializing argument 1 (thiz) */ 
	IDirectFBImageProvider thiz;
	IDirectFBImageProvider_GIF_data data;

	data.ref = 0;
	thiz.priv = &data;

    IDirectFBImageProvider * _thiz  = & thiz ;
    IAny * this = (IAny*)_thiz;
    this->magic = 185931549 ;
    {
        /* Tested function call */
        DirectResult _return  = _IDirectFBImageProvider_GIF_AddRef(_thiz);
        /* Post-condition check */
        CPPTEST_ASSERT_EQUAL( DFB_OK, ( _return ) );
    }
}
/* CPPTEST_TEST_CASE_END test__IDirectFBImageProvider_GIF_AddRef_default */

/* CPPTEST_TEST_CASE_BEGIN test__IDirectFBImageProvider_GIF_GetImageDescription_default */
/* CPPTEST_TEST_CASE_CONTEXT DFBResult _IDirectFBImageProvider_GIF_GetImageDescription(IDirectFBImageProvider *, DFBImageDescription *) */
void TestSuit_idirectfbimageprovider_gif_c_test__IDirectFBImageProvider_GIF_GetImageDescription_default()
{
    /* Pre-condition initialization */
    /* Initializing argument 1 (thiz) */ 
	IDirectFBImageProvider thiz;
	IDirectFBImageProvider_GIF_data data;

	data.image_transparency = 0;
	thiz.priv = &data;

	IDirectFBImageProvider * _thiz  = & thiz ;
	IAny * this = (IAny*)_thiz;
	this->magic = 185931549 ;
    /* Initializing argument 2 (dsc) */ 
    DFBImageDescription  _dsc  ;
    {
        /* Tested function call */
        DFBResult _return  = _IDirectFBImageProvider_GIF_GetImageDescription(_thiz, & _dsc);
        /* Post-condition check */
        CPPTEST_ASSERT_EQUAL( DFB_OK, ( _return ) );
        CPPTEST_ASSERT_UINTEGER_EQUAL((DICAPS_NONE), ( _dsc.caps));

    }
}
/* CPPTEST_TEST_CASE_END test__IDirectFBImageProvider_GIF_GetImageDescription_default */

/* CPPTEST_TEST_CASE_BEGIN test__IDirectFBImageProvider_GIF_GetImageDescription_Image_transparency */
/* CPPTEST_TEST_CASE_CONTEXT DFBResult _IDirectFBImageProvider_GIF_GetImageDescription(IDirectFBImageProvider *, DFBImageDescription *) */
void TestSuit_idirectfbimageprovider_gif_c_test__IDirectFBImageProvider_GIF_GetImageDescription_Image_transparency()
{
    /* Pre-condition initialization */
    /* Initializing argument 1 (thiz) */ 
	IDirectFBImageProvider thiz;
	IDirectFBImageProvider_GIF_data data;

	data.image_transparency = 1;
	data.image_colorkey = 0xff7f0f;
	thiz.priv = &data;

    IDirectFBImageProvider * _thiz  = & thiz ;
    IAny * this = (IAny*)_thiz;
    this->magic = 185931549 ;
    /* Initializing argument 2 (dsc) */ 
    DFBImageDescription  _dsc  ;
    {
        /* Tested function call */
        DFBResult _return  = _IDirectFBImageProvider_GIF_GetImageDescription(_thiz, & _dsc);
        /* Post-condition check */
        CPPTEST_ASSERT_EQUAL( DFB_OK, ( _return ) );
        CPPTEST_ASSERT_UINTEGER_EQUAL((DICAPS_COLORKEY), ( _dsc.caps));
        CPPTEST_ASSERT_UINTEGER_EQUAL((0xff), ( _dsc.colorkey_r));
        CPPTEST_ASSERT_UINTEGER_EQUAL((0x7f), ( _dsc.colorkey_g));
        CPPTEST_ASSERT_UINTEGER_EQUAL((0x0f), ( _dsc.colorkey_b));
    }
}
/* CPPTEST_TEST_CASE_END test__IDirectFBImageProvider_GIF_GetImageDescription_Image_transparency */

/* CPPTEST_TEST_CASE_BEGIN test__IDirectFBImageProvider_GIF_GetSurfaceDescription_default */
/* CPPTEST_TEST_CASE_CONTEXT DFBResult _IDirectFBImageProvider_GIF_GetSurfaceDescription(IDirectFBImageProvider *, DFBSurfaceDescription *) */
void TestSuit_idirectfbimageprovider_gif_c_test__IDirectFBImageProvider_GIF_GetSurfaceDescription_default()
{
    /* Pre-condition initialization */
    /* Initializing argument 1 (thiz) */ 
	IDirectFBImageProvider thiz;
	IDirectFBImageProvider_GIF_data data;

	data.image_width = 20;
	data.image_height = 10;

	thiz.priv = &data;

    IDirectFBImageProvider * _thiz  = & thiz ;
    IAny * this = (IAny*)_thiz;
    this->magic = 185931549 ;
    /* Initializing argument 2 (dsc) */ 
    DFBSurfaceDescription _dsc ;
    {
        /* Tested function call */
        DFBResult _return  = _IDirectFBImageProvider_GIF_GetSurfaceDescription(_thiz, & _dsc);
        /* Post-condition check */
        CPPTEST_ASSERT_EQUAL( DFB_OK, ( _return ) );
        CPPTEST_ASSERT_UINTEGER_EQUAL((DSDESC_WIDTH | DSDESC_HEIGHT | DSDESC_PIXELFORMAT), ( _dsc.flags));
        CPPTEST_ASSERT_INTEGER_EQUAL(20, (_dsc.width));
        CPPTEST_ASSERT_INTEGER_EQUAL(10, (_dsc.height));
    }
}
/* CPPTEST_TEST_CASE_END test__IDirectFBImageProvider_GIF_GetSurfaceDescription_default */

/* CPPTEST_TEST_CASE_BEGIN test__IDirectFBImageProvider_GIF_SetRenderCallback_default */
/* CPPTEST_TEST_CASE_CONTEXT DFBResult _IDirectFBImageProvider_GIF_SetRenderCallback(IDirectFBImageProvider *, DIRenderCallback, void *) */
void TestSuit_idirectfbimageprovider_gif_c_test__IDirectFBImageProvider_GIF_SetRenderCallback_default()
{
    /* Pre-condition initialization */
    /* Initializing argument 1 (thiz) */ 
	IDirectFBImageProvider thiz;
	IDirectFBImageProvider_GIF_data data;

	thiz.priv = &data;

	IDirectFBImageProvider * _thiz  = & thiz ;
	IAny * this = (IAny*)_thiz;
	this->magic = 185931549 ;
    /* Initializing argument 2 (callback) */ 
    DIRenderCallback _callback  = 0 ;
    /* Initializing argument 3 (context) */ 
    void * _context  = 0 ;
    {
        /* Tested function call */
        DFBResult _return  = _IDirectFBImageProvider_GIF_SetRenderCallback(_thiz, _callback, _context);
        /* Post-condition check */
        CPPTEST_ASSERT_EQUAL( DFB_OK, ( _return ) );
        CPPTEST_ASSERT_INTEGER_EQUAL( 0, (data.render_callback));
        CPPTEST_ASSERT_INTEGER_EQUAL( 0, (data.render_callback_ctx));
    }
}
/* CPPTEST_TEST_CASE_END test__IDirectFBImageProvider_GIF_SetRenderCallback_default */

/* CPPTEST_TEST_CASE_BEGIN test__IDirectFBImageProvider_GIF_Release_default */
/* CPPTEST_TEST_CASE_CONTEXT DirectResult _IDirectFBImageProvider_GIF_Release(IDirectFBImageProvider *) */
void TestSuit_idirectfbimageprovider_gif_c_test__IDirectFBImageProvider_GIF_Release_default()
{
    /* Pre-condition initialization */
    /* Initializing argument 1 (thiz) */ 
	IDirectFBImageProvider thiz;
	IDirectFBImageProvider_GIF_data data;

	data.ref = 1;
	thiz.priv = &data;

	IDirectFBImageProvider * _thiz  = & thiz ;
	IAny * this = (IAny*)_thiz;
	this->magic = 185931549 ;
    {
        /* Tested function call */
        DirectResult _return  = _IDirectFBImageProvider_GIF_Release(_thiz);
        /* Post-condition check */
        CPPTEST_ASSERT_EQUAL( DR_OK, ( _return ) );
        //CPPTEST_ASSERT_INTEGER_EQUAL(0, (data->ref) );
    }
}
/* CPPTEST_TEST_CASE_END test__IDirectFBImageProvider_GIF_Release_default */

/* CPPTEST_TEST_CASE_BEGIN test__IDirectFBImageProvider_GIF_RenderTo_default */
/* CPPTEST_TEST_CASE_CONTEXT DFBResult _IDirectFBImageProvider_GIF_RenderTo(IDirectFBImageProvider *, IDirectFBSurface *, const DFBRectangle *) */
void TestSuit_idirectfbimageprovider_gif_c_test__IDirectFBImageProvider_GIF_RenderTo_default()
{
    /* Pre-condition initialization */
    /* Initializing argument 1 (thiz) */ 
	IDirectFBImageProvider thiz;
	IDirectFBImageProvider_GIF_data data;

	thiz.priv = &data;

	IDirectFBImageProvider * _thiz  = & thiz ;
	IAny * this = (IAny*)_thiz;
	this->magic = 185931549 ;
    /* Initializing argument 2 (destination) */ 
	IDirectFBSurface _destination ;
	CoreSurface _surf;
    _surf.config.format = 0;
    DFBRectangle _my_rect = {0, 0, 0, 0};
    IDirectFBSurface_data _sur_data;

    _sur_data.surface = & _surf;
    _sur_data.area.current = _my_rect;
    _sur_data.area.wanted = _my_rect;

	_destination.priv = & _sur_data;
    /* Initializing argument 3 (dest_rect) */ 
    const DFBRectangle _dest_rect  = _my_rect ;
    {
        /* Tested function call */
        DFBResult _return  = _IDirectFBImageProvider_GIF_RenderTo(_thiz, & _destination, & _dest_rect);
        /* Post-condition check */
        CPPTEST_ASSERT_EQUAL( DFB_INVARG, ( _return ) );
    }
}
/* CPPTEST_TEST_CASE_END test__IDirectFBImageProvider_GIF_RenderTo_default */
