X-Git-Url: https://vcs.maemo.org/git/?a=blobdiff_plain;f=tests%2Fcheck-hildon-color-chooser.c;h=ed51741ca34399a8dbde28e2ebff13f227c4c945;hb=824137ad5601c2df2c326253ab2ad14462cd1cf6;hp=5495e001903e5801d44036d60d764695cb8e69e1;hpb=e332a589ad93718efce61bee7d7c09314a0004b8;p=hildon diff --git a/tests/check-hildon-color-chooser.c b/tests/check-hildon-color-chooser.c index 5495e00..ed51741 100644 --- a/tests/check-hildon-color-chooser.c +++ b/tests/check-hildon-color-chooser.c @@ -8,7 +8,7 @@ * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public License * as published by the Free Software Foundation; version 2.1 of - * the License. + * the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, but * WITHOUT ANY WARRANTY; without even the implied warranty of @@ -28,8 +28,8 @@ #include "test_suites.h" #include "check_utils.h" -#include "hildon-color-chooser.h" -#include "hildon-window.h" +#include +#include #define MAX_COLOR 65535 @@ -123,8 +123,6 @@ START_TEST (test_set_color_limits) fail_if(!HILDON_IS_COLOR_CHOOSER(color_chooser), "hildon-color-chooser: Creation failed."); - b_color = gdk_color_copy(&color); - /* Test 1: Set the color #000000 */ gdk_color_parse( "#000000", &color); b_color = gdk_color_copy(&color); @@ -195,9 +193,6 @@ END_TEST /** * Purpose: Check that invalid base colors are set and get properly * Cases considered: - * - Set and get base color defined by #00FFFF and pixel 0. - * - Set and get base color defined by #0ABCDE and pixel 0. - * - Set and get base color defined by #FF00FF and pixel 0. * - Set the color (65536,65536,65536). * - Set and get base color defined by NULL color. * - Set base color on NULL object. @@ -216,8 +211,6 @@ START_TEST (test_set_color_invalid) fail_if(!HILDON_IS_COLOR_CHOOSER(color_chooser), "hildon-color-chooser: Creation failed."); - b_color = gdk_color_copy(&color); - /* Initialize color to check that invalid values doesn't set colors*/ gdk_color_parse( "#000000", &color); b_color = gdk_color_copy(&color); @@ -225,49 +218,8 @@ START_TEST (test_set_color_invalid) hildon_color_chooser_set_color(color_chooser,b_color); gdk_color_free(b_color); - /* Test 1: Set the color #00FFFF*/ - gdk_color_parse( "#00FFFF", &color); - b_color = gdk_color_copy(&color); - - hildon_color_chooser_set_color(color_chooser,b_color); - hildon_color_chooser_get_color(color_chooser,ret_color); - - fail_if ((0 != ret_color->red) || (0 != ret_color->green) || (0 != ret_color->blue), - "hildon-color-chooser: The returned RGB color is %i/%i/%i and should be %i/%i/%i", - ret_color->red, ret_color->green, ret_color->blue, - 0, 0, 0); - - gdk_color_free(b_color); - - /* Test 2: Set the color #FFFFFF */ - gdk_color_parse( "#0ABCDE", &color); - b_color = gdk_color_copy(&color); - - hildon_color_chooser_set_color(color_chooser,b_color); - hildon_color_chooser_get_color(color_chooser,ret_color); - - fail_if ((0 != ret_color->red) || (0 != ret_color->green) || (0 != ret_color->blue), - "hildon-color-chooser: The returned RGB color is %i/%i/%i and should be %i/%i/%i", - ret_color->red, ret_color->green, ret_color->blue, - 0, 0, 0); - - gdk_color_free(b_color); - - /* Test 2: Set the color #FF00FF */ - gdk_color_parse( "#FF00FF", &color); - b_color = gdk_color_copy(&color); - - hildon_color_chooser_set_color(color_chooser,b_color); - hildon_color_chooser_get_color(color_chooser,ret_color); - - fail_if ((0 != ret_color->red) || (0 != ret_color->green) || (0 != ret_color->blue), - "hildon-color-chooser: The returned RGB color is %i/%i/%i and should be %i/%i/%i", - ret_color->red, ret_color->green, ret_color->blue, - 0, 0, 0); - - gdk_color_free(b_color); - /* Test 3: Set the color (65536,65536,65536)*/ + /* Test 1: Set the color (65536,65536,65536)*/ gdk_color_parse( "#000000", &color); b_color = gdk_color_copy(&color); red = MAX_COLOR+1; @@ -286,13 +238,13 @@ START_TEST (test_set_color_invalid) ret_color->red, ret_color->green, ret_color->blue, 0, 0, 0); - /* Test 5: Set the color NULL on color chooser*/ + /* Test 2: Set the color NULL on color chooser*/ hildon_color_chooser_set_color(color_chooser,NULL); - /* Test 6: Set the color on NULL object*/ + /* Test 3: Set the color on NULL object*/ hildon_color_chooser_set_color(NULL,b_color); - /* Test 7: Get color from NULL object*/ + /* Test 4: Get color from NULL object*/ hildon_color_chooser_get_color(NULL, ret_color); if (b_color)