libsoup r1174 - in branches/gnome-2-24: . tests
- From: danw svn gnome org
- To: svn-commits-list gnome org
- Subject: libsoup r1174 - in branches/gnome-2-24: . tests
- Date: Wed, 1 Oct 2008 20:56:00 +0000 (UTC)
Author: danw
Date: Wed Oct 1 20:56:00 2008
New Revision: 1174
URL: http://svn.gnome.org/viewvc/libsoup?rev=1174&view=rev
Log:
pull up xmlrpc-test php bug workaround from trunk
Modified:
branches/gnome-2-24/ChangeLog
branches/gnome-2-24/tests/xmlrpc-server-test.c
branches/gnome-2-24/tests/xmlrpc-test.c
Modified: branches/gnome-2-24/tests/xmlrpc-server-test.c
==============================================================================
--- branches/gnome-2-24/tests/xmlrpc-server-test.c (original)
+++ branches/gnome-2-24/tests/xmlrpc-server-test.c Wed Oct 1 20:56:00 2008
@@ -262,7 +262,7 @@
static void
do_xmlrpc_tests (SoupURI *uri)
{
- char *argv[7];
+ char *argv[8];
int arg, out;
gboolean ok;
GPid pid;
@@ -270,19 +270,20 @@
GIOChannel *child_out;
argv[0] = "./xmlrpc-test";
- argv[1] = "-u";
- argv[2] = soup_uri_to_string (uri, FALSE);
+ argv[1] = "-s";
+ argv[2] = "-u";
+ argv[3] = soup_uri_to_string (uri, FALSE);
for (arg = 0; arg < debug_level && arg < 3; arg++)
- argv[arg + 3] = "-d";
- argv[arg + 3] = NULL;
+ argv[arg + 4] = "-d";
+ argv[arg + 4] = NULL;
ok = g_spawn_async_with_pipes (NULL, argv, NULL,
G_SPAWN_DO_NOT_REAP_CHILD,
NULL, NULL, &pid,
NULL, &out, NULL,
&error);
- g_free (argv[2]);
+ g_free (argv[3]);
if (!ok) {
printf ("Could not run xmlrpc-test: %s\n", error->message);
Modified: branches/gnome-2-24/tests/xmlrpc-test.c
==============================================================================
--- branches/gnome-2-24/tests/xmlrpc-test.c (original)
+++ branches/gnome-2-24/tests/xmlrpc-test.c Wed Oct 1 20:56:00 2008
@@ -15,6 +15,7 @@
static SoupSession *session;
static const char *default_uri = "http://localhost:47524/xmlrpc-server.php";
static const char *uri = NULL;
+static gboolean server_test = FALSE;
static const char *const value_type[] = {
"BAD",
@@ -318,12 +319,20 @@
};
#define N_ECHO_STRINGS G_N_ELEMENTS (echo_strings)
+static const char *const echo_strings_broken[] = {
+ "This is a test",
+ " so is this",
+ "and so is this",
+ "amp; so is lt;thisgt;"
+};
+
static gboolean
test_echo (void)
{
GValueArray *originals, *echoes;
GValue retval;
int i;
+ gboolean php_bug = FALSE;
debug_printf (1, "echo (array of string -> array of string): ");
@@ -359,13 +368,20 @@
for (i = 0; i < echoes->n_values; i++) {
if (strcmp (echo_strings[i], g_value_get_string (&echoes->values[i])) != 0) {
- debug_printf (1, " WRONG! Mismatch at %d\n", i + 1);
- g_value_array_free (echoes);
- return FALSE;
+ if (!server_test && strcmp (echo_strings_broken[i], g_value_get_string (&echoes->values[i])) == 0)
+ php_bug = TRUE;
+ else {
+ debug_printf (1, " WRONG! Mismatch at %d\n", i + 1);
+ g_value_array_free (echoes);
+ return FALSE;
+ }
}
}
- debug_printf (1, "OK!\n");
+ if (php_bug)
+ debug_printf (1, "WRONG, but it's php's fault\n");
+ else
+ debug_printf (1, "OK!\n");
g_value_array_free (echoes);
return TRUE;
}
@@ -431,16 +447,18 @@
return do_bad_xmlrpc ("<methodCall><methodName>sum</methodName><params><param><value><int>1</int></value></param></params></methodCall>");
}
-static GOptionEntry uri_entry[] = {
+static GOptionEntry xmlrpc_entries[] = {
{ "uri", 'u', 0, G_OPTION_ARG_STRING, &uri,
"Alternate URI for server", NULL },
+ { "server-test", 's', 0, G_OPTION_ARG_NONE, &server_test,
+ "If this is being run from xmlrpc-server-test", NULL },
{ NULL }
};
int
main (int argc, char **argv)
{
- test_init (argc, argv, uri_entry);
+ test_init (argc, argv, xmlrpc_entries);
if (!uri) {
apache_init ();
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]