From: <svn...@op...> - 2009-07-13 12:57:26
|
Author: bellmich Date: Mon Jul 13 14:57:13 2009 New Revision: 1191 URL: http://libsyncml.opensync.org/changeset/1191 Log: fixed wrong error handling in XML assembler tests Modified: trunk/tests/check_xml_assembler.c Modified: trunk/tests/check_xml_assembler.c ============================================================================== --- trunk/tests/check_xml_assembler.c Mon Jul 13 14:53:05 2009 (r1190) +++ trunk/tests/check_xml_assembler.c Mon Jul 13 14:57:13 2009 (r1191) @@ -44,11 +44,10 @@ { setup_testbed(NULL); GError *error = NULL; - GError *gerror = NULL; - SmlLocation *loc = sml_location_new_with_options("/test", NULL, &gerror); + SmlLocation *loc = sml_location_new_with_options("/test", NULL, &error); sml_fail_unless(loc != NULL, NULL); - sml_fail_unless(gerror == NULL, NULL); + sml_fail_unless(error == NULL, NULL); /* The session type must be SML_SESSION_TYPE_CLIENT * because servers of SyncML 1.1 or higher must send MaxMsgSize. @@ -82,11 +81,10 @@ { setup_testbed(NULL); GError *error = NULL; - GError *gerror = NULL; - SmlLocation *loc = sml_location_new_with_options("/test", NULL, &gerror); + SmlLocation *loc = sml_location_new_with_options("/test", NULL, &error); sml_fail_unless(loc != NULL, NULL); - sml_fail_unless(gerror == NULL, NULL); + sml_fail_unless(error == NULL, NULL); /* The session type must be SML_SESSION_TYPE_CLIENT * because servers of SyncML 1.1 or higher must send MaxMsgSize. @@ -123,11 +121,10 @@ { setup_testbed(NULL); GError *error = NULL; - GError *gerror = NULL; - SmlLocation *loc = sml_location_new_with_options("/test", NULL, &gerror); + SmlLocation *loc = sml_location_new_with_options("/test", NULL, &error); sml_fail_unless(loc != NULL, NULL); - sml_fail_unless(gerror == NULL, NULL); + sml_fail_unless(error == NULL, NULL); /* The session type must be SML_SESSION_TYPE_CLIENT * because servers of SyncML 1.1 or higher must send MaxMsgSize. @@ -179,11 +176,10 @@ { setup_testbed(NULL); GError *error = NULL; - GError *gerror = NULL; - SmlLocation *loc = sml_location_new_with_options("/test", NULL, &gerror); + SmlLocation *loc = sml_location_new_with_options("/test", NULL, &error); sml_fail_unless(loc != NULL, NULL); - sml_fail_unless(gerror == NULL, NULL); + sml_fail_unless(error == NULL, NULL); /* The session type must be SML_SESSION_TYPE_CLIENT * because servers of SyncML 1.1 or higher must send MaxMsgSize. @@ -236,11 +232,10 @@ { setup_testbed(NULL); GError *error = NULL; - GError *gerror = NULL; - SmlLocation *loc = sml_location_new_with_options("/test", NULL, &gerror); + SmlLocation *loc = sml_location_new_with_options("/test", NULL, &error); sml_fail_unless(loc != NULL, NULL); - sml_fail_unless(gerror == NULL, NULL); + sml_fail_unless(error == NULL, NULL); /* The session type must be SML_SESSION_TYPE_CLIENT * because servers of SyncML 1.1 or higher must send MaxMsgSize. @@ -306,11 +301,10 @@ { setup_testbed(NULL); GError *error = NULL; - GError *gerror = NULL; - SmlLocation *loc = sml_location_new_with_options("/test", NULL, &gerror); + SmlLocation *loc = sml_location_new_with_options("/test", NULL, &error); sml_fail_unless(loc != NULL, NULL); - sml_fail_unless(gerror == NULL, NULL); + sml_fail_unless(error == NULL, NULL); /* The session type must be SML_SESSION_TYPE_CLIENT * because servers of SyncML 1.1 or higher must send MaxMsgSize. @@ -420,11 +414,10 @@ { setup_testbed(NULL); GError *error = NULL; - GError *gerror = NULL; - SmlLocation *loc = sml_location_new_with_options("/test", NULL, &gerror); + SmlLocation *loc = sml_location_new_with_options("/test", NULL, &error); sml_fail_unless(loc != NULL, NULL); - sml_fail_unless(gerror == NULL, NULL); + sml_fail_unless(error == NULL, NULL); /* The session type must be SML_SESSION_TYPE_CLIENT * because servers of SyncML 1.1 or higher must send MaxMsgSize. @@ -523,11 +516,10 @@ { setup_testbed(NULL); GError *error = NULL; - GError *gerror = NULL; - SmlLocation *loc = sml_location_new_with_options("/test", NULL, &gerror); + SmlLocation *loc = sml_location_new_with_options("/test", NULL, &error); sml_fail_unless(loc != NULL, NULL); - sml_fail_unless(gerror == NULL, NULL); + sml_fail_unless(error == NULL, NULL); /* The session type must be SML_SESSION_TYPE_CLIENT * because servers of SyncML 1.1 or higher must send MaxMsgSize. @@ -647,11 +639,10 @@ { setup_testbed(NULL); GError *error = NULL; - GError *gerror = NULL; - SmlLocation *loc = sml_location_new_with_options("/test", NULL, &gerror); + SmlLocation *loc = sml_location_new_with_options("/test", NULL, &error); sml_fail_unless(loc != NULL, NULL); - sml_fail_unless(gerror == NULL, NULL); + sml_fail_unless(error == NULL, NULL); /* The session type must be SML_SESSION_TYPE_CLIENT * because servers of SyncML 1.1 or higher must send MaxMsgSize. @@ -682,11 +673,10 @@ { setup_testbed(NULL); GError *error = NULL; - GError *gerror = NULL; - SmlLocation *loc = sml_location_new_with_options("/test", NULL, &gerror); + SmlLocation *loc = sml_location_new_with_options("/test", NULL, &error); sml_fail_unless(loc != NULL, NULL); - sml_fail_unless(gerror == NULL, NULL); + sml_fail_unless(error == NULL, NULL); /* The session type must be SML_SESSION_TYPE_CLIENT * because servers of SyncML 1.1 or higher must send MaxMsgSize. @@ -717,11 +707,10 @@ { setup_testbed(NULL); GError *error = NULL; - GError *gerror = NULL; - SmlLocation *loc = sml_location_new_with_options("/test", NULL, &gerror); + SmlLocation *loc = sml_location_new_with_options("/test", NULL, &error); sml_fail_unless(loc != NULL, NULL); - sml_fail_unless(gerror == NULL, NULL); + sml_fail_unless(error == NULL, NULL); /* The session type must be SML_SESSION_TYPE_CLIENT * because servers of SyncML 1.1 or higher must send MaxMsgSize. @@ -763,11 +752,10 @@ { setup_testbed(NULL); GError *error = NULL; - GError *gerror = NULL; - SmlLocation *loc = sml_location_new_with_options("/test", NULL, &gerror); + SmlLocation *loc = sml_location_new_with_options("/test", NULL, &error); sml_fail_unless(loc != NULL, NULL); - sml_fail_unless(gerror == NULL, NULL); + sml_fail_unless(error == NULL, NULL); /* The session type must be SML_SESSION_TYPE_CLIENT * because servers of SyncML 1.1 or higher must send MaxMsgSize. @@ -810,11 +798,10 @@ { setup_testbed(NULL); GError *error = NULL; - GError *gerror = NULL; - SmlLocation *loc = sml_location_new_with_options("/test", NULL, &gerror); + SmlLocation *loc = sml_location_new_with_options("/test", NULL, &error); sml_fail_unless(loc != NULL, NULL); - sml_fail_unless(gerror == NULL, NULL); + sml_fail_unless(error == NULL, NULL); /* The session type must be SML_SESSION_TYPE_CLIENT * because servers of SyncML 1.1 or higher must send MaxMsgSize. @@ -885,11 +872,10 @@ { setup_testbed(NULL); GError *error = NULL; - GError *gerror = NULL; - SmlLocation *loc = sml_location_new_with_options("/test", NULL, &gerror); + SmlLocation *loc = sml_location_new_with_options("/test", NULL, &error); sml_fail_unless(loc != NULL, NULL); - sml_fail_unless(gerror == NULL, NULL); + sml_fail_unless(error == NULL, NULL); /* The session type must be SML_SESSION_TYPE_CLIENT * because servers of SyncML 1.1 or higher must send MaxMsgSize. @@ -919,9 +905,9 @@ SmlDevInf *devinf = sml_dev_inf_new(); sml_fail_unless(devinf != NULL, NULL); sml_dev_inf_set_dev_typ(devinf, SML_DEVINF_DEVTYP_WORKSTATION); - sml_fail_unless(sml_dev_inf_set_dev_id(devinf, "mydevice", &gerror), "%s", gerror?gerror->message:"No GError set."); + sml_fail_unless(sml_dev_inf_set_dev_id(devinf, "mydevice", &error), "%s", GET_ERROR_MESSAGE(error)); sml_fail_unless(devinf != NULL, NULL); - sml_fail_unless(gerror == NULL, NULL); + sml_fail_unless(error == NULL, NULL); SmlCommand *cmd = smlCommandNewDevInfPut(devinf, SML_DEVINF_VERSION_11, &error); sml_fail_unless(cmd != NULL, NULL); @@ -959,11 +945,10 @@ { setup_testbed(NULL); GError *error = NULL; - GError *gerror = NULL; - SmlLocation *loc = sml_location_new_with_options("/test", NULL, &gerror); + SmlLocation *loc = sml_location_new_with_options("/test", NULL, &error); sml_fail_unless(loc != NULL, NULL); - sml_fail_unless(gerror == NULL, NULL); + sml_fail_unless(error == NULL, NULL); /* The session type must be SML_SESSION_TYPE_CLIENT * because servers of SyncML 1.1 or higher must send MaxMsgSize. @@ -993,7 +978,7 @@ SmlDevInf *devinf = sml_dev_inf_new(); sml_fail_unless(devinf != NULL, NULL); sml_dev_inf_set_dev_typ(devinf, SML_DEVINF_DEVTYP_WORKSTATION); - sml_fail_unless(sml_dev_inf_set_dev_id(devinf, "mydevice", &gerror), "%s", gerror?gerror->message:"No GError set."); + sml_fail_unless(sml_dev_inf_set_dev_id(devinf, "mydevice", &error), "%s", GET_ERROR_MESSAGE(error)); sml_fail_unless(devinf != NULL, NULL); sml_fail_unless(error == NULL, NULL); @@ -1033,11 +1018,10 @@ { setup_testbed(NULL); GError *error = NULL; - GError *gerror = NULL; - SmlLocation *loc = sml_location_new_with_options("/test", NULL, &gerror); + SmlLocation *loc = sml_location_new_with_options("/test", NULL, &error); sml_fail_unless(loc != NULL, NULL); - sml_fail_unless(gerror == NULL, NULL); + sml_fail_unless(error == NULL, NULL); /* The session type must be SML_SESSION_TYPE_CLIENT * because servers of SyncML 1.1 or higher must send MaxMsgSize. @@ -1097,7 +1081,7 @@ smlSessionUnref(session); SmlParser *parser = start_parser(data, &error); - sml_fail_unless(parser != NULL, "%s", error->message); + sml_fail_unless(parser != NULL, "%s", GET_ERROR_MESSAGE(error)); SmlHeader *header = NULL; SmlCred *cred = NULL; @@ -1161,11 +1145,10 @@ { setup_testbed(NULL); GError *error = NULL; - GError *gerror = NULL; - SmlLocation *loc = sml_location_new_with_options("/test", NULL, &gerror); + SmlLocation *loc = sml_location_new_with_options("/test", NULL, &error); sml_fail_unless(loc != NULL, NULL); - sml_fail_unless(gerror == NULL, NULL); + sml_fail_unless(error == NULL, NULL); /* The session type must be SML_SESSION_TYPE_CLIENT * because servers of SyncML 1.1 or higher must send MaxMsgSize. @@ -1229,7 +1212,7 @@ sml_fail_unless(smlAssemblerIsStatusMissing(assm) == TRUE, NULL); SmlParser *parser = start_parser(data, &error); - sml_fail_unless(parser != NULL, "%s", error->message); + sml_fail_unless(parser != NULL, "%s", GET_ERROR_MESSAGE(error)); SmlHeader *header = NULL; SmlCred *cred = NULL; @@ -1293,7 +1276,7 @@ smlSessionUnref(session); parser = start_parser(data, &error); - sml_fail_unless(parser != NULL, "%s", error->message); + sml_fail_unless(parser != NULL, "%s", GET_ERROR_MESSAGE(error)); header = NULL; sml_fail_unless(smlParserGetHeader(parser, &header, &cred, &error), NULL); @@ -1339,11 +1322,10 @@ { setup_testbed(NULL); GError *error = NULL; - GError *gerror = NULL; - SmlLocation *loc = sml_location_new_with_options("/test", NULL, &gerror); + SmlLocation *loc = sml_location_new_with_options("/test", NULL, &error); sml_fail_unless(loc != NULL, NULL); - sml_fail_unless(gerror == NULL, NULL); + sml_fail_unless(error == NULL, NULL); /* The session type must be SML_SESSION_TYPE_CLIENT * because servers of SyncML 1.1 or higher must send MaxMsgSize. @@ -1443,11 +1425,10 @@ int num_status = 1000; GError *error = NULL; - GError *gerror = NULL; - SmlLocation *loc = sml_location_new_with_options("/test", NULL, &gerror); + SmlLocation *loc = sml_location_new_with_options("/test", NULL, &error); sml_fail_unless(loc != NULL, NULL); - sml_fail_unless(gerror == NULL, NULL); + sml_fail_unless(error == NULL, NULL); /* The session type must be SML_SESSION_TYPE_CLIENT * because servers of SyncML 1.1 or higher must send MaxMsgSize. @@ -1522,11 +1503,10 @@ int limit = 50000; GError *error = NULL; - GError *gerror = NULL; - SmlLocation *loc = sml_location_new_with_options("/test", NULL, &gerror); + SmlLocation *loc = sml_location_new_with_options("/test", NULL, &error); sml_fail_unless(loc != NULL, NULL); - sml_fail_unless(gerror == NULL, NULL); + sml_fail_unless(error == NULL, NULL); /* The session type must be SML_SESSION_TYPE_CLIENT * because servers of SyncML 1.1 or higher must send MaxMsgSize. @@ -1564,7 +1544,7 @@ sml_fail_unless(smlAssemblerAddStatus(assm, status, &error) == SML_ASSEMBLER_RESULT_OK, NULL); sml_fail_unless(error == NULL, NULL); } else if (res != SML_ASSEMBLER_RESULT_OK) { - sml_fail_unless(FALSE, "%s", error->message); + sml_fail_unless(FALSE, "%s", GET_ERROR_MESSAGE(error)); } smlStatusUnref(status); @@ -1594,7 +1574,7 @@ sml_fail_unless(smlAssemblerStartCommand(assm, NULL, cmd1, &error), NULL); sml_fail_unless(error == NULL, NULL); } else if (res != SML_ASSEMBLER_RESULT_OK) { - sml_fail_unless(FALSE, "%s", error->message); + sml_fail_unless(FALSE, "%s", GET_ERROR_MESSAGE(error)); } smlCommandUnref(cmd1); @@ -1634,11 +1614,10 @@ int limit = 500000000; GError *error = NULL; - GError *gerror = NULL; - SmlLocation *loc = sml_location_new_with_options("/test", NULL, &gerror); + SmlLocation *loc = sml_location_new_with_options("/test", NULL, &error); sml_fail_unless(loc != NULL, NULL); - sml_fail_unless(gerror == NULL, NULL); + sml_fail_unless(error == NULL, NULL); /* The session type must be SML_SESSION_TYPE_CLIENT * because servers of SyncML 1.1 or higher must send MaxMsgSize. @@ -1709,11 +1688,10 @@ int limit = 500000; GError *error = NULL; - GError *gerror = NULL; - SmlLocation *loc = sml_location_new_with_options("/test", NULL, &gerror); + SmlLocation *loc = sml_location_new_with_options("/test", NULL, &error); sml_fail_unless(loc != NULL, NULL); - sml_fail_unless(gerror == NULL, NULL); + sml_fail_unless(error == NULL, NULL); /* The session type must be SML_SESSION_TYPE_CLIENT * because servers of SyncML 1.1 or higher must send MaxMsgSize. |