summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: eb273c6)
raw | patch | inline | side by side (parent: eb273c6)
author | ishmal <ishmal@users.sourceforge.net> | |
Thu, 29 Mar 2007 21:06:24 +0000 (21:06 +0000) | ||
committer | ishmal <ishmal@users.sourceforge.net> | |
Thu, 29 Mar 2007 21:06:24 +0000 (21:06 +0000) |
src/dom/work/testuri.cpp | patch | blob | history |
index 3abb6a574a11d61d27308ed50c1a0eb362bb615b..eed2aba5a3984538cbf0f5934dc56fb0e5c3d162 100644 (file)
--- a/src/dom/work/testuri.cpp
+++ b/src/dom/work/testuri.cpp
* Authors:
* Bob Jamison
*
- * Copyright (C) 2006 Bob Jamison
+ * Copyright (C) 2006-2007 Bob Jamison
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
static bool doURI(char *uristr)
{
org::w3c::dom::URI uri(uristr);
-
+ printf("##################################\n");
+ printf("String : '%s'\n", uristr);
printf("URI : '%s'\n", uri.toString().c_str());
printf("scheme : '%s'\n", uri.getSchemeStr().c_str());
printf("auth : '%s'\n", uri.getAuthority().c_str());
static bool test1()
{
+ printf("########################################\n");
+ printf("## TEST 1\n");
+ printf("########################################\n");
char *uristr = "http://www.mit.edu:80/index.html?test=good#hello";
doURI(uristr);
uristr = "http://www.mit.edu:80";
doURI(uristr);
+ uristr = "http://résumé.example.org";
+ doURI(uristr);
+
+ printf("\n\n");
return true;
}
static bool test2()
{
+ printf("########################################\n");
+ printf("## TEST 2\n");
+ printf("########################################\n");
printf("############ uri.resolve() #######\n");
URI absUri("file:/this/is/an/./absolute/path.sfx");
printf("absUri:%s\n", absUri.getPath().c_str());
printf("relUri:%s\n", relUri.getPath().c_str());
URI resUri = absUri.resolve(relUri);
printf("resUri:%s\n", resUri.getPath().c_str());
+
+ printf("\n\n");
return true;
}
static bool test3()
{
+ printf("########################################\n");
+ printf("## TEST 3\n");
+ printf("########################################\n");
printf("############ windows-style uri.resolve() #######\n");
URI absUri("file:C:\\this\\is\\an\\.\\absolute/path.sfx");
printf("absUri:%s\n", absUri.getPath().c_str());
URI resUri = absUri.resolve(relUri);
printf("resUri:%s\n", resUri.getPath().c_str());
printf("resUri:%s\n", resUri.getNativePath().c_str());
+
+ printf("\n\n");
return true;
}
+
int main(int argc, char **argv)
{
if (!test1())