#include "cpptest.h"

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

CPPTEST_TEST_SUITE(TestSuite_idirectfbimageprovider_png_c);
CPPTEST_TEST(TestSuite_idirectfbimageprovider_png_c_test_align_min);
CPPTEST_TEST(TestSuite_idirectfbimageprovider_png_c_test_align_max);
CPPTEST_TEST(TestSuite_idirectfbimageprovider_png_c_test__IDirectFBImageprovider_PNG_MappingPool_NoHWPng);
CPPTEST_TEST(TestSuite_idirectfbimageprovider_png_c_test_IDirectFBImageProvider_PNG_AddRef_OK);
CPPTEST_TEST(TestSuite_idirectfbimageprovider_png_c_test__IDirectFBImageProvider_PNG_AddRef_default);
CPPTEST_TEST(TestSuite_idirectfbimageprovider_png_c_test__IDirectFBImageProvider_PNG_GetImageDescription_default);
CPPTEST_TEST(TestSuite_idirectfbimageprovider_png_c_test__IDirectFBImageProvider_PNG_GetSurfaceDescription_default);
CPPTEST_TEST(TestSuite_idirectfbimageprovider_png_c_test__IDirectFBImageProvider_PNG_Release_default);
CPPTEST_TEST(TestSuite_idirectfbimageprovider_png_c_test__IDirectFBImageProvider_PNG_SetRenderCallback_default);
CPPTEST_TEST(TestSuite_idirectfbimageprovider_png_c_test__IDirectFBImageProvider_PNG_RenderTo_default);
CPPTEST_TEST_SUITE_END();
        

void TestSuite_idirectfbimageprovider_png_c_test_align_min();
void TestSuite_idirectfbimageprovider_png_c_test_align_max();
void TestSuite_idirectfbimageprovider_png_c_test__IDirectFBImageprovider_PNG_MappingPool_NoHWPng();
void TestSuite_idirectfbimageprovider_png_c_test_IDirectFBImageProvider_PNG_AddRef_OK();
void TestSuite_idirectfbimageprovider_png_c_test__IDirectFBImageProvider_PNG_AddRef_default();
void TestSuite_idirectfbimageprovider_png_c_test__IDirectFBImageProvider_PNG_GetImageDescription_default();
void TestSuite_idirectfbimageprovider_png_c_test__IDirectFBImageProvider_PNG_GetSurfaceDescription_default();
void TestSuite_idirectfbimageprovider_png_c_test__IDirectFBImageProvider_PNG_Release_default();
void TestSuite_idirectfbimageprovider_png_c_test__IDirectFBImageProvider_PNG_SetRenderCallback_default();
void TestSuite_idirectfbimageprovider_png_c_test__IDirectFBImageProvider_PNG_RenderTo_default();
CPPTEST_TEST_SUITE_REGISTRATION(TestSuite_idirectfbimageprovider_png_c);

void TestSuite_idirectfbimageprovider_png_c_setUp()
{
}

void TestSuite_idirectfbimageprovider_png_c_tearDown()
{
}


/* CPPTEST_TEST_CASE_BEGIN test_align_min */
/* CPPTEST_TEST_CASE_CONTEXT unsigned int align(unsigned int, unsigned int) */
void TestSuite_idirectfbimageprovider_png_c_test_align_min()
{
    /* Pre-condition initialization */
    /* Initializing argument 1 (p) */ 
    unsigned _p  = 128*1024-15;  //128K - 15
    /* Initializing argument 2 (alignment) */ 
    unsigned _alignment  = 16;
    {
        /* Tested function call */
        unsigned _return  = align(_p, _alignment);
        /* Post-condition check */
        CPPTEST_ASSERT_UINTEGER_EQUAL( 128*1024, _return );
    }
}
/* CPPTEST_TEST_CASE_END test_align_min */

