Release 2.2.0-2
[hildon] / tests / check-hildon-color-chooser.c
index 611d5f3..ed51741 100644 (file)
@@ -1,11 +1,13 @@
 /*
- * Copyright (C) 2006 Nokia Corporation.
+ * This file is a part of hildon tests
  *
- * Contact: Luc Pionchon <luc.pionchon@nokia.com>
+ * Copyright (C) 2006, 2007 Nokia Corporation, all rights reserved.
+ *
+ * Contact: Michael Dominic Kostrzewa <michael.kostrzewa@nokia.com>
  *
  * 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; either version 2.1 of
+ * as published by the Free Software Foundation; version 2.1 of
  * the License, or (at your option) any later version.
  *
  * This library is distributed in the hope that it will be useful, but
@@ -19,7 +21,6 @@
  * 02110-1301 USA
  *
  */
-
 #include <stdlib.h>
 #include <check.h>
 #include <gtk/gtkmain.h>
@@ -27,8 +28,8 @@
 #include "test_suites.h"
 #include "check_utils.h"
 
-#include "hildon-color-chooser.h"
-#include "hildon-window.h"
+#include <hildon/hildon-color-chooser.h>
+#include <hildon/hildon-window.h>
 
 #define MAX_COLOR 65535
 
@@ -122,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);
@@ -194,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.
@@ -215,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);
@@ -224,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;
@@ -285,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)