testfilesystem: Don't exit the application if SDL_GetBasePath isn't supported
authorCameron Cawley <ccawley2011@gmail.com>
Thu, 13 Feb 2020 22:58:04 +0000
changeset 13525df0f883cc273
parent 13524 9761858bd6a3
child 13526 2b708d63875d
testfilesystem: Don't exit the application if SDL_GetBasePath isn't supported
test/testfilesystem.c
     1.1 --- a/test/testfilesystem.c	Fri Feb 14 16:17:17 2020 -0800
     1.2 +++ b/test/testfilesystem.c	Thu Feb 13 22:58:04 2020 +0000
     1.3 @@ -32,28 +32,28 @@
     1.4      if(base_path == NULL){
     1.5        SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "Couldn't find base path: %s\n",
     1.6                     SDL_GetError());
     1.7 -      return 1;
     1.8 +    } else {
     1.9 +        SDL_Log("base path: '%s'\n", base_path);
    1.10 +        SDL_free(base_path);
    1.11      }
    1.12 -    SDL_Log("base path: '%s'\n", base_path);
    1.13 -    SDL_free(base_path);
    1.14  
    1.15      pref_path = SDL_GetPrefPath("libsdl", "testfilesystem");
    1.16      if(pref_path == NULL){
    1.17        SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "Couldn't find pref path: %s\n",
    1.18                     SDL_GetError());
    1.19 -      return 1;
    1.20 +    } else {
    1.21 +        SDL_Log("pref path: '%s'\n", pref_path);
    1.22 +        SDL_free(pref_path);
    1.23      }
    1.24 -    SDL_Log("pref path: '%s'\n", pref_path); 
    1.25 -    SDL_free(pref_path);
    1.26  
    1.27      pref_path = SDL_GetPrefPath(NULL, "testfilesystem");
    1.28      if(pref_path == NULL){
    1.29        SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "Couldn't find pref path without organization: %s\n",
    1.30                     SDL_GetError());
    1.31 -      return 1;
    1.32 +    } else {
    1.33 +        SDL_Log("pref path: '%s'\n", pref_path);
    1.34 +        SDL_free(pref_path);
    1.35      }
    1.36 -    SDL_Log("pref path: '%s'\n", pref_path); 
    1.37 -    SDL_free(pref_path);
    1.38  
    1.39      SDL_Quit();
    1.40      return 0;