#include "cpptest.h"

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

CPPTEST_TEST_SUITE(TestSuite_idirectfbimageprovider_dfiff_c);
CPPTEST_TEST(TestSuite_idirectfbimageprovider_dfiff_c_test__IDirectFBImageProvider_DFIFF_AddRef_default);
CPPTEST_TEST(TestSuite_idirectfbimageprovider_dfiff_c_test__IDirectFBImageProvider_DFIFF_Release_default);
CPPTEST_TEST(TestSuite_idirectfbimageprovider_dfiff_c_test__IDirectFBImageProvider_DFIFF_GetImageDescription_default);
CPPTEST_TEST(TestSuite_idirectfbimageprovider_dfiff_c_test__IDirectFBImageProvider_DFIFF_GetSurfaceDescription_default);
CPPTEST_TEST(TestSuite_idirectfbimageprovider_dfiff_c_test__IDirectFBImageProvider_DFIFF_RenderTo_default);
CPPTEST_TEST(TestSuite_idirectfbimageprovider_dfiff_c_test__IDirectFBImageProvider_DFIFF_SetRenderCallback_default);
CPPTEST_TEST_SUITE_END();
        

void TestSuite_idirectfbimageprovider_dfiff_c_test__IDirectFBImageProvider_DFIFF_AddRef_default();
void TestSuite_idirectfbimageprovider_dfiff_c_test__IDirectFBImageProvider_DFIFF_Release_default();
void TestSuite_idirectfbimageprovider_dfiff_c_test__IDirectFBImageProvider_DFIFF_GetImageDescription_default();
void TestSuite_idirectfbimageprovider_dfiff_c_test__IDirectFBImageProvider_DFIFF_GetSurfaceDescription_default();
void TestSuite_idirectfbimageprovider_dfiff_c_test__IDirectFBImageProvider_DFIFF_RenderTo_default();
void TestSuite_idirectfbimageprovider_dfiff_c_test__IDirectFBImageProvider_DFIFF_SetRenderCallback_default();
CPPTEST_TEST_SUITE_REGISTRATION(TestSuite_idirectfbimageprovider_dfiff_c);

void TestSuite_idirectfbimageprovider_dfiff_c_setUp()
{
}

void TestSuite_idirectfbimageprovider_dfiff_c_tearDown()
{
}


/* CPPTEST_TEST_CASE_BEGIN test__IDirectFBImageProvider_DFIFF_AddRef_default */
/* CPPTEST_TEST_CASE_CONTEXT DirectResult _IDirectFBImageProvider_DFIFF_AddRef(IDirectFBImageProvider *) */
void TestSuite_idirectfbimageprovider_dfiff_c_test__IDirectFBImageProvider_DFIFF_AddRef_default()
{
	IDirectFBImageProvider thiz;
	IDirectFBImageProvider_DFIFF_data data;

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

    /* Pre-condition initialization */
    /* Initializing argument 1 (thiz) */ 
	IDirectFBImageProvider * _thiz  = &thiz ;
	IAny * this = (IAny*)_thiz;
	this->magic = 185931549 ;
    {
        /* Tested function call */
        DirectResult _return  = _IDirectFBImageProvider_DFIFF_AddRef(_thiz);
        /* Post-condition check */
        CPPTEST_ASSERT_EQUAL( DR_OK, ( _return ) );
        CPPTEST_ASSERT_INTEGER_EQUAL(1, (data.ref) );
    }
}
/* CPPTEST_TEST_CASE_END test__IDirectFBImageProvider_DFIFF_AddRef_default */

