#include "cpptest.h"

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

CPPTEST_TEST_SUITE(TestSuite_idirectfbimageprovider_pnm_c);
CPPTEST_TEST(TestSuite_idirectfbimageprovider_pnm_c_test_IDirectFBImageProvider_PNM_AddRef_default);
CPPTEST_TEST(TestSuite_idirectfbimageprovider_pnm_c_test_IDirectFBImageProvider_PNM_Release_default);
CPPTEST_TEST(TestSuite_idirectfbimageprovider_pnm_c_test_IDirectFBImageProvider_PNM_GetSurfaceDescription_default);
CPPTEST_TEST(TestSuite_idirectfbimageprovider_pnm_c_test_IDirectFBImageProvider_PNM_GetImageDescription_default);
CPPTEST_TEST(TestSuite_idirectfbimageprovider_pnm_c_test_IDirectFBImageProvider_PNM_GetImageDescription_fault);
CPPTEST_TEST(TestSuite_idirectfbimageprovider_pnm_c_test_IDirectFBImageProvider_PNM_GetImageDescription_format_PBM);
CPPTEST_TEST(TestSuite_idirectfbimageprovider_pnm_c_test_IDirectFBImageProvider_PNM_GetSurfaceDescription_format_PBM);
CPPTEST_TEST(TestSuite_idirectfbimageprovider_pnm_c_test_IDirectFBImageProvider_PNM_GetSurfaceDescription_format_PGM);
CPPTEST_TEST(TestSuite_idirectfbimageprovider_pnm_c_test_IDirectFBImageProvider_PNM_GetSurfaceDescription_fault);
CPPTEST_TEST(TestSuite_idirectfbimageprovider_pnm_c_test_IDirectFBImageProvider_PNM_SetRenderCallback_default);
CPPTEST_TEST(TestSuite_idirectfbimageprovider_pnm_c_test_IDirectFBImageProvider_PNM_RenderTo_fault);
CPPTEST_TEST(TestSuite_idirectfbimageprovider_pnm_c_test_IDirectFBImageProvider_PNM_RenderTo_default);
CPPTEST_TEST(TestSuite_idirectfbimageprovider_pnm_c_test_Probe_default);
CPPTEST_TEST_SUITE_END();
        

void TestSuite_idirectfbimageprovider_pnm_c_test_IDirectFBImageProvider_PNM_AddRef_default();
void TestSuite_idirectfbimageprovider_pnm_c_test_IDirectFBImageProvider_PNM_Release_default();
void TestSuite_idirectfbimageprovider_pnm_c_test_IDirectFBImageProvider_PNM_GetSurfaceDescription_default();
void TestSuite_idirectfbimageprovider_pnm_c_test_IDirectFBImageProvider_PNM_GetImageDescription_default();
void TestSuite_idirectfbimageprovider_pnm_c_test_IDirectFBImageProvider_PNM_GetImageDescription_fault();
void TestSuite_idirectfbimageprovider_pnm_c_test_IDirectFBImageProvider_PNM_GetImageDescription_format_PBM();
void TestSuite_idirectfbimageprovider_pnm_c_test_IDirectFBImageProvider_PNM_GetSurfaceDescription_format_PBM();
void TestSuite_idirectfbimageprovider_pnm_c_test_IDirectFBImageProvider_PNM_GetSurfaceDescription_format_PGM();
void TestSuite_idirectfbimageprovider_pnm_c_test_IDirectFBImageProvider_PNM_GetSurfaceDescription_fault();
void TestSuite_idirectfbimageprovider_pnm_c_test_IDirectFBImageProvider_PNM_SetRenderCallback_default();
void TestSuite_idirectfbimageprovider_pnm_c_test_IDirectFBImageProvider_PNM_RenderTo_fault();
void TestSuite_idirectfbimageprovider_pnm_c_test_IDirectFBImageProvider_PNM_RenderTo_default();
void TestSuite_idirectfbimageprovider_pnm_c_test_Probe_default();
CPPTEST_TEST_SUITE_REGISTRATION(TestSuite_idirectfbimageprovider_pnm_c);

