soylent r250 - trunk/libsoylent/test



Author: svenp
Date: Wed Jul 30 09:48:43 2008
New Revision: 250
URL: http://svn.gnome.org/viewvc/soylent?rev=250&view=rev

Log:
enhanced attribute test

Modified:
   trunk/libsoylent/test/test-playground.c

Modified: trunk/libsoylent/test/test-playground.c
==============================================================================
--- trunk/libsoylent/test/test-playground.c	(original)
+++ trunk/libsoylent/test/test-playground.c	Wed Jul 30 09:48:43 2008
@@ -33,6 +33,15 @@
   
   SlBook *testbook = test_setup_testbook ();
   
+  /* print all attributes from all people
+  GList *people = sl_book_get_people (testbook);
+  for (; people != NULL; people = people->next)
+    {
+      SlPerson *person = people->data;
+      test_print_attributes (person);
+    }
+  */
+
   test_print ("creating some people");
   SlPerson *person_tim = sl_person_new ("Tim");
   SlPerson *person_joe = sl_person_new ("Joe");
@@ -50,7 +59,7 @@
       test_fail ("couldn't remove person from addressbook: %s", error->message);
     }
   
-  SlAttribute *attr = sl_attribute_new ("url");
+  SlAttribute *attr = sl_attribute_new_empty ("url");
   sl_attribute_add (attr, "http://www.kalterregen.de";);
   sl_attribute_add (attr, "http://planet.gnome.org";);
   
@@ -61,7 +70,12 @@
   
   sl_entity_add_attribute (SL_ENTITY (person_joe), attr);
   g_object_unref (attr);
-
+  
+  if (!sl_person_commit (person_joe, &error))
+    {
+      test_fail ("couldn't commit changes of \"Joe\": %s", error->message);
+    }
+  
   g_object_unref (person_tim);
   g_object_unref (person_joe);
   



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]