/* CPPTEST_TEST_CASE_BEGIN test__IDirectFBImageProvider_DFIFF_Release_default */
/* CPPTEST_TEST_CASE_CONTEXT DirectResult _IDirectFBImageProvider_DFIFF_Release(IDirectFBImageProvider *) */
void TestSuite_idirectfbimageprovider_dfiff_c_test__IDirectFBImageProvider_DFIFF_Release_default()
{
    /* Pre-condition initialization */
    /* Initializing argument 1 (thiz) */ 
	IDirectFBImageProvider thiz;
	IDirectFBImageProvider_DFIFF_data data;

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

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

/* CPPTEST_TEST_CASE_BEGIN test__IDirectFBImageProvider_DFIFF_GetImageDescription_default */
/* CPPTEST_TEST_CASE_CONTEXT DFBResult _IDirectFBImageProvider_DFIFF_GetImageDescription(IDirectFBImageProvider *, DFBImageDescription *) */
void TestSuite_idirectfbimageprovider_dfiff_c_test__IDirectFBImageProvider_DFIFF_GetImageDescription_default()
{
	IDirectFBImageProvider thiz;
	IDirectFBImageProvider_DFIFF_data data;

	thiz.priv = &data;
	/* Pre-condition initialization */
	/* Initializing argument 1 (thiz) */
	IDirectFBImageProvider * _thiz  = & thiz;
	_thiz->priv = &data;
	IAny * this = (IAny*)_thiz;
	this->magic = 185931549 ;

    /* Initializing argument 2 (desc) */ 
    DFBImageDescription _desc ;
    {
        /* Tested function call */
        DFBResult _return  = _IDirectFBImageProvider_DFIFF_GetImageDescription(_thiz, &_desc);
        /* Post-condition check */
        CPPTEST_ASSERT_EQUAL( DFB_OK, ( _return ) );
    }
}
/* CPPTEST_TEST_CASE_END test__IDirectFBImageProvider_DFIFF_GetImageDescription_default */

/* CPPTEST_TEST_CASE_BEGIN test__IDirectFBImageProvider_DFIFF_GetSurfaceDescription_default */
/* CPPTEST_TEST_CASE_CONTEXT DFBResult _IDirectFBImageProvider_DFIFF_GetSurfaceDescription(IDirectFBImageProvider *, DFBSurfaceDescription *) */
void TestSuite_idirectfbimageprovider_dfiff_c_test__IDirectFBImageProvider_DFIFF_GetSurfaceDescription_default()
{
	IDirectFBImageProvider thiz;
	IDirectFBImageProvider_DFIFF_data data;
	DFIFFHeader header;
	header.width = 20;
	header.height = 10;
	header.format = 0;

	data.ptr = &header;
	thiz.priv = &data;

    /* Pre-condition initialization */
    /* Initializing argument 1 (thiz) */ 
    IDirectFBImageProvider * _thiz  = &thiz ;
    IAny * this = (IAny*)_thiz;
    this->magic = 185931549 ;

    /* Initializing argument 2 (dsc) */ 
    DFBSurfaceDescription _dsc ;
    {
        /* Tested function call */
        DFBResult _return  = _IDirectFBImageProvider_DFIFF_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_ASSERT_UINTEGER_EQUAL((DSPF_UNKNOWN), (_dsc.pixelformat));
    }
}
/* CPPTEST_TEST_CASE_END test__IDirectFBImageProvider_DFIFF_GetSurfaceDescription_default */

/* CPPTEST_TEST_CASE_BEGIN test__IDirectFBImageProvider_DFIFF_RenderTo_default */
/* CPPTEST_TEST_CASE_CONTEXT DFBResult _IDirectFBImageProvider_DFIFF_RenderTo(IDirectFBImageProvider *, IDirectFBSurface *, const DFBRectangle *) */
void TestSuite_idirectfbimageprovider_dfiff_c_test__IDirectFBImageProvider_DFIFF_RenderTo_default()
{
	IDirectFBImageProvider thiz;
	IDirectFBImageProvider_DFIFF_data data;
	DFIFFHeader _header;

	_header.width = 10;
	_header.height = 10;
	_header.format = 0;
	data.ptr = & _header;
	data.render_callback = 0;
	thiz.priv = &data;

    /* Pre-condition initialization */
    /* Initializing argument 1 (thiz) */
    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, 10, 10};
    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_DFIFF_RenderTo(_thiz, & _destination, & _dest_rect);
        /* Post-condition check */
        CPPTEST_ASSERT_EQUAL( DFB_OK, ( _return ) );

    }
}
/* CPPTEST_TEST_CASE_END test__IDirectFBImageProvider_DFIFF_RenderTo_default */

/* CPPTEST_TEST_CASE_BEGIN test__IDirectFBImageProvider_DFIFF_SetRenderCallback_default */
/* CPPTEST_TEST_CASE_CONTEXT DFBResult _IDirectFBImageProvider_DFIFF_SetRenderCallback(IDirectFBImageProvider *, DIRenderCallback, void *) */
void TestSuite_idirectfbimageprovider_dfiff_c_test__IDirectFBImageProvider_DFIFF_SetRenderCallback_default()
{
	IDirectFBImageProvider thiz;
	IDirectFBImageProvider_DFIFF_data data;

	thiz.priv = &data;

    /* Pre-condition initialization */
    /* Initializing argument 1 (thiz) */
    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_DFIFF_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_context));
    }
}
/* CPPTEST_TEST_CASE_END test__IDirectFBImageProvider_DFIFF_SetRenderCallback_default */