void TestSuite_idirectfbimageprovider_pnm_c_setUp()
{
}

void TestSuite_idirectfbimageprovider_pnm_c_tearDown()
{
}


/* CPPTEST_TEST_CASE_BEGIN test_IDirectFBImageProvider_PNM_AddRef_default */
/* CPPTEST_TEST_CASE_CONTEXT DFBResult IDirectFBImageProvider_PNM_AddRef(IDirectFBImageProvider *) */
void TestSuite_idirectfbimageprovider_pnm_c_test_IDirectFBImageProvider_PNM_AddRef_default()
{
    /* Pre-condition initialization */
    /* Initializing argument 1 (thiz) */
	IDirectFBImageProvider thiz;
	IDirectFBImageProvider_PNM_data data;
    IDirectFBImageProvider * _thiz  = &thiz ;

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

    IAny * this = (IAny*)_thiz;
    this->magic = 185931549 ;
    {
        /* Tested function call */
        DFBResult _return  = IDirectFBImageProvider_PNM_AddRef(_thiz);
        /* Post-condition check */
        CPPTEST_ASSERT_EQUAL( DFB_OK, ( _return ) );
        CPPTEST_ASSERT_EQUAL( 1, ( data.ref ) );
    }
}
/* CPPTEST_TEST_CASE_END test_IDirectFBImageProvider_PNM_AddRef_default */

/* CPPTEST_TEST_CASE_BEGIN test_IDirectFBImageProvider_PNM_Release_default */
/* CPPTEST_TEST_CASE_CONTEXT DFBResult IDirectFBImageProvider_PNM_Release(IDirectFBImageProvider *) */
void TestSuite_idirectfbimageprovider_pnm_c_test_IDirectFBImageProvider_PNM_Release_default()
{
    /* Pre-condition initialization */
    /* Initializing argument 1 (thiz) */ 
	IDirectFBImageProvider thiz;
	IDirectFBImageProvider_PNM_data data;
    IDirectFBImageProvider * _thiz  = &thiz ;

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

    IAny * this = (IAny*)_thiz;
    this->magic = 185931549 ;
    {
        /* Tested function call */
        DFBResult _return  = IDirectFBImageProvider_PNM_Release(_thiz);
        /* Post-condition check */
        CPPTEST_ASSERT_EQUAL( DFB_OK, ( _return ) );
    }
}
/* CPPTEST_TEST_CASE_END test_IDirectFBImageProvider_PNM_Release_default */

/* CPPTEST_TEST_CASE_BEGIN test_IDirectFBImageProvider_PNM_GetSurfaceDescription */
/* CPPTEST_TEST_CASE_CONTEXT DFBResult IDirectFBImageProvider_PNM_GetSurfaceDescription(IDirectFBImageProvider *, DFBSurfaceDescription *) */
void TestSuite_idirectfbimageprovider_pnm_c_test_IDirectFBImageProvider_PNM_GetSurfaceDescription_default()
{
	IDirectFBImageProvider thiz;
	IDirectFBImageProvider_PNM_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 (desc) */ 
    DFBSurfaceDescription  _desc ;
    {
        /* Tested function call */
        DFBResult _return  = IDirectFBImageProvider_PNM_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_ASSERT_UINTEGER_EQUAL((DSPF_RGB32), (_desc.pixelformat));
    }
}
/* CPPTEST_TEST_CASE_END test_IDirectFBImageProvider_PNM_GetSurfaceDescription */

/* CPPTEST_TEST_CASE_BEGIN test_IDirectFBImageProvider_PNM_GetImageDescription_default */
/* CPPTEST_TEST_CASE_CONTEXT DFBResult IDirectFBImageProvider_PNM_GetImageDescription(IDirectFBImageProvider *, DFBImageDescription *) */
void TestSuite_idirectfbimageprovider_pnm_c_test_IDirectFBImageProvider_PNM_GetImageDescription_default()
{
    /* Pre-condition initialization */
    /* Initializing argument 1 (thiz) */ 
	IDirectFBImageProvider thiz;
	IDirectFBImageProvider_PNM_data data;

	data.format = (PFormat) PFMT_PPM;
	thiz.priv = &data;

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

/* CPPTEST_TEST_CASE_BEGIN test_IDirectFBImageProvider_PNM_GetImageDescription_fault */
/* CPPTEST_TEST_CASE_CONTEXT DFBResult IDirectFBImageProvider_PNM_GetImageDescription(IDirectFBImageProvider *, DFBImageDescription *) */
void TestSuite_idirectfbimageprovider_pnm_c_test_IDirectFBImageProvider_PNM_GetImageDescription_fault()
{
    /* Pre-condition initialization */
    /* Initializing argument 1 (thiz) */
	IDirectFBImageProvider thiz;
	IDirectFBImageProvider_PNM_data data;
	thiz.priv = &data;
    IDirectFBImageProvider * _thiz  = & thiz ;
    IAny * this = (IAny*)_thiz;
    this->magic = 185931549 ;
    /* Initializing argument 2 (desc) */
    DFBImageDescription * _desc  = 0 ;
    {
        /* Tested function call */
        DFBResult _return  = IDirectFBImageProvider_PNM_GetImageDescription(_thiz, _desc);
        /* Post-condition check */
        CPPTEST_ASSERT_EQUAL( DFB_INVARG, ( _return ) );
    }
}
/* CPPTEST_TEST_CASE_END test_IDirectFBImageProvider_PNM_GetImageDescription_fault */

/* CPPTEST_TEST_CASE_BEGIN test_IDirectFBImageProvider_PNM_GetImageDescription_format_PBM */
/* CPPTEST_TEST_CASE_CONTEXT DFBResult IDirectFBImageProvider_PNM_GetImageDescription(IDirectFBImageProvider *, DFBImageDescription *) */
void TestSuite_idirectfbimageprovider_pnm_c_test_IDirectFBImageProvider_PNM_GetImageDescription_format_PBM()
{
    /* Pre-condition initialization */
    /* Initializing argument 1 (thiz) */
	IDirectFBImageProvider thiz;
	IDirectFBImageProvider_PNM_data data;

	data.format = (PFormat) PFMT_PBM;
	thiz.priv = &data;

	IDirectFBImageProvider * _thiz  = & thiz ;
	IAny * this = (IAny*)_thiz;
	this->magic = 185931549 ;
	/* Initializing argument 2 (desc) */
	DFBImageDescription _desc ;
    {
        /* Tested function call */
        DFBResult _return  = IDirectFBImageProvider_PNM_GetImageDescription(_thiz, &_desc);
        /* Post-condition check */
        CPPTEST_ASSERT_EQUAL( DFB_OK, ( _return ) );
        CPPTEST_ASSERT_UINTEGER_EQUAL((DICAPS_ALPHACHANNEL), ( _desc.caps));
    }
}
/* CPPTEST_TEST_CASE_END test_IDirectFBImageProvider_PNM_GetImageDescription_format_PBM */

/* CPPTEST_TEST_CASE_BEGIN test_IDirectFBImageProvider_PNM_GetSurfaceDescription_format_PBM */
/* CPPTEST_TEST_CASE_CONTEXT DFBResult IDirectFBImageProvider_PNM_GetSurfaceDescription(IDirectFBImageProvider *, DFBSurfaceDescription *) */
void TestSuite_idirectfbimageprovider_pnm_c_test_IDirectFBImageProvider_PNM_GetSurfaceDescription_format_PBM()
{
    /* Pre-condition initialization */
    /* Initializing argument 1 (thiz) */
	IDirectFBImageProvider thiz;
	IDirectFBImageProvider_PNM_data data;

	data.width = 10;
	data.height = 20;
	data.format = (PFormat) PFMT_PBM;
	thiz.priv = &data;

	IDirectFBImageProvider * _thiz  = & thiz ;
	IAny * this = (IAny*)_thiz;
	this->magic = 185931549 ;
    /* Initializing argument 2 (desc) */
    DFBSurfaceDescription _desc ;
    {
        /* Tested function call */
        DFBResult _return  = IDirectFBImageProvider_PNM_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_ASSERT_UINTEGER_EQUAL((DSPF_A1), (_desc.pixelformat));
        CPPTEST_ASSERT_INTEGER_EQUAL(10, (_desc.width));
        CPPTEST_ASSERT_INTEGER_EQUAL(20, (_desc.height));
    }
}
/* CPPTEST_TEST_CASE_END test_IDirectFBImageProvider_PNM_GetSurfaceDescription_format_PBM */

/* CPPTEST_TEST_CASE_BEGIN test_IDirectFBImageProvider_PNM_GetSurfaceDescription_format_PGM */
/* CPPTEST_TEST_CASE_CONTEXT DFBResult IDirectFBImageProvider_PNM_GetSurfaceDescription(IDirectFBImageProvider *, DFBSurfaceDescription *) */
void TestSuite_idirectfbimageprovider_pnm_c_test_IDirectFBImageProvider_PNM_GetSurfaceDescription_format_PGM()
{
    /* Pre-condition initialization */
    /* Initializing argument 1 (thiz) */
	IDirectFBImageProvider thiz;
	IDirectFBImageProvider_PNM_data data;

	data.width = 30;
	data.height = 40;
	data.format = (PFormat) PFMT_PGM;
	thiz.priv = &data;

	IDirectFBImageProvider * _thiz  = & thiz ;
	IAny * this = (IAny*)_thiz;
	this->magic = 185931549 ;
    /* Initializing argument 2 (desc) */
    DFBSurfaceDescription _desc ;
    {
        /* Tested function call */
        DFBResult _return  = IDirectFBImageProvider_PNM_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_ASSERT_UINTEGER_EQUAL((DSPF_A8), (_desc.pixelformat));
        CPPTEST_ASSERT_INTEGER_EQUAL(30, (_desc.width));
        CPPTEST_ASSERT_INTEGER_EQUAL(40, (_desc.height));
    }
}
/* CPPTEST_TEST_CASE_END test_IDirectFBImageProvider_PNM_GetSurfaceDescription_format_PGM */

/* CPPTEST_TEST_CASE_BEGIN test_IDirectFBImageProvider_PNM_GetSurfaceDescription_fault */
/* CPPTEST_TEST_CASE_CONTEXT DFBResult IDirectFBImageProvider_PNM_GetSurfaceDescription(IDirectFBImageProvider *, DFBSurfaceDescription *) */
void TestSuite_idirectfbimageprovider_pnm_c_test_IDirectFBImageProvider_PNM_GetSurfaceDescription_fault()
{
    /* Pre-condition initialization */
    /* Initializing argument 1 (thiz) */
	IDirectFBImageProvider thiz;
	IDirectFBImageProvider_PNM_data data;
	thiz.priv = & data;
    IDirectFBImageProvider * _thiz  = & thiz ;
    IAny * this = (IAny*)_thiz;
    this->magic = 185931549 ;
    /* Initializing argument 2 (desc) */
    DFBSurfaceDescription * _desc  = 0 ;
    {
        /* Tested function call */
        DFBResult _return  = IDirectFBImageProvider_PNM_GetSurfaceDescription(_thiz, _desc);
        /* Post-condition check */
        CPPTEST_ASSERT_EQUAL( DFB_INVARG, ( _return ) );
    }
}
/* CPPTEST_TEST_CASE_END test_IDirectFBImageProvider_PNM_GetSurfaceDescription_fault */

/* CPPTEST_TEST_CASE_BEGIN test_IDirectFBImageProvider_PNM_SetRenderCallback_default */
/* CPPTEST_TEST_CASE_CONTEXT DFBResult IDirectFBImageProvider_PNM_SetRenderCallback(IDirectFBImageProvider *, DIRenderCallback, void *) */
void TestSuite_idirectfbimageprovider_pnm_c_test_IDirectFBImageProvider_PNM_SetRenderCallback_default()
{
    /* Pre-condition initialization */
    /* Initializing argument 1 (thiz) */
	IDirectFBImageProvider thiz;
	IDirectFBImageProvider_PNM_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 (ctx) */
    void * _ctx  = 0 ;
    {
        /* Tested function call */
        DFBResult _return  = IDirectFBImageProvider_PNM_SetRenderCallback(_thiz, _callback, _ctx);
        /* 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_PNM_SetRenderCallback_fault */

/* CPPTEST_TEST_CASE_BEGIN test_IDirectFBImageProvider_PNM_RenderTo_default */
/* CPPTEST_TEST_CASE_CONTEXT DFBResult IDirectFBImageProvider_PNM_RenderTo(IDirectFBImageProvider *, IDirectFBSurface *, const DFBRectangle *) */
void TestSuite_idirectfbimageprovider_pnm_c_test_IDirectFBImageProvider_PNM_RenderTo_fault()
{
    /* Pre-condition initialization */
    /* Initializing argument 1 (thiz) */
	IDirectFBImageProvider thiz;
	IDirectFBImageProvider_PNM_data data;
	thiz.priv = & data;
	IDirectFBImageProvider * _thiz  = & thiz ;
	IAny * this = (IAny*)_thiz;
	this->magic = 185931549 ;
    /* Initializing argument 2 (dest) */
    IDirectFBSurface * _dest  = 0 ;
    /* Initializing argument 3 (dest_rect) */
    const DFBRectangle * _dest_rect  = 0 ;
    {
        /* Tested function call */
        DFBResult _return  = IDirectFBImageProvider_PNM_RenderTo(_thiz, _dest, _dest_rect);
        /* Post-condition check */
        CPPTEST_ASSERT_EQUAL( DFB_INVARG, ( _return ) );
    }
}
/* CPPTEST_TEST_CASE_END test_IDirectFBImageProvider_PNM_RenderTo_fault */


/* CPPTEST_TEST_CASE_BEGIN test_IDirectFBImageProvider_PNM_RenderTo_default */
/* CPPTEST_TEST_CASE_CONTEXT DFBResult IDirectFBImageProvider_PNM_RenderTo(IDirectFBImageProvider *, IDirectFBSurface *, const DFBRectangle *) */
void TestSuite_idirectfbimageprovider_pnm_c_test_IDirectFBImageProvider_PNM_RenderTo_default()
{
    /* Pre-condition initialization */
    /* Initializing argument 1 (thiz) */
	IDirectFBImageProvider thiz;
	IDirectFBImageProvider_PNM_data data;
	data.render_callback = 0;
	thiz.priv = & data;
	IDirectFBImageProvider * _thiz  = & thiz ;
	IAny * this = (IAny*)_thiz;
	this->magic = 185931549 ;
    /* Initializing argument 2 (dest) */
    IDirectFBSurface  _dest ;
    IDirectFBSurface_data _surf_data;
    CoreSurface _surf;
    DFBRectangle _my_rect = {0, 0, 10, 10};

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

    _dest.priv = & _surf_data;
    /* Initializing argument 3 (dest_rect) */
    const DFBRectangle  _dest_rect = _my_rect;
    {
        /* Tested function call */
        DFBResult _return  = IDirectFBImageProvider_PNM_RenderTo(_thiz, & _dest, & _dest_rect);
        /* Post-condition check */
        CPPTEST_ASSERT_EQUAL( DFB_OK, ( _return ) );
    }
}
/* CPPTEST_TEST_CASE_END test_IDirectFBImageProvider_PNM_RenderTo_default */

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