]> git.mxchange.org Git - simgear.git/blobdiff - simgear/misc/path_test.cxx
Fix VS2010 lack of fminf
[simgear.git] / simgear / misc / path_test.cxx
index a062a723dc0ca33cb0dc43085b8897b5412c8e9f..94f9eaad296087a327e8669ecee9b157c45b9e9d 100644 (file)
@@ -41,6 +41,20 @@ void test_dir()
     }
     
     cout << temp.path().modTime() << endl;
+
+    std::cout << "Standard Locations:"
+              << "\n - Home:      " << SGPath::standardLocation(SGPath::HOME)
+              << "\n - Desktop:   " << SGPath::standardLocation(SGPath::DESKTOP)
+              << "\n - Downloads: " << SGPath::standardLocation(SGPath::DOWNLOADS)
+              << "\n - Documents: " << SGPath::standardLocation(SGPath::DOCUMENTS)
+              << "\n - Pictures:  " << SGPath::standardLocation(SGPath::PICTURES)
+              << std::endl;
+
+    VERIFY( !SGPath::standardLocation(SGPath::HOME     ).isNull() );
+    VERIFY( !SGPath::standardLocation(SGPath::DESKTOP  ).isNull() );
+    VERIFY( !SGPath::standardLocation(SGPath::DOWNLOADS).isNull() );
+    VERIFY( !SGPath::standardLocation(SGPath::DOCUMENTS).isNull() );
+    VERIFY( !SGPath::standardLocation(SGPath::PICTURES ).isNull() );
 }
 
 SGPath::Permissions validateNone(const SGPath&)
@@ -178,12 +192,12 @@ int main(int argc, char* argv[])
     pp.append("./test-dir/file.txt");
     COMPARE(pp.create_dir(0700), -3);
 
-    pp.setPermissonChecker(&validateRead);
+    pp.setPermissionChecker(&validateRead);
     COMPARE(pp.canRead(), true);
     COMPARE(pp.canWrite(), false);
     COMPARE(pp.create_dir(0700), -3);
 
-    pp.setPermissonChecker(&validateWrite);
+    pp.setPermissionChecker(&validateWrite);
     COMPARE(pp.canRead(), false);
     COMPARE(pp.canWrite(), true);