瀏覽代碼

testfilesystem: Don't exit the application if SDL_GetBasePath isn't supported

Cameron Cawley 5 年之前
父節點
當前提交
033aa51d87
共有 1 個文件被更改,包括 9 次插入9 次删除
  1. 9 9
      test/testfilesystem.c

+ 9 - 9
test/testfilesystem.c

@@ -32,28 +32,28 @@ main(int argc, char *argv[])
     if(base_path == NULL){
       SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "Couldn't find base path: %s\n",
                    SDL_GetError());
-      return 1;
+    } else {
+        SDL_Log("base path: '%s'\n", base_path);
+        SDL_free(base_path);
     }
-    SDL_Log("base path: '%s'\n", base_path);
-    SDL_free(base_path);
 
     pref_path = SDL_GetPrefPath("libsdl", "testfilesystem");
     if(pref_path == NULL){
       SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "Couldn't find pref path: %s\n",
                    SDL_GetError());
-      return 1;
+    } else {
+        SDL_Log("pref path: '%s'\n", pref_path);
+        SDL_free(pref_path);
     }
-    SDL_Log("pref path: '%s'\n", pref_path); 
-    SDL_free(pref_path);
 
     pref_path = SDL_GetPrefPath(NULL, "testfilesystem");
     if(pref_path == NULL){
       SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "Couldn't find pref path without organization: %s\n",
                    SDL_GetError());
-      return 1;
+    } else {
+        SDL_Log("pref path: '%s'\n", pref_path);
+        SDL_free(pref_path);
     }
-    SDL_Log("pref path: '%s'\n", pref_path); 
-    SDL_free(pref_path);
 
     SDL_Quit();
     return 0;