Remove .gitignore do nothing is ignored.
[synfig.git] / ETL / trunk / test / stringf.cpp
index 3a666a3..7c8346d 100644 (file)
@@ -1,7 +1,7 @@
 /*! ========================================================================
 ** Extended Template and Library Test Suite
 ** stringf Procedure Test
-** $Id: stringf.cpp,v 1.1.1.1 2005/01/04 01:31:48 darco Exp $
+** $Id$
 **
 ** Copyright (c) 2002 Robert B. Quattlebaum Jr.
 **
@@ -40,13 +40,13 @@ int basic_test(void)
        int ret=0;
        char mystring[80]="My formatted string!";
        string myotherstring="my other string!";
-       
+
        cout<<strprintf("This is a test of >>%s<<.",mystring)<<endl;
 
        myotherstring="5 6.75 George 7";
        int i,i2;
        float f;
-       
+
 #ifndef ETL_NO_STRSCANF
        strscanf(myotherstring,"%d %f %s %d",&i, &f, mystring, &i2);
 #else
@@ -109,7 +109,26 @@ int relative_path_test()
        if(relative_path(curr_path,dest_path)!=unix_to_local_path("../../share"))
                cerr<<"Bad relative path"<<endl,ret++;
 
-       
+       cout<<endl;
+
+       curr_path=unix_to_local_path("/home/darco/projects/voria");
+       dest_path=unix_to_local_path("/home/darco/projects/voria/myfile.txt");
+       cout<<"curr_path="<<curr_path<<" dest_path="<<dest_path<<endl;
+       cout<<"relative_path="<<relative_path(curr_path,dest_path)<<endl;
+       if(relative_path(curr_path,dest_path)!=unix_to_local_path("myfile.txt"))
+               cerr<<"Bad relative path"<<endl,ret++;
+
+       cout<<endl;
+
+       curr_path=unix_to_local_path("/home/darco/projects/voria");
+       dest_path=unix_to_local_path("/home/darco/projects/voria/files/myfile.txt");
+       cout<<"curr_path="<<curr_path<<" dest_path="<<dest_path<<endl;
+       cout<<"relative_path="<<relative_path(curr_path,dest_path)<<endl;
+       if(relative_path(curr_path,dest_path)!=unix_to_local_path("files/myfile.txt"))
+               cerr<<"Bad relative path"<<endl,ret++;
+
+       cout<<endl;
+
        curr_path=unix_to_local_path("/usr/local/../include/sys/../linux/linux.h");
        cout<<"dirty_path="<<curr_path<<endl;
        cout<<"clean_path="<<cleanup_path(curr_path)<<endl;
@@ -124,7 +143,7 @@ int relative_path_test()
 int main()
 {
        int error=0;
-       
+
        error+=basic_test();
        error+=base_and_dir_name_test();
        error+=relative_path_test();