void testCheckedProperty() { TESTIFY_ASSERT_EQUAL( maWidgetSetProperty( getTestWidgetHandle( ), MAW_TOGGLE_BUTTON_CHECKED, "false" ), MAW_RES_OK ); char checkedBuffer[256]; TESTIFY_ASSERT_EQUAL( maWidgetGetProperty( getTestWidgetHandle( ), MAW_TOGGLE_BUTTON_CHECKED, checkedBuffer, 256 ), strlen( "false" ) ); TESTIFY_ASSERT_EQUAL( strcmp( checkedBuffer, "false" ), 0 ); TESTIFY_ASSERT_EQUAL( maWidgetGetProperty( getTestWidgetHandle( ), MAW_TOGGLE_BUTTON_CHECKED, checkedBuffer, 1 ), MAW_RES_INVALID_STRING_BUFFER_SIZE ); }
/** * Tests to add and remove children from the layout. */ void testAddAndRemoveChildren() { MAWidgetHandle children[ 10 ]; for(int i = 0; i < NUM_CHILDREN; i++) { children[ i ] = maWidgetCreate( MAW_LABEL ); TESTIFY_ASSERT( children[ i ] >= 0 ); TESTIFY_ASSERT_EQUAL( maWidgetAddChild( getTestWidgetHandle( ), children[ i ] ), MAW_RES_OK ); } for(int i = 0; i < NUM_CHILDREN; i++) { TESTIFY_ASSERT_EQUAL( maWidgetRemoveChild( children[ i ] ), MAW_RES_OK ); TESTIFY_ASSERT_EQUAL( maWidgetDestroy( children[ i ] ), MAW_RES_OK ); } }
/** * The purpose of this test is to test all properties that * you can set on a screen. */ void testIconProperty() { TESTIFY_ASSERT_EQUAL( maWidgetSetProperty( getTestWidgetHandle( ), MAW_LIST_VIEW_ITEM_ICON, getIconHandleAsString( ) ), MAW_RES_OK ); }
/** * The purpose of this test is to test all properties that * you can set on a screen. */ void testImageBackgroundProperty() { TESTIFY_ASSERT_EQUAL( maWidgetSetProperty( getTestWidgetHandle( ), MAW_IMAGE_BUTTON_BACKGROUND_IMAGE, getIconHandleAsString( ) ), MAW_RES_OK ); }
void WidgetTest::testSetProperty(const char *property, const char *value, int expectedReturn) { TESTIFY_ASSERT_EQUAL( maWidgetSetProperty( getTestWidgetHandle( ), property, value ), expectedReturn ); }
/** * The purpose of this test is to test all properties that * you can set on a screen. */ void testImageProperty() { TESTIFY_ASSERT_EQUAL( maWidgetSetProperty( getTestWidgetHandle( ), MAW_IMAGE_IMAGE, getIconHandleAsString( ) ), MAW_RES_OK ); }