/* CPPTEST_TEST_CASE_BEGIN test_align_max */
/* CPPTEST_TEST_CASE_CONTEXT unsigned int align(unsigned int, unsigned int) */
void TestSuite_idirectfbimageprovider_png_c_test_align_max()
{
    /* Pre-condition initialization */
    /* Initializing argument 1 (p) */ 
    unsigned _p  = 128*1024;  //128K
    /* Initializing argument 2 (alignment) */ 
    unsigned _alignment  = 16;
    {
        /* Tested function call */
        unsigned _return  = align(_p, _alignment);
        /* Post-condition check */
        CPPTEST_ASSERT_UINTEGER_EQUAL( 128*1024, _return );
    }
}
/* CPPTEST_TEST_CASE_END test_align_max */

/* CPPTEST_TEST_CASE_BEGIN test__IDirectFBImageprovider_PNG_MappingPool_NoHWPng */
/* CPPTEST_TEST_CASE_CONTEXT DFBResult _IDirectFBImageprovider_PNG_MappingPool(IDirectFBImageProvider *) */
void TestSuite_idirectfbimageprovider_png_c_test__IDirectFBImageprovider_PNG_MappingPool_NoHWPng()
{
    /* Pre-condition initialization */
    /* Initializing argument 1 (thiz) */ 
	IDirectFBImageProvider aIDirectFBImageProvider;

    {
        /* Tested function call */
        DFBResult _return  = _IDirectFBImageprovider_PNG_MappingPool(&aIDirectFBImageProvider);
        /* Post-condition check */
        CPPTEST_ASSERT_EQUAL( DFB_OK, _return );
    }
}
/* CPPTEST_TEST_CASE_END test__IDirectFBImageprovider_PNG_MappingPool_NoHWPng */

/* CPPTEST_TEST_CASE_BEGIN test_IDirectFBImageProvider_PNG_AddRef_OK */
/* CPPTEST_TEST_CASE_CONTEXT DirectResult IDirectFBImageProvider_PNG_AddRef(IDirectFBImageProvider *) */
void TestSuite_idirectfbimageprovider_png_c_test_IDirectFBImageProvider_PNG_AddRef_OK()
{
    /* Pre-condition initialization */
    /* Initializing argument 1 (thiz) */ 
    IDirectFBImageProvider  a_thiz;
    {
        /* Tested function call */
        DirectResult _return  = IDirectFBImageProvider_PNG_AddRef(&a_thiz);
        /* Post-condition check */
        CPPTEST_ASSERT_EQUAL( DFB_OK, ( _return ) );
        //CPPTEST_POST_CONDITION_PTR("IDirectFBImageProvider * _thiz ", ( _thiz ));
    }
}
/* CPPTEST_TEST_CASE_END test_IDirectFBImageProvider_PNG_AddRef_OK */

/* CPPTEST_TEST_CASE_BEGIN test__IDirectFBImageProvider_PNG_AddRef_default */
/* CPPTEST_TEST_CASE_CONTEXT DirectResult _IDirectFBImageProvider_PNG_AddRef(IDirectFBImageProvider *) */
void TestSuite_idirectfbimageprovider_png_c_test__IDirectFBImageProvider_PNG_AddRef_default()
{
    /* Pre-condition initialization */
    /* Initializing argument 1 (thiz) */ 
	IDirectFBImageProvider thiz ;
	IDirectFBImageProvider_PNG_data data;

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

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

/* CPPTEST_TEST_CASE_BEGIN test__IDirectFBImageProvider_PNG_GetImageDescription_default */
/* CPPTEST_TEST_CASE_CONTEXT DFBResult _IDirectFBImageProvider_PNG_GetImageDescription(IDirectFBImageProvider *, DFBImageDescription *) */
void TestSuite_idirectfbimageprovider_png_c_test__IDirectFBImageProvider_PNG_GetImageDescription_default()
{
    /* Pre-condition initialization */
    /* Initializing argument 1 (thiz) */ 
	IDirectFBImageProvider thiz ;
	IDirectFBImageProvider_PNG_data data;

	data.ref = 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_PNG_GetImageDescription(_thiz, & _dsc);
        /* Post-condition check */
        CPPTEST_ASSERT_EQUAL( DFB_OK, ( _return ) );
    }
}
/* CPPTEST_TEST_CASE_END test__IDirectFBImageProvider_PNG_GetImageDescription_default */

/* CPPTEST_TEST_CASE_BEGIN test__IDirectFBImageProvider_PNG_GetSurfaceDescription_default */
/* CPPTEST_TEST_CASE_CONTEXT DFBResult _IDirectFBImageProvider_PNG_GetSurfaceDescription(IDirectFBImageProvider *, DFBSurfaceDescription *) */
void TestSuite_idirectfbimageprovider_png_c_test__IDirectFBImageProvider_PNG_GetSurfaceDescription_default()
{
    /* Pre-condition initialization */
    /* Initializing argument 1 (thiz) */ 
	IDirectFBImageProvider thiz ;
	IDirectFBImageProvider_PNG_data data;

	data.width = 10;
	data.height = 20;

	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_PNG_GetSurfaceDescription(_thiz, &_dsc);
        /* Post-condition check */
        CPPTEST_ASSERT_EQUAL( DFB_OK, ( _return ) );
    }
}
/* CPPTEST_TEST_CASE_END test__IDirectFBImageProvider_PNG_GetSurfaceDescription_default */

/* CPPTEST_TEST_CASE_BEGIN test__IDirectFBImageProvider_PNG_Release_default */
/* CPPTEST_TEST_CASE_CONTEXT DirectResult _IDirectFBImageProvider_PNG_Release(IDirectFBImageProvider *) */
void TestSuite_idirectfbimageprovider_png_c_test__IDirectFBImageProvider_PNG_Release_default()
{
    /* Pre-condition initialization */
    /* Initializing argument 1 (thiz) */ 
	IDirectFBImageProvider thiz ;
	IDirectFBImageProvider_PNG_data data;

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

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

/* CPPTEST_TEST_CASE_BEGIN test__IDirectFBImageProvider_PNG_SetRenderCallback_default */
/* CPPTEST_TEST_CASE_CONTEXT DFBResult _IDirectFBImageProvider_PNG_SetRenderCallback(IDirectFBImageProvider *, DIRenderCallback, void *) */
void TestSuite_idirectfbimageprovider_png_c_test__IDirectFBImageProvider_PNG_SetRenderCallback_default()
{
    /* Pre-condition initialization */
    /* Initializing argument 1 (thiz) */ 
	IDirectFBImageProvider thiz ;
	IDirectFBImageProvider_PNG_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_PNG_SetRenderCallback(_thiz, _callback, _context);
        /* Post-condition check */
        CPPTEST_ASSERT_EQUAL( DFB_OK, ( _return ) );
    }
}
/* CPPTEST_TEST_CASE_END test__IDirectFBImageProvider_PNG_SetRenderCallback_default */

/* CPPTEST_TEST_CASE_BEGIN test__IDirectFBImageProvider_PNG_RenderTo_default */
/* CPPTEST_TEST_CASE_CONTEXT DFBResult _IDirectFBImageProvider_PNG_RenderTo(IDirectFBImageProvider *, IDirectFBSurface *, const DFBRectangle *) */
void TestSuite_idirectfbimageprovider_png_c_test__IDirectFBImageProvider_PNG_RenderTo_default()
{
    /* Pre-condition initialization */
    /* Initializing argument 1 (thiz) */ 
	IDirectFBImageProvider thiz ;
	IDirectFBImageProvider_PNG_data data;
	CoreDFB core;
	CoreDFBShared shared;

	core.shared = &shared;
	data.core = & core;
	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, 10, 10};
    IDirectFBSurface_data _sur_data;

    _sur_data.surface = NULL;
    _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_PNG_RenderTo(_thiz, &_destination, &_dest_rect);
        /* Post-condition check */
        CPPTEST_ASSERT_EQUAL( DFB_DESTROYED, ( _return ) );
    }
}
/* CPPTEST_TEST_CASE_END test__IDirectFBImageProvider_PNG_RenderTo_default */
