adapted to new storage location
[feisty_meow.git] / nucleus / library / tests_filesystem / test_file_time.cpp
index 6e79f9a2b4fe10b5405259516996bce26e262d52..eae4c8d49b65f85d8bfe778de43d0fe0d41cc774 100644 (file)
@@ -57,18 +57,26 @@ int test_file_time::execute()
   FUNCDEF("execute");
 
 #ifdef __UNIX__
+  // just open the root directory on unix; always works.
   astring toppy("/");
 #endif
 #ifdef __WIN32__
-  astring toppy("c:/ntldr");  // will work for any modern windows OS.
+  // windows cannot fopen a directory.  this blows.  so we pick a file
+  // that should work for most windowses.
+  astring toppy("c:/Windows/notepad.exe");
 #endif
 
   // test storing info via the constructor.
   file_time absurdity_time(toppy);
   FILE *topdir = fopen(toppy.s(), "r");
+  ASSERT_INEQUAL(topdir, NULL_POINTER, "opening topdir for testing");
+  if (topdir == NULL_POINTER) {
+    return 1;
+  }
   file_time nutty_time(topdir);
-  struct stat sbuffer;
+
   int filenum = fileno(topdir);
+  struct stat sbuffer;
   int stat_okay = fstat(filenum, &sbuffer);
   ASSERT_FALSE(stat_okay, "failure to read filetime");
   file_time goofy_time(sbuffer.st_mtime);