소스 검색

Getting "(null)" when formatted printing NULL is a valid result

Sam Lantinga 5 년 전
부모
커밋
42ae9116ad
1개의 변경된 파일과 2개의 추가작업 그리고 2개의 파일을 삭제
  1. 2 2
      test/testautomation_platform.c

+ 2 - 2
test/testautomation_platform.c

@@ -384,7 +384,7 @@ int platform_testSetErrorInvalidInput(void *arg)
    if (lastError != NULL)
    if (lastError != NULL)
    {
    {
      len = SDL_strlen(lastError);
      len = SDL_strlen(lastError);
-     SDLTest_AssertCheck(len == 0,
+     SDLTest_AssertCheck(len == 0 || SDL_strcmp(lastError, "(null)") == 0,
              "SDL_GetError(): expected message len 0, was len: %i",
              "SDL_GetError(): expected message len 0, was len: %i",
              (int) len);
              (int) len);
    }
    }
@@ -404,7 +404,7 @@ int platform_testSetErrorInvalidInput(void *arg)
    if (lastError != NULL)
    if (lastError != NULL)
    {
    {
      len = SDL_strlen(lastError);
      len = SDL_strlen(lastError);
-     SDLTest_AssertCheck(len == 0,
+     SDLTest_AssertCheck(len == 0 || SDL_strcmp( lastError, "(null)" ) == 0,
              "SDL_GetError(): expected message len 0, was len: %i",
              "SDL_GetError(): expected message len 0, was len: %i",
              (int) len);
              (int) len);
    }
    }