#include "cpptest.h"

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

CPPTEST_TEST_SUITE(TestSuite_idirectfbimageprovider_bmp_c);
CPPTEST_TEST(TestSuite_idirectfbimageprovider_bmp_c_test_IDirectFBImageProvider_BMP_AddRef_default);
CPPTEST_TEST(TestSuite_idirectfbimageprovider_bmp_c_test_IDirectFBImageProvider_BMP_SetRenderCallback_default);
CPPTEST_TEST(TestSuite_idirectfbimageprovider_bmp_c_test_fetch_data_default);
CPPTEST_TEST(TestSuite_idirectfbimageprovider_bmp_c_test_IDirectFBImageProvider_BMP_GetImageDescription_default);
CPPTEST_TEST(TestSuite_idirectfbimageprovider_bmp_c_test_IDirectFBImageProvider_BMP_GetImageDescription_no_desc);
CPPTEST_TEST(TestSuite_idirectfbimageprovider_bmp_c_test_IDirectFBImageProvider_BMP_GetSurfaceDescription_default);
CPPTEST_TEST(TestSuite_idirectfbimageprovider_bmp_c_test_IDirectFBImageProvider_BMP_GetSurfaceDescription_null);
CPPTEST_TEST(TestSuite_idirectfbimageprovider_bmp_c_test_IDirectFBImageProvider_BMP_Release_default);
CPPTEST_TEST(TestSuite_idirectfbimageprovider_bmp_c_test_IDirectFBImageProvider_BMP_RenderTo_default);
CPPTEST_TEST(TestSuite_idirectfbimageprovider_bmp_c_test_Probe_default);
CPPTEST_TEST(TestSuite_idirectfbimageprovider_bmp_c_test_bmp_decode_rgb_row_default);
CPPTEST_TEST_SUITE_END();
        

void TestSuite_idirectfbimageprovider_bmp_c_test_IDirectFBImageProvider_BMP_AddRef_default();
void TestSuite_idirectfbimageprovider_bmp_c_test_IDirectFBImageProvider_BMP_SetRenderCallback_default();
void TestSuite_idirectfbimageprovider_bmp_c_test_fetch_data_default();
void TestSuite_idirectfbimageprovider_bmp_c_test_IDirectFBImageProvider_BMP_GetImageDescription_default();
void TestSuite_idirectfbimageprovider_bmp_c_test_IDirectFBImageProvider_BMP_GetImageDescription_no_desc();
void TestSuite_idirectfbimageprovider_bmp_c_test_IDirectFBImageProvider_BMP_GetSurfaceDescription_default();
void TestSuite_idirectfbimageprovider_bmp_c_test_IDirectFBImageProvider_BMP_GetSurfaceDescription_null();
void TestSuite_idirectfbimageprovider_bmp_c_test_IDirectFBImageProvider_BMP_Release_default();
void TestSuite_idirectfbimageprovider_bmp_c_test_IDirectFBImageProvider_BMP_RenderTo_default();
void TestSuite_idirectfbimageprovider_bmp_c_test_Probe_default();
void TestSuite_idirectfbimageprovider_bmp_c_test_bmp_decode_rgb_row_default();
CPPTEST_TEST_SUITE_REGISTRATION(TestSuite_idirectfbimageprovider_bmp_c);

void TestSuite_idirectfbimageprovider_bmp_c_setUp()
{
}

void TestSuite_idirectfbimageprovider_bmp_c_tearDown()
{
}


/* CPPTEST_TEST_CASE_BEGIN test_IDirectFBImageProvider_BMP_AddRef */
/* CPPTEST_TEST_CASE_CONTEXT DFBResult IDirectFBImageProvider_BMP_AddRef(IDirectFBImageProvider *) */
void TestSuite_idirectfbimageprovider_bmp_c_test_IDirectFBImageProvider_BMP_AddRef_default()
{
    /* Pre-condition initialization */
    /* Initializing argument 1 (thiz) */ 
    IDirectFBImageProvider  _thiz;
    {
        /* Tested function call */
        DFBResult _return  = IDirectFBImageProvider_BMP_AddRef(&_thiz);
        /* Post-condition check */
        CPPTEST_ASSERT_EQUAL( DFB_OK, ( _return ) )

    }
}
/* CPPTEST_TEST_CASE_END test_IDirectFBImageProvider_BMP_AddRef */

/* CPPTEST_TEST_CASE_BEGIN test_IDirectFBImageProvider_BMP_SetRenderCallback_default */
/* CPPTEST_TEST_CASE_CONTEXT DFBResult IDirectFBImageProvider_BMP_SetRenderCallback(IDirectFBImageProvider *, DIRenderCallback, void *) */
void TestSuite_idirectfbimageprovider_bmp_c_test_IDirectFBImageProvider_BMP_SetRenderCallback_default()
{
    /* Pre-condition initialization */
    /* Initializing argument 1 (thiz) */ 
    IDirectFBImageProvider _thiz ;
    /* Initializing argument 2 (callback) */ 
    DIRenderCallback _callback  = 0 ;
    /* Initializing argument 3 (ctx) */ 
    void * _ctx  = 0 ;
    {
        /* Tested function call */
        DFBResult _return  = IDirectFBImageProvider_BMP_SetRenderCallback(&_thiz, _callback, _ctx);
        /* Post-condition check */
        CPPTEST_ASSERT_EQUAL( DFB_OK, ( _return ) )

    }
}
/* CPPTEST_TEST_CASE_END test_IDirectFBImageProvider_BMP_SetRenderCallback_default */

/* CPPTEST_TEST_CASE_BEGIN test_fetch_data_default */
/* CPPTEST_TEST_CASE_CONTEXT DFBResult fetch_data(IDirectFBDataBuffer *, void *, int) */
void TestSuite_idirectfbimageprovider_bmp_c_test_fetch_data_default()
{
    /* Pre-condition initialization */
    /* Initializing argument 1 (buffer) */ 
    IDirectFBDataBuffer _buffer ;
    /* Initializing argument 2 (ptr) */ 
    void * _ptr  = 0 ;
    /* Initializing argument 3 (len) */ 
    int _len  = 0;
    {
        /* Tested function call */
        DFBResult _return  = fetch_data(&_buffer, _ptr, _len);
        /* Post-condition check */
        CPPTEST_ASSERT_EQUAL( DFB_OK, ( _return ) )

    }
}
/* CPPTEST_TEST_CASE_END test_fetch_data_default */

/* CPPTEST_TEST_CASE_END test_IDirectFBImageProvider_BMP_Destruct_default */

/* CPPTEST_TEST_CASE_BEGIN test_IDirectFBImageProvider_BMP_GetImageDescription_default */
/* CPPTEST_TEST_CASE_CONTEXT DFBResult IDirectFBImageProvider_BMP_GetImageDescription(IDirectFBImageProvider *, DFBImageDescription *) */
void TestSuite_idirectfbimageprovider_bmp_c_test_IDirectFBImageProvider_BMP_GetImageDescription_default()
{
	IDirectFBImageProvider thiz;
	IDirectFBImageProvider_BMP_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_BMP_GetImageDescription(_thiz, &_desc);
        /* Post-condition check */
        CPPTEST_ASSERT_EQUAL( DFB_OK, ( _return ) )
        //CPPTEST_POST_CONDITION_PTR("IDirectFBImageProvider * _thiz ", ( _thiz ));
        //CPPTEST_POST_CONDITION_PTR("DFBImageDescription * _desc ", ( _desc ));
    }
}
/* CPPTEST_TEST_CASE_END test_IDirectFBImageProvider_BMP_GetImageDescription_default */

/* CPPTEST_TEST_CASE_BEGIN test_IDirectFBImageProvider_BMP_GetImageDescription_no_desc */
/* CPPTEST_TEST_CASE_CONTEXT DFBResult IDirectFBImageProvider_BMP_GetImageDescription(IDirectFBImageProvider *, DFBImageDescription *) */
void TestSuite_idirectfbimageprovider_bmp_c_test_IDirectFBImageProvider_BMP_GetImageDescription_no_desc()
{
	IDirectFBImageProvider thiz;
	IDirectFBImageProvider_BMP_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  = 0 ;
    {
        /* Tested function call */
        DFBResult _return  = IDirectFBImageProvider_BMP_GetImageDescription(_thiz, _desc);
        /* Post-condition check */
        CPPTEST_ASSERT_EQUAL( DFB_INVARG, ( _return ) )
        //CPPTEST_POST_CONDITION_PTR("IDirectFBImageProvider * _thiz ", ( _thiz ));
        //CPPTEST_POST_CONDITION_PTR("DFBImageDescription * _desc ", ( _desc ));
    }
}
/* CPPTEST_TEST_CASE_END test_IDirectFBImageProvider_BMP_GetImageDescription_no_desc */

/* CPPTEST_TEST_CASE_BEGIN test_IDirectFBImageProvider_BMP_GetSurfaceDescription_default */
/* CPPTEST_TEST_CASE_CONTEXT DFBResult IDirectFBImageProvider_BMP_GetSurfaceDescription(IDirectFBImageProvider *, DFBSurfaceDescription *) */
void TestSuite_idirectfbimageprovider_bmp_c_test_IDirectFBImageProvider_BMP_GetSurfaceDescription_default()
{
	IDirectFBImageProvider thiz;
	IDirectFBImageProvider_BMP_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) */ 
    DFBSurfaceDescription _desc ;
    {
        /* Tested function call */
        DFBResult _return  = IDirectFBImageProvider_BMP_GetSurfaceDescription(_thiz, &_desc);
        /* Post-condition check */
        CPPTEST_ASSERT_EQUAL( DFB_OK, ( _return ) )
        CPPTEST_ASSERT_UINTEGER_EQUAL((DSDESC_WIDTH | DSDESC_HEIGHT | DSDESC_PIXELFORMAT), ( _desc.flags));
        //CPPTEST_POST_CONDITION_PTR("IDirectFBImageProvider * _thiz ", ( _thiz ));
        //CPPTEST_POST_CONDITION_PTR("DFBSurfaceDescription * _desc ", ( _desc ));
    }
}
/* CPPTEST_TEST_CASE_END test_IDirectFBImageProvider_BMP_GetSurfaceDescription_default */

/* CPPTEST_TEST_CASE_BEGIN test_IDirectFBImageProvider_BMP_GetSurfaceDescription_null */
/* CPPTEST_TEST_CASE_CONTEXT DFBResult IDirectFBImageProvider_BMP_GetSurfaceDescription(IDirectFBImageProvider *, DFBSurfaceDescription *) */
void TestSuite_idirectfbimageprovider_bmp_c_test_IDirectFBImageProvider_BMP_GetSurfaceDescription_null()
{
	IDirectFBImageProvider thiz;
	IDirectFBImageProvider_BMP_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) */ 
    DFBSurfaceDescription * _desc  = 0 ;
    {
        /* Tested function call */
        DFBResult _return  = IDirectFBImageProvider_BMP_GetSurfaceDescription(_thiz, _desc);
        /* Post-condition check */
        CPPTEST_ASSERT_EQUAL( DFB_INVARG, ( _return ) );
    }
}
/* CPPTEST_TEST_CASE_END test_IDirectFBImageProvider_BMP_GetSurfaceDescription_null */

/* CPPTEST_TEST_CASE_BEGIN test_IDirectFBImageProvider_BMP_Release_default */
/* CPPTEST_TEST_CASE_CONTEXT DFBResult IDirectFBImageProvider_BMP_Release(IDirectFBImageProvider *) */
void TestSuite_idirectfbimageprovider_bmp_c_test_IDirectFBImageProvider_BMP_Release_default()
{
    /* Pre-condition initialization */
    /* Initializing argument 1 (thiz) */
	IDirectFBImageProvider thiz;
	IDirectFBImageProvider_BMP_data data;

	data.ref = 1;
	data.buffer = NULL;
	data.image = NULL;
	data.palette = NULL;
	thiz.priv = &data;

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



/* CPPTEST_TEST_CASE_BEGIN test_IDirectFBImageProvider_BMP_RenderTo_default */
/* CPPTEST_TEST_CASE_CONTEXT DFBResult IDirectFBImageProvider_BMP_RenderTo(IDirectFBImageProvider *, IDirectFBSurface *, const DFBRectangle *) */
void TestSuite_idirectfbimageprovider_bmp_c_test_IDirectFBImageProvider_BMP_RenderTo_default()
{
#if 0  //incorrect UT
    /* Pre-condition initialization */
    /* Initializing argument 1 (thiz) */ 
	IDirectFBImageProvider thiz;
	IDirectFBImageProvider_BMP_data data;

	data.render_callback = 0;

	thiz.priv = &data;
    IDirectFBImageProvider * _thiz  = & thiz ;
    IAny * this = (IAny*)_thiz;
    this->magic = 185931549 ;

    /* Initializing argument 2 (destination) */ 
    IDirectFBSurface  _destination ;
    CoreSurface _surf;
    IDirectFBSurface_data _sur_data;
    DFBRectangle _my_rect = {0, 0, 10, 10};

    _surf.config.format = 0;
    _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_BMP_RenderTo(_thiz, & _destination, & _dest_rect);
        /* Post-condition check */
        CPPTEST_ASSERT_EQUAL( DFB_OK, ( _return ) );
    }
#endif    
}
/* CPPTEST_TEST_CASE_END test_IDirectFBImageProvider_BMP_RenderTo_default */

/* CPPTEST_TEST_CASE_BEGIN test_Probe_default */
/* CPPTEST_TEST_CASE_CONTEXT DFBResult Probe(IDirectFBImageProvider_ProbeContext *) */
void TestSuite_idirectfbimageprovider_bmp_c_test_Probe_default()
{
    /* Pre-condition initialization */
    /* Initializing argument 1 (ctx) */
    IDirectFBImageProvider_ProbeContext  _ctx ;
    _ctx.header[0] = 'B';
    _ctx.header[1] = 'M';
    {
        /* Tested function call */
        DFBResult _return  = Probe(&_ctx);
        /* Post-condition check */
        CPPTEST_ASSERT_EQUAL( DFB_OK, ( _return ) );
    }
}
/* CPPTEST_TEST_CASE_END test_Probe_default */

/* CPPTEST_TEST_CASE_BEGIN test_bmp_decode_rgb_row_default */
/* CPPTEST_TEST_CASE_CONTEXT DFBResult bmp_decode_rgb_row(IDirectFBImageProvider_BMP_data *, int) */
void TestSuite_idirectfbimageprovider_bmp_c_test_bmp_decode_rgb_row_default()
{
    /* Pre-condition initialization */
    /* Initializing argument 1 (data) */
    IDirectFBImageProvider_BMP_data _data;
    IDirectFBDataBuffer _buffer ;
    _data.buffer = &_buffer;
    _data.width = 0;
    _data.height = 0;
    _data.depth = 0;
    /* Initializing argument 2 (row) */
    int _row  = 0;
    {
        /* Tested function call */
        DFBResult _return  = bmp_decode_rgb_row(&_data, _row);
        /* Post-condition check */
        CPPTEST_ASSERT_EQUAL( DFB_OK, ( _return ) );
    }
}
/* CPPTEST_TEST_CASE_END test_bmp_decode_rgb_row_default */

