From: <svn...@op...> - 2009-06-23 15:37:20
|
Author: bellmich Date: Tue Jun 23 17:37:11 2009 New Revision: 1116 URL: http://libsyncml.opensync.org/changeset/1116 Log: g_type_init should always be called by the library user and not by the objects themselves Modified: trunk/libsyncml/dev_inf_api/sml_dev_inf_content_type.c trunk/libsyncml/dev_inf_api/sml_dev_inf_ctcap.c trunk/libsyncml/dev_inf_api/sml_dev_inf_data_store.c trunk/libsyncml/dev_inf_api/sml_dev_inf_prop_param.c trunk/libsyncml/dev_inf_api/sml_dev_inf_property.c trunk/tests/check_dev_inf_content_type.c trunk/tests/check_dev_inf_ctcap.c trunk/tests/check_dev_inf_data_store.c trunk/tests/check_dev_inf_prop_param.c trunk/tests/check_dev_inf_property.c Modified: trunk/libsyncml/dev_inf_api/sml_dev_inf_content_type.c ============================================================================== --- trunk/libsyncml/dev_inf_api/sml_dev_inf_content_type.c Tue Jun 23 17:22:36 2009 (r1115) +++ trunk/libsyncml/dev_inf_api/sml_dev_inf_content_type.c Tue Jun 23 17:37:11 2009 (r1116) @@ -142,7 +142,6 @@ GError **error) { CHECK_ERROR_REF - g_type_init(); SmlDevInfContentType* self = g_object_new (SML_TYPE_DEV_INF_CONTENT_TYPE, NULL); if (cttype != NULL) { Modified: trunk/libsyncml/dev_inf_api/sml_dev_inf_ctcap.c ============================================================================== --- trunk/libsyncml/dev_inf_api/sml_dev_inf_ctcap.c Tue Jun 23 17:22:36 2009 (r1115) +++ trunk/libsyncml/dev_inf_api/sml_dev_inf_ctcap.c Tue Jun 23 17:37:11 2009 (r1116) @@ -148,7 +148,6 @@ sml_dev_inf_ctcap_new (SmlDevInfContentType *ct, GError **error) { CHECK_ERROR_REF - g_type_init(); if (ct == NULL) { *error = g_error_new(SML_ERROR, SML_ERROR_GENERIC, "Every CTCap must have a content type."); Modified: trunk/libsyncml/dev_inf_api/sml_dev_inf_data_store.c ============================================================================== --- trunk/libsyncml/dev_inf_api/sml_dev_inf_data_store.c Tue Jun 23 17:22:36 2009 (r1115) +++ trunk/libsyncml/dev_inf_api/sml_dev_inf_data_store.c Tue Jun 23 17:37:11 2009 (r1116) @@ -368,7 +368,6 @@ sml_dev_inf_data_store_new (const gchar *source_ref, GError **error) { CHECK_ERROR_REF - g_type_init(); sml_return_val_error_if_fail(source_ref, NULL, error, SML_ERROR_GENERIC, "The name of the local ressource is missing.") sml_return_val_error_if_fail(strlen(source_ref) > 0, NULL, error, SML_ERROR_GENERIC, "The name of the local ressource must not be empty.") Modified: trunk/libsyncml/dev_inf_api/sml_dev_inf_prop_param.c ============================================================================== --- trunk/libsyncml/dev_inf_api/sml_dev_inf_prop_param.c Tue Jun 23 17:22:36 2009 (r1115) +++ trunk/libsyncml/dev_inf_api/sml_dev_inf_prop_param.c Tue Jun 23 17:37:11 2009 (r1116) @@ -191,7 +191,6 @@ SmlDevInfPropParam* sml_dev_inf_prop_param_new (void) { - g_type_init(); return g_object_new (SML_TYPE_DEV_INF_PROP_PARAM, NULL); } Modified: trunk/libsyncml/dev_inf_api/sml_dev_inf_property.c ============================================================================== --- trunk/libsyncml/dev_inf_api/sml_dev_inf_property.c Tue Jun 23 17:22:36 2009 (r1115) +++ trunk/libsyncml/dev_inf_api/sml_dev_inf_property.c Tue Jun 23 17:37:11 2009 (r1116) @@ -300,7 +300,6 @@ SmlDevInfProperty* sml_dev_inf_property_new (void) { - g_type_init(); return g_object_new (SML_TYPE_DEV_INF_PROPERTY, NULL); } Modified: trunk/tests/check_dev_inf_content_type.c ============================================================================== --- trunk/tests/check_dev_inf_content_type.c Tue Jun 23 17:22:36 2009 (r1115) +++ trunk/tests/check_dev_inf_content_type.c Tue Jun 23 17:37:11 2009 (r1116) @@ -24,6 +24,8 @@ START_TEST (dev_inf_content_type_create) { + g_type_init(); + GError *error = NULL; SmlDevInfContentType *ct = sml_dev_inf_content_type_new(NULL, NULL, &error); sml_fail_unless(ct != NULL, "%s", error?error->message:"No GError set."); @@ -45,6 +47,8 @@ START_TEST (dev_inf_content_type_empty_get) { + g_type_init(); + GError *error = NULL; SmlDevInfContentType *ct = sml_dev_inf_content_type_new(NULL, NULL, &error); sml_fail_unless(ct != NULL, "%s", error?error->message:"No GError set."); @@ -58,6 +62,8 @@ START_TEST (dev_inf_content_type_filled_get) { + g_type_init(); + GError *error = NULL; SmlDevInfContentType *ct = sml_dev_inf_content_type_new("text/x-vCalendar", "1.0", &error); sml_fail_unless(ct != NULL, "%s", error?error->message:"No GError set."); @@ -71,6 +77,8 @@ START_TEST (dev_inf_content_type_references) { + g_type_init(); + GError *error = NULL; SmlDevInfContentType *ct = sml_dev_inf_content_type_new("text/x-vCalendar", "1.0", &error); sml_fail_unless(ct != NULL, "%s", error?error->message:"No GError set."); Modified: trunk/tests/check_dev_inf_ctcap.c ============================================================================== --- trunk/tests/check_dev_inf_ctcap.c Tue Jun 23 17:22:36 2009 (r1115) +++ trunk/tests/check_dev_inf_ctcap.c Tue Jun 23 17:37:11 2009 (r1116) @@ -24,6 +24,8 @@ START_TEST (dev_inf_ctcap_create) { + g_type_init(); + GError *error = NULL; SmlDevInfCTCap *ctcap = sml_dev_inf_ctcap_new(NULL, &error); @@ -45,6 +47,8 @@ START_TEST (dev_inf_ctcap_empty_set) { + g_type_init(); + GError *error = NULL; SmlDevInfContentType *ct = sml_dev_inf_content_type_new(NULL, NULL, &error); sml_fail_unless(ct != NULL, "%s", error?error->message:"No GError set."); @@ -86,6 +90,8 @@ START_TEST (dev_inf_ctcap_empty_get) { + g_type_init(); + GError *error = NULL; SmlDevInfContentType *ct = sml_dev_inf_content_type_new(NULL, NULL, &error); sml_fail_unless(ct != NULL, "%s", error?error->message:"No GError set."); @@ -131,6 +137,8 @@ START_TEST (dev_inf_ctcap_filled_set) { + g_type_init(); + GError *error = NULL; SmlDevInfContentType *ct = sml_dev_inf_content_type_new(NULL, NULL, &error); sml_fail_unless(ct != NULL, "%s", error?error->message:"No GError set."); @@ -171,6 +179,8 @@ START_TEST (dev_inf_ctcap_filled_get) { + g_type_init(); + GError *error = NULL; SmlDevInfContentType *ct = sml_dev_inf_content_type_new(NULL, NULL, &error); sml_fail_unless(ct != NULL, "%s", error?error->message:"No GError set."); @@ -229,6 +239,8 @@ START_TEST (dev_inf_ctcap_references) { + g_type_init(); + GError *error = NULL; SmlDevInfContentType *ct = sml_dev_inf_content_type_new(NULL, NULL, &error); sml_fail_unless(ct != NULL, "%s", error?error->message:"No GError set."); Modified: trunk/tests/check_dev_inf_data_store.c ============================================================================== --- trunk/tests/check_dev_inf_data_store.c Tue Jun 23 17:22:36 2009 (r1115) +++ trunk/tests/check_dev_inf_data_store.c Tue Jun 23 17:37:11 2009 (r1116) @@ -22,21 +22,10 @@ #include <libsyncml/dev_inf_api/sml_dev_inf_data_store.h> -/* -is_compliant => separat - -source_ref -rx/tx/_pref -properpties - hierarchical sync - memory management max_id, mex_mem, shared_mem - sync_cap - display_nae - max_guid -*/ - START_TEST (dev_inf_data_store_create) { + g_type_init(); + GError *error = NULL; SmlDevInfDataStore *datastore = sml_dev_inf_data_store_new(NULL, &error); sml_fail_unless(datastore == NULL, "The source reference must be set."); @@ -52,6 +41,8 @@ START_TEST (dev_inf_data_store_empty_set) { + g_type_init(); + GError *error = NULL; SmlDevInfDataStore *datastore = sml_dev_inf_data_store_new("Contacts", &error); sml_fail_unless(datastore != NULL, NULL); @@ -111,6 +102,8 @@ START_TEST (dev_inf_data_store_empty_get) { + g_type_init(); + GError *error = NULL; SmlDevInfDataStore *datastore = sml_dev_inf_data_store_new("Contacts", &error); sml_fail_unless(datastore != NULL, NULL); @@ -222,6 +215,8 @@ START_TEST (dev_inf_data_store_filled_set) { + g_type_init(); + GError *error = NULL; SmlDevInfDataStore *datastore = sml_dev_inf_data_store_new("Contacts", &error); sml_fail_unless(datastore != NULL, NULL); @@ -286,6 +281,8 @@ START_TEST (dev_inf_data_store_filled_get) { + g_type_init(); + GError *error = NULL; SmlDevInfDataStore *datastore = sml_dev_inf_data_store_new("Contacts", &error); sml_fail_unless(datastore != NULL, NULL); @@ -391,6 +388,8 @@ START_TEST (dev_inf_data_store_compliance) { + g_type_init(); + GError *error = NULL; SmlDevInfDataStore *datastore = sml_dev_inf_data_store_new("Contacts", &error); sml_fail_unless(datastore != NULL, NULL); @@ -476,6 +475,8 @@ START_TEST (dev_inf_data_store_references) { + g_type_init(); + GError *error = NULL; SmlDevInfDataStore *datastore = sml_dev_inf_data_store_new("Contacts", &error); sml_fail_unless(datastore != NULL, NULL); Modified: trunk/tests/check_dev_inf_prop_param.c ============================================================================== --- trunk/tests/check_dev_inf_prop_param.c Tue Jun 23 17:22:36 2009 (r1115) +++ trunk/tests/check_dev_inf_prop_param.c Tue Jun 23 17:37:11 2009 (r1116) @@ -24,6 +24,8 @@ START_TEST (dev_inf_prop_param_create) { + g_type_init(); + SmlDevInfPropParam *propParam = sml_dev_inf_prop_param_new(); sml_fail_unless(propParam != NULL, NULL); g_object_unref(propParam); @@ -32,6 +34,8 @@ START_TEST (dev_inf_prop_param_empty_set) { + g_type_init(); + GError *error = NULL; SmlDevInfPropParam *propParam = sml_dev_inf_prop_param_new(); sml_fail_unless(propParam != NULL, NULL); @@ -86,6 +90,8 @@ START_TEST (dev_inf_prop_param_empty_get) { + g_type_init(); + GError *error = NULL; SmlDevInfPropParam *propParam = sml_dev_inf_prop_param_new(); sml_fail_unless(propParam != NULL, NULL); @@ -157,6 +163,8 @@ START_TEST (dev_inf_prop_param_filled_set) { + g_type_init(); + GError *error = NULL; SmlDevInfPropParam *propParam = sml_dev_inf_prop_param_new(); sml_fail_unless(propParam != NULL, NULL); @@ -173,6 +181,8 @@ START_TEST (dev_inf_prop_param_filled_get) { + g_type_init(); + GError *error = NULL; SmlDevInfPropParam *propParam = sml_dev_inf_prop_param_new(); sml_fail_unless(propParam != NULL, NULL); @@ -212,6 +222,8 @@ START_TEST (dev_inf_prop_param_references) { + g_type_init(); + GError *error = NULL; SmlDevInfPropParam *propParam = sml_dev_inf_prop_param_new(); sml_fail_unless(propParam != NULL, "Cannot create SmlDevInfPropParam."); Modified: trunk/tests/check_dev_inf_property.c ============================================================================== --- trunk/tests/check_dev_inf_property.c Tue Jun 23 17:22:36 2009 (r1115) +++ trunk/tests/check_dev_inf_property.c Tue Jun 23 17:37:11 2009 (r1116) @@ -24,6 +24,8 @@ START_TEST (dev_inf_property_create) { + g_type_init(); + SmlDevInfProperty *prop = sml_dev_inf_property_new(); sml_fail_unless(prop != NULL, NULL); g_object_unref(prop); @@ -32,6 +34,8 @@ START_TEST (dev_inf_property_empty_set) { + g_type_init(); + GError *error = NULL; SmlDevInfProperty *prop = sml_dev_inf_property_new(); sml_fail_unless(prop != NULL, NULL); @@ -100,6 +104,8 @@ START_TEST (dev_inf_property_empty_get) { + g_type_init(); + GError *error = NULL; SmlDevInfProperty *prop = sml_dev_inf_property_new(); sml_fail_unless(prop != NULL, NULL); @@ -192,6 +198,8 @@ START_TEST (dev_inf_property_size_integrity) { + g_type_init(); + GError *error = NULL; SmlDevInfProperty *prop = sml_dev_inf_property_new(); sml_fail_unless(prop != NULL, NULL); @@ -227,6 +235,8 @@ START_TEST (dev_inf_property_filled_set) { + g_type_init(); + GError *error = NULL; SmlDevInfProperty *prop = sml_dev_inf_property_new(); sml_fail_unless(prop != NULL, NULL); @@ -263,6 +273,8 @@ START_TEST (dev_inf_property_filled_get) { + g_type_init(); + GError *error = NULL; SmlDevInfProperty *prop = sml_dev_inf_property_new(); sml_fail_unless(prop != NULL, NULL); @@ -348,6 +360,8 @@ START_TEST (dev_inf_property_references) { + g_type_init(); + GError *error = NULL; SmlDevInfProperty *prop = sml_dev_inf_property_new(); sml_fail_unless(prop != NULL, "Cannot create SmlDevInfProperty."); |