diff options
author | Dan Winship <danw@src.gnome.org> | 2000-04-18 02:09:44 +0800 |
---|---|---|
committer | Dan Winship <danw@src.gnome.org> | 2000-04-18 02:09:44 +0800 |
commit | 7a3db9a6aba4ba47e859e8c46405f9e086d3cf00 (patch) | |
tree | baa641231b17f56447e6cc8e08a861a926a9c3a3 | |
parent | 8587c7559b4f52dafcb8cb6163248ac31f8ecbce (diff) | |
download | gsoc2013-evolution-7a3db9a6aba4ba47e859e8c46405f9e086d3cf00.tar.gz gsoc2013-evolution-7a3db9a6aba4ba47e859e8c46405f9e086d3cf00.tar.zst gsoc2013-evolution-7a3db9a6aba4ba47e859e8c46405f9e086d3cf00.zip |
New program to test CamelURL
* tests/test-url.c: New program to test CamelURL
svn path=/trunk/; revision=2473
-rw-r--r-- | ChangeLog | 4 | ||||
-rw-r--r-- | tests/Makefile.am | 1 | ||||
-rw-r--r-- | tests/test-url.c | 37 |
3 files changed, 42 insertions, 0 deletions
@@ -1,3 +1,7 @@ +2000-04-17 Dan Winship <danw@helixcode.com> + + * tests/test-url.c: New program to test CamelURL + 2000-04-16 Christopher James Lahey <clahey@helixcode.com> * addressbook/backend/ebook/e-card.c, diff --git a/tests/Makefile.am b/tests/Makefile.am index 934c9f37a1..4f97b9e143 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -63,6 +63,7 @@ noinst_PROGRAMS = \ test11 \ test12 \ test-movemail \ + test-url \ $(THREAD_RELATED_TESTS) # test-formatter diff --git a/tests/test-url.c b/tests/test-url.c new file mode 100644 index 0000000000..5d8d75951b --- /dev/null +++ b/tests/test-url.c @@ -0,0 +1,37 @@ +#include <camel.h> + +int main (int argc, char **argv) +{ + CamelURL *url; + CamelException *ex; + + if (argc != 2) { + fprintf (stderr, "Usage: test-url URL\n"); + exit (1); + } + + ex = camel_exception_new (); + url = camel_url_new (argv[1], ex); + if (!url) { + fprintf (stderr, "Could not parse URL:\n%s", + camel_exception_get_description (ex)); + exit (1); + } + + printf ("URL : %s\n\n", camel_url_to_string (url, TRUE)); + printf ("Protocol: %s\n", url->protocol); + if (url->user) + printf ("User : %s\n", url->user); + if (url->authmech) + printf ("Authmech: %s\n", url->authmech); + if (url->passwd) + printf ("Password: %s\n", url->passwd); + if (url->host) + printf ("Host : %s\n", url->host); + if (url->port) + printf ("Port : %d\n", url->port); + if (url->path) + printf ("Path : %s\n", url->path); + + return 0; +} |