X-Git-Url: https://main.carlh.net/gitweb/?a=blobdiff_plain;f=src%2Fpath-test.cpp;h=ce81b8faabb5d00f93985370d7fec15e8a62a5e6;hb=f6761c9d335a482925d7ad9b1b72543684afcb77;hp=c0bbce6dfa96f3788c9cfa495d0d031472e5e4b3;hpb=a6d7c84d3734a21dbe7112a3a83b791ec211a315;p=asdcplib.git diff --git a/src/path-test.cpp b/src/path-test.cpp index c0bbce6..ce81b8f 100644 --- a/src/path-test.cpp +++ b/src/path-test.cpp @@ -1,5 +1,5 @@ /* -Copyright (c) 2004-2008, John Hurst +Copyright (c) 2004-2009, John Hurst All rights reserved. Redistribution and use in source and binary forms, with or without @@ -60,6 +60,10 @@ main(int argc, const char** argv) string Path_4 = ComponentsToPath(PathList_3); string Path_5 = PathMakeAbsolute(Path_4); + + fprintf(stderr, "PathMakeAbsolute in: %s\n", Path_4.c_str()); + fprintf(stderr, "PathMakeAbsolute out: %s\n", Path_5.c_str()); + string Path_6 = ComponentsToAbsolutePath(PathList_3); assert(Path_3 == Path_6); assert(PathsAreEquivalent(Path_3, Path_6)); @@ -92,6 +96,12 @@ main(int argc, const char** argv) fprintf(stderr, "xx: \"%s\"\n", i->c_str()); assert(PathsAreEquivalent(PathMakeLocal(PathMakeCanonical(Path_7), "/tmp"), "fooo")); + string Path_8 = "tmp/foo/bar/ack"; + CreateDirectoriesInPath(Path_8); + assert(PathExists(Path_8)); + DeletePath(Path_8); + assert(!PathExists(Path_8)); + PathList_t InList, OutList; InList.push_back("tmp"); InList.push_back("Darwin"); @@ -120,6 +130,11 @@ main(int argc, const char** argv) cerr << "----------------------------------" << endl; + fsize_t free_space, total_space; + FreeSpaceForPath("/", free_space, total_space); + cerr << "Free space: " << free_space << endl; + cerr << "Total space: " << total_space << endl; + cerr << "OK" << endl; return 0;