[gom] tests: Fix the unit tests
- From: Bastien Nocera <hadess src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gom] tests: Fix the unit tests
- Date: Wed, 7 May 2014 07:10:17 +0000 (UTC)
commit c0abfa9ecf107b45922044a7f7df988bbfc6636f
Author: Mathieu Bridon <bochecha fedoraproject org>
Date: Wed May 7 10:45:09 2014 +0800
tests: Fix the unit tests
The unit tests were setting the primary key before the property existed,
which used to be silently accepted until commit f416919.
tests/test-gom-find.c | 2 +-
tests/test-gom-migration.c | 2 +-
tests/test-gom-stress.c | 2 +-
tests/test-gom-transform.c | 2 +-
4 files changed, 4 insertions(+), 4 deletions(-)
---
diff --git a/tests/test-gom-find.c b/tests/test-gom-find.c
index 2deb669..6c06004 100644
--- a/tests/test-gom-find.c
+++ b/tests/test-gom-find.c
@@ -132,7 +132,6 @@ bookmarks_resource_class_init (BookmarksResourceClass *klass)
resource_class = GOM_RESOURCE_CLASS(klass);
gom_resource_class_set_table(resource_class, "bookmarks");
- gom_resource_class_set_primary_key(resource_class, "id");
specs[PROP_ID] = g_param_spec_string("id",
"ID",
@@ -141,6 +140,7 @@ bookmarks_resource_class_init (BookmarksResourceClass *klass)
G_PARAM_READWRITE);
g_object_class_install_property(object_class, PROP_ID,
specs[PROP_ID]);
+ gom_resource_class_set_primary_key(resource_class, "id");
specs[PROP_URL] = g_param_spec_string("url",
"URL",
diff --git a/tests/test-gom-migration.c b/tests/test-gom-migration.c
index 3945467..f3ce4a3 100644
--- a/tests/test-gom-migration.c
+++ b/tests/test-gom-migration.c
@@ -122,7 +122,6 @@ bookmarks_resource_class_init (BookmarksResourceClass *klass)
resource_class = GOM_RESOURCE_CLASS(klass);
gom_resource_class_set_table(resource_class, "bookmarks");
- gom_resource_class_set_primary_key(resource_class, "id");
specs[PROP_ID] = g_param_spec_string("id",
"ID",
@@ -131,6 +130,7 @@ bookmarks_resource_class_init (BookmarksResourceClass *klass)
G_PARAM_READWRITE);
g_object_class_install_property(object_class, PROP_ID,
specs[PROP_ID]);
+ gom_resource_class_set_primary_key(resource_class, "id");
specs[PROP_URL] = g_param_spec_string("url",
"URL",
diff --git a/tests/test-gom-stress.c b/tests/test-gom-stress.c
index 07dba03..7c2da7b 100644
--- a/tests/test-gom-stress.c
+++ b/tests/test-gom-stress.c
@@ -110,7 +110,6 @@ item_resource_class_init (ItemResourceClass *klass)
resource_class = GOM_RESOURCE_CLASS(klass);
gom_resource_class_set_table(resource_class, "items");
- gom_resource_class_set_primary_key(resource_class, "id");
specs[PROP_ID] = g_param_spec_uint("id",
"ID",
@@ -119,6 +118,7 @@ item_resource_class_init (ItemResourceClass *klass)
G_PARAM_READWRITE);
g_object_class_install_property(object_class, PROP_ID,
specs[PROP_ID]);
+ gom_resource_class_set_primary_key(resource_class, "id");
specs[PROP_FIRST_NAME] = g_param_spec_string("first-name",
"First name",
diff --git a/tests/test-gom-transform.c b/tests/test-gom-transform.c
index e8b9657..3a81fea 100644
--- a/tests/test-gom-transform.c
+++ b/tests/test-gom-transform.c
@@ -169,7 +169,6 @@ item_resource_class_init (ItemResourceClass *klass)
resource_class = GOM_RESOURCE_CLASS(klass);
gom_resource_class_set_table(resource_class, "items");
- gom_resource_class_set_primary_key(resource_class, "id");
specs[PROP_ID] = g_param_spec_uint("id",
"ID",
@@ -178,6 +177,7 @@ item_resource_class_init (ItemResourceClass *klass)
G_PARAM_READWRITE);
g_object_class_install_property(object_class, PROP_ID,
specs[PROP_ID]);
+ gom_resource_class_set_primary_key(resource_class, "id");
specs[PROP_PARENT_ID] = g_param_spec_uint("parent-id",
"Parent ID",
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]