From: <svn...@op...> - 2009-07-13 13:00:56
|
Author: bellmich Date: Mon Jul 13 15:00:48 2009 New Revision: 1192 URL: http://libsyncml.opensync.org/changeset/1192 Log: fixed wrong error handling in session tests Modified: trunk/tests/check_session.c Modified: trunk/tests/check_session.c ============================================================================== --- trunk/tests/check_session.c Mon Jul 13 14:57:13 2009 (r1191) +++ trunk/tests/check_session.c Mon Jul 13 15:00:48 2009 (r1192) @@ -292,12 +292,12 @@ { GError *error = NULL; _tsp = smlTransportNew(SML_TRANSPORT_HTTP_SERVER, &error); - sml_fail_unless(_tsp != NULL, "%s", error->message); - sml_fail_unless(error == NULL, "%s", error->message); + sml_fail_unless(_tsp != NULL, "%s", GET_ERROR_MESSAGE(error)); + sml_fail_unless(error == NULL, "%s", GET_ERROR_MESSAGE(error)); SmlManager *manager = smlManagerNew(_tsp, &error); - sml_fail_unless(manager != NULL, "%s", error->message); - sml_fail_unless(error == NULL, "%s", error->message); + sml_fail_unless(manager != NULL, "%s", GET_ERROR_MESSAGE(error)); + sml_fail_unless(error == NULL, "%s", GET_ERROR_MESSAGE(error)); smlManagerSetLocalMaxMsgSize(manager, defaultMaxMsgSize); smlManagerSetLocalMaxObjSize(manager, defaultMaxObjSize); @@ -317,11 +317,10 @@ init_testbed(); 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); SmlSession *session = smlSessionNew(SML_SESSION_TYPE_CLIENT, SML_MIMETYPE_XML, SML_VERSION_12, SML_PROTOCOL_SYNCML, loc, loc, 1, 0, &error); sml_fail_unless(session != NULL, NULL); @@ -339,11 +338,10 @@ init_testbed(); 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); SmlSession *session = smlSessionNew(SML_SESSION_TYPE_CLIENT, SML_MIMETYPE_XML, SML_VERSION_12, SML_PROTOCOL_SYNCML, loc, loc, 1, 0, &error); @@ -462,7 +460,7 @@ if (GPOINTER_TO_INT(userdata) == 2) g_atomic_int_inc(&errors_received); else { - sml_fail_unless(FALSE, "%s", error->message); + sml_fail_unless(FALSE, "%s", GET_ERROR_MESSAGE(error)); abort(); } break; @@ -534,11 +532,10 @@ init_testbed(); 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); SmlSession *session = smlSessionNew(SML_SESSION_TYPE_CLIENT, SML_MIMETYPE_XML, SML_VERSION_12, SML_PROTOCOL_SYNCML, loc, loc, 1, 0, &error); SmlSessionThread *thread1 = smlSessionRunAsync(session, &to_session); @@ -576,11 +573,10 @@ init_testbed(); 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); SmlSession *session = smlSessionNew(SML_SESSION_TYPE_CLIENT, SML_MIMETYPE_XML, SML_VERSION_12, SML_PROTOCOL_SYNCML, loc, loc, 1, 0, &error); SmlSessionThread *thread1 = smlSessionRunAsync(session, &to_session); @@ -619,11 +615,10 @@ init_testbed(); 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); const char *input = "<SyncML xmlns=\"SYNCML:SYNCML1.2\"><SyncHdr><VerProto>SyncML/1.1</VerProto><VerDTD>1.2</VerDTD><MsgID>1</MsgID><SessionID>1</SessionID><Target><LocURI>/test</LocURI></Target><Source><LocURI>/test</LocURI></Source></SyncHdr><SyncBody><Alert><CmdID>1</CmdID><Item><Target><LocURI>/test</LocURI></Target><Source><LocURI>/test</LocURI></Source><Meta><Anchor xmlns=\"syncml:metinf\"><Next>last</Next><Last>next</Last></Anchor></Meta></Item><Data>200</Data></Alert><Final></Final></SyncBody></SyncML>"; @@ -673,11 +668,10 @@ init_testbed(); 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); SmlSession *session = smlSessionNew(SML_SESSION_TYPE_CLIENT, SML_MIMETYPE_XML, SML_VERSION_12, SML_PROTOCOL_SYNCML, loc, loc, 1, 0, &error); SmlSessionThread *thread1 = smlSessionRunAsync(session, &to_session); @@ -754,11 +748,10 @@ init_testbed(); 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); SmlSession *session = smlSessionNew(SML_SESSION_TYPE_CLIENT, SML_MIMETYPE_XML, SML_VERSION_12, SML_PROTOCOL_SYNCML, loc, loc, 1, 0, &error); SmlSessionThread *thread1 = smlSessionRunAsync(session, &to_session); @@ -833,11 +826,10 @@ init_testbed(); 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); SmlSession *session = smlSessionNew(SML_SESSION_TYPE_CLIENT, SML_MIMETYPE_XML, SML_VERSION_12, SML_PROTOCOL_SYNCML, loc, loc, 1, 0, &error); SmlSessionThread *thread1 = smlSessionRunAsync(session, &to_session); @@ -931,11 +923,10 @@ int num_commands = 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); SmlSession *session = smlSessionNew(SML_SESSION_TYPE_CLIENT, SML_MIMETYPE_XML, SML_VERSION_12, SML_PROTOCOL_SYNCML, loc, loc, 1, 0, &error); SmlSessionThread *thread1 = smlSessionRunAsync(session, &to_session); @@ -998,7 +989,7 @@ sml_fail_unless(end_received == 0, NULL); sml_fail_unless(smlSessionFlush(session, TRUE, &error), NULL); - sml_fail_unless(error == NULL, "%s", error->message); + sml_fail_unless(error == NULL, "%s", GET_ERROR_MESSAGE(error)); /*while (finals_received != 3) { usleep(100); @@ -1051,11 +1042,10 @@ mutex = g_mutex_new(); 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); SmlSession *session = smlSessionNew(SML_SESSION_TYPE_CLIENT, SML_MIMETYPE_XML, SML_VERSION_12, SML_PROTOCOL_SYNCML, loc, loc, 1, 0, &error); SmlSessionThread *thread1 = smlSessionRunAsync(session, &to_session); @@ -1179,11 +1169,10 @@ mutex = g_mutex_new(); 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); SmlSession *session = smlSessionNew(SML_SESSION_TYPE_CLIENT, SML_MIMETYPE_XML, SML_VERSION_12, SML_PROTOCOL_SYNCML, loc, loc, 1, 0, &error); SmlSessionThread *thread1 = smlSessionRunAsync(session, &to_session); @@ -1281,11 +1270,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); SmlSession *session = smlSessionNew(SML_SESSION_TYPE_CLIENT, SML_MIMETYPE_XML, SML_VERSION_12, SML_PROTOCOL_SYNCML, loc, loc, 1, 0, &error); SmlSessionThread *thread1 = smlSessionRunAsync(session, &to_session); @@ -1400,11 +1388,10 @@ init_testbed(); 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); const char *input = "<SyncML xmlns=\"SYNCML:SYNCML1.1\"><SyncHdr><VerProto>SyncML/1.1</VerProto><VerDTD>1.1</VerDTD><MsgID>1</MsgID><SessionID>1</SessionID><Target><LocURI>/vcards</LocURI></Target><Source><LocURI>/vcards</LocURI></Source></SyncHdr><SyncBody><Sync><CmdID>1</CmdID><Target><LocURI>/vcards</LocURI></Target><Source><LocURI>/vcards</LocURI></Source><NumberOfChanges>1</NumberOfChanges><Add><CmdID>2</CmdID><Meta><Type xmlns=\"syncml:metinf\">text/x-vcard</Type><Size>8</Size></Meta><Item><Source><LocURI>uid</LocURI></Source><Data><![CDATA[data]]></Data><MoreData></MoreData></Item></Add></Sync></SyncBody></SyncML>"; @@ -1484,11 +1471,10 @@ init_testbed(); 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); const char *input = "<SyncML xmlns=\"SYNCML:SYNCML1.1\"><SyncHdr><VerProto>SyncML/1.1</VerProto><VerDTD>1.1</VerDTD><MsgID>1</MsgID><SessionID>1</SessionID><Target><LocURI>/vcards</LocURI></Target><Source><LocURI>/vcards</LocURI></Source></SyncHdr><SyncBody><Sync><CmdID>1</CmdID><Target><LocURI>/vcards</LocURI></Target><Source><LocURI>/vcards</LocURI></Source><NumberOfChanges>1</NumberOfChanges><Add><CmdID>2</CmdID><Meta><Type xmlns=\"syncml:metinf\">text/x-vcard</Type><Size>20</Size></Meta><Item><Source><LocURI>uid</LocURI></Source><Data><![CDATA[data]]></Data><MoreData></MoreData></Item></Add></Sync></SyncBody></SyncML>"; @@ -1677,11 +1663,10 @@ init_testbed(); 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); const char *input = "<SyncML xmlns=\"SYNCML:SYNCML1.1\"><SyncHdr><VerProto>SyncML/1.1</VerProto><VerDTD>1.1</VerDTD><MsgID>1</MsgID><SessionID>1</SessionID><Target><LocURI>/vcards</LocURI></Target><Source><LocURI>/vcards</LocURI></Source></SyncHdr><SyncBody><Sync><CmdID>1</CmdID><Target><LocURI>/vcards</LocURI></Target><Source><LocURI>/vcards</LocURI></Source><NumberOfChanges>1</NumberOfChanges><Add><CmdID>2</CmdID><Meta><Type xmlns=\"syncml:metinf\">text/x-vcard</Type><Size>8</Size></Meta><Item><Source><LocURI>uid</LocURI></Source><Data><![CDATA[data]]></Data><MoreData></MoreData></Item></Add><Add><CmdID>3</CmdID><Meta><Type xmlns=\"syncml:metinf\">text/x-vcard</Type></Meta><Item><Source><LocURI>uid</LocURI></Source><Data><![CDATA[data]]></Data></Item></Add></Sync></SyncBody></SyncML>"; @@ -1728,11 +1713,10 @@ init_testbed(); 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); const char *input = "<SyncML xmlns=\"SYNCML:SYNCML1.0\"><SyncHdr><VerProto>SyncML/1.0</VerProto><VerDTD>1.0</VerDTD><MsgID>1</MsgID><SessionID>1</SessionID><Target><LocURI>/vcards</LocURI></Target><Source><LocURI>/vcards</LocURI></Source></SyncHdr><SyncBody><Sync><CmdID>1</CmdID><Target><LocURI>/vcards</LocURI></Target><Source><LocURI>/vcards</LocURI></Source><NumberOfChanges>1</NumberOfChanges><Add><CmdID>2</CmdID><Meta><Type xmlns=\"syncml:metinf\">text/x-vcard</Type><Size>8</Size></Meta><Item><Source><LocURI>uid</LocURI></Source><Data><![CDATA[data]]></Data><MoreData></MoreData></Item></Add></Sync></SyncBody></SyncML>"; @@ -1826,11 +1810,10 @@ init_testbed(); 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); const char *input = "<SyncML xmlns=\"SYNCML:SYNCML1.1\"><SyncHdr><VerProto>SyncML/1.1</VerProto><VerDTD>1.1</VerDTD><MsgID>1</MsgID><SessionID>1</SessionID><Target><LocURI>/vcards</LocURI></Target><Source><LocURI>/vcards</LocURI></Source></SyncHdr><SyncBody><Sync><CmdID>1</CmdID><Target><LocURI>/vcards</LocURI></Target><Source><LocURI>/vcards</LocURI></Source><NumberOfChanges>1</NumberOfChanges><Add><CmdID>2</CmdID><Meta><Type xmlns=\"syncml:metinf\">text/x-vcard</Type><Size>8</Size></Meta><Item><Source><LocURI>uid</LocURI></Source><Data><![CDATA[data]]></Data><MoreData></MoreData></Item></Add></Sync><Final/></SyncBody></SyncML>"; @@ -1888,11 +1871,10 @@ init_testbed(); 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); const char *input = "<SyncML xmlns=\"SYNCML:SYNCML1.1\"><SyncHdr><VerProto>SyncML/1.1</VerProto><VerDTD>1.1</VerDTD><MsgID>1</MsgID><SessionID>1</SessionID><Target><LocURI>/vcards</LocURI></Target><Source><LocURI>/vcards</LocURI></Source></SyncHdr><SyncBody><Sync><CmdID>1</CmdID><Target><LocURI>/vcards</LocURI></Target><Source><LocURI>/vcards</LocURI></Source><NumberOfChanges>1</NumberOfChanges><Add><CmdID>2</CmdID><Meta><Type xmlns=\"syncml:metinf\">text/x-vcard</Type></Meta><Item><Source><LocURI>uid</LocURI></Source><Data><![CDATA[data]]></Data><MoreData></MoreData></Item></Add></Sync></SyncBody></SyncML>"; @@ -1944,11 +1926,10 @@ init_testbed(); 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); const char *input = "<SyncML xmlns=\"SYNCML:SYNCML1.1\"><SyncHdr><VerProto>SyncML/1.1</VerProto><VerDTD>1.1</VerDTD><MsgID>1</MsgID><SessionID>1</SessionID><Target><LocURI>/vcards</LocURI></Target><Source><LocURI>/vcards</LocURI></Source></SyncHdr><SyncBody><Sync><CmdID>1</CmdID><Target><LocURI>/vcards</LocURI></Target><Source><LocURI>/vcards</LocURI></Source><NumberOfChanges>1</NumberOfChanges><Add><CmdID>2</CmdID><Meta><Type xmlns=\"syncml:metinf\">text/x-vcard</Type><Size>8</Size></Meta><Item><Source><LocURI>uid</LocURI></Source><Data><![CDATA[data]]></Data><MoreData></MoreData></Item></Add></Sync></SyncBody></SyncML>"; @@ -2030,11 +2011,10 @@ init_testbed(); 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); const char *input = "<SyncML xmlns=\"SYNCML:SYNCML1.1\"><SyncHdr><VerProto>SyncML/1.1</VerProto><VerDTD>1.1</VerDTD><MsgID>1</MsgID><SessionID>1</SessionID><Target><LocURI>/vcards</LocURI></Target><Source><LocURI>/vcards</LocURI></Source></SyncHdr><SyncBody><Sync><CmdID>1</CmdID><Target><LocURI>/vcards</LocURI></Target><Source><LocURI>/vcards</LocURI></Source><NumberOfChanges>1</NumberOfChanges><Add><CmdID>2</CmdID><Meta><Type xmlns=\"syncml:metinf\">text/x-vcard</Type><Size>9</Size></Meta><Item><Source><LocURI>uid</LocURI></Source><Data><![CDATA[data]]></Data><MoreData></MoreData></Item></Add></Sync></SyncBody></SyncML>"; @@ -2116,11 +2096,10 @@ init_testbed(); 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); const char *input = "<SyncML xmlns=\"SYNCML:SYNCML1.1\"><SyncHdr><VerProto>SyncML/1.1</VerProto><VerDTD>1.1</VerDTD><MsgID>1</MsgID><SessionID>1</SessionID><Target><LocURI>/vcards</LocURI></Target><Source><LocURI>/vcards</LocURI></Source></SyncHdr><SyncBody><Sync><CmdID>1</CmdID><Target><LocURI>/vcards</LocURI></Target><Source><LocURI>/vcards</LocURI></Source><NumberOfChanges>1</NumberOfChanges><Add><CmdID>2</CmdID><Meta><Type xmlns=\"syncml:metinf\">text/x-vcard</Type><Size>7</Size></Meta><Item><Source><LocURI>uid</LocURI></Source><Data><![CDATA[data]]></Data><MoreData></MoreData></Item></Add></Sync></SyncBody></SyncML>"; @@ -2205,11 +2184,10 @@ int objlength = 600; 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); SmlSession *session = smlSessionNew(SML_SESSION_TYPE_CLIENT, SML_MIMETYPE_XML, SML_VERSION_12, SML_PROTOCOL_SYNCML, loc, loc, 1, 0, &error); SmlSessionThread *thread1 = smlSessionRunAsync(session, &to_session); @@ -2290,11 +2268,10 @@ int objlength = 4000; 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); SmlSession *session = smlSessionNew(SML_SESSION_TYPE_CLIENT, SML_MIMETYPE_XML, SML_VERSION_12, SML_PROTOCOL_SYNCML, loc, loc, 1, 0, &error); SmlSessionThread *thread1 = smlSessionRunAsync(session, &to_session); @@ -2367,11 +2344,10 @@ int num_obj = 10; 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); SmlSession *session = smlSessionNew(SML_SESSION_TYPE_CLIENT, SML_MIMETYPE_XML, SML_VERSION_12, SML_PROTOCOL_SYNCML, loc, loc, 1, 0, &error); SmlSessionThread *thread1 = smlSessionRunAsync(session, &to_session); @@ -2447,11 +2423,10 @@ int num_obj = 5; 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); SmlSession *session = smlSessionNew(SML_SESSION_TYPE_CLIENT, SML_MIMETYPE_XML, SML_VERSION_12, SML_PROTOCOL_SYNCML, loc, loc, 1, 0, &error); SmlSessionThread *thread1 = smlSessionRunAsync(session, &to_session); @@ -2531,11 +2506,10 @@ init_testbed(); 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); SmlSession *session = smlSessionNew(SML_SESSION_TYPE_CLIENT, SML_MIMETYPE_XML, SML_VERSION_12, SML_PROTOCOL_SYNCML, loc, loc, 1, 0, &error); SmlSessionThread *thread1 = smlSessionRunAsync(session, &to_session); @@ -2551,8 +2525,8 @@ smlSessionSetDataCallback(session, _data_send_callback, &to_session2); SmlNotification *san = smlNotificationNew(SML_SAN_VERSION_11, SML_SAN_UIMODE_USER, SML_SAN_INITIATOR_SERVER, 65535, "test", "/", SML_MIMETYPE_XML, &error); - sml_fail_unless(san != NULL, "%s", error->message); - sml_fail_unless(error == NULL, "%s", error->message); + sml_fail_unless(san != NULL, "%s", GET_ERROR_MESSAGE(error)); + sml_fail_unless(error == NULL, "%s", GET_ERROR_MESSAGE(error)); SmlManager *manager = _start_manager(); smlNotificationSetManager(san, manager); |