[libsoup/wip/xclaesse/xmlrpc: 2/10] xmlrpc: Test parsing fault response
- From: Xavier Claessens <xclaesse src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [libsoup/wip/xclaesse/xmlrpc: 2/10] xmlrpc: Test parsing fault response
- Date: Tue, 23 Jun 2015 14:47:15 +0000 (UTC)
commit 8848b1ef518a4b6e2fc2acc3f5104a75650c056e
Author: Xavier Claessens <xavier claessens collabora com>
Date: Fri Jun 12 23:07:15 2015 -0400
xmlrpc: Test parsing fault response
https://bugzilla.gnome.org/show_bug.cgi?id=746495
tests/xmlrpc-variant-test.c | 18 ++++++++++++++++++
1 files changed, 18 insertions(+), 0 deletions(-)
---
diff --git a/tests/xmlrpc-variant-test.c b/tests/xmlrpc-variant-test.c
index d5de84a..0d49dc8 100644
--- a/tests/xmlrpc-variant-test.c
+++ b/tests/xmlrpc-variant-test.c
@@ -227,6 +227,23 @@ test_deserializer (void)
"</params>");
}
+static void
+test_fault (void)
+{
+ gchar *body;
+ GVariant *reply;
+ GError *error = NULL;
+
+ body = soup_xmlrpc_build_fault (1, "error: %s", "failed");
+ reply = soup_xmlrpc_parse_response (body, strlen (body), NULL, &error);
+ g_assert_error (error, SOUP_XMLRPC_FAULT, 1);
+ g_assert_cmpstr (error->message, ==, "error: failed");
+ g_assert (reply == NULL);
+
+ g_free (body);
+ g_clear_error (&error);
+}
+
int
main (int argc, char **argv)
{
@@ -234,6 +251,7 @@ main (int argc, char **argv)
g_test_add_func ("/xmlrpc/variant/serializer", test_serializer);
g_test_add_func ("/xmlrpc/variant/deserializer", test_deserializer);
+ g_test_add_func ("/xmlrpc/variant/fault", test_fault);
return g_test_run ();
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]