test/testautomation_stdlib.c
changeset 10782 1de6d4633ee6
parent 10189 4844b48eb17b
     1.1 --- a/test/testautomation_stdlib.c	Sat Jan 07 19:55:29 2017 -0500
     1.2 +++ b/test/testautomation_stdlib.c	Sat Jan 07 22:24:45 2017 -0500
     1.3 @@ -25,13 +25,13 @@
     1.4    expected = "foo";
     1.5    SDLTest_AssertPass("Call to SDL_strlcpy(\"foo\")");
     1.6    SDLTest_AssertCheck(SDL_strcmp(text, expected) == 0, "Check text, expected: %s, got: %s", expected, text);
     1.7 -  SDLTest_AssertCheck(result == SDL_strlen(text), "Check result value, expected: %d, got: %d", SDL_strlen(text), result);
     1.8 +  SDLTest_AssertCheck(result == SDL_strlen(text), "Check result value, expected: %d, got: %d", (int) SDL_strlen(text), (int) result);
     1.9  
    1.10    result = SDL_strlcpy(text, "foo", 2);
    1.11    expected = "f";
    1.12    SDLTest_AssertPass("Call to SDL_strlcpy(\"foo\") with buffer size 2");
    1.13    SDLTest_AssertCheck(SDL_strcmp(text, expected) == 0, "Check text, expected: %s, got: %s", expected, text);
    1.14 -  SDLTest_AssertCheck(result == 3, "Check result value, expected: 3, got: %d", result);
    1.15 +  SDLTest_AssertCheck(result == 3, "Check result value, expected: 3, got: %d", (int) result);
    1.16  
    1.17    return TEST_COMPLETED;
    1.18  }
    1.19 @@ -51,7 +51,7 @@
    1.20    expected = "foo";
    1.21    SDLTest_AssertPass("Call to SDL_snprintf(\"%%s\", \"foo\")");
    1.22    SDLTest_AssertCheck(SDL_strcmp(text, expected) == 0, "Check text, expected: %s, got: %s", expected, text);
    1.23 -  SDLTest_AssertCheck(result == SDL_strlen(text), "Check result value, expected: %d, got: %d", SDL_strlen(text), result);
    1.24 +  SDLTest_AssertCheck(result == SDL_strlen(text), "Check result value, expected: %d, got: %d", (int) SDL_strlen(text), result);
    1.25  
    1.26    result = SDL_snprintf(text, 2, "%s", "foo");
    1.27    expected = "f";
    1.28 @@ -66,49 +66,49 @@
    1.29    expected = "1.000000";
    1.30    SDLTest_AssertPass("Call to SDL_snprintf(\"%%f\", 1.0)");
    1.31    SDLTest_AssertCheck(SDL_strcmp(text, expected) == 0, "Check text, expected: %s, got: %s", expected, text);
    1.32 -  SDLTest_AssertCheck(result == SDL_strlen(text), "Check result value, expected: %d, got: %d", SDL_strlen(text), result);
    1.33 +  SDLTest_AssertCheck(result == SDL_strlen(text), "Check result value, expected: %d, got: %d", (int) SDL_strlen(text), result);
    1.34  
    1.35    result = SDL_snprintf(text, sizeof(text), "%.f", 1.0);
    1.36    expected = "1";
    1.37    SDLTest_AssertPass("Call to SDL_snprintf(\"%%.f\", 1.0)");
    1.38    SDLTest_AssertCheck(SDL_strcmp(text, expected) == 0, "Check text, expected: %s, got: %s", expected, text);
    1.39 -  SDLTest_AssertCheck(result == SDL_strlen(text), "Check result value, expected: %d, got: %d", SDL_strlen(text), result);
    1.40 +  SDLTest_AssertCheck(result == SDL_strlen(text), "Check result value, expected: %d, got: %d", (int) SDL_strlen(text), result);
    1.41  
    1.42    result = SDL_snprintf(text, sizeof(text), "%#.f", 1.0);
    1.43    expected = "1.";
    1.44    SDLTest_AssertPass("Call to SDL_snprintf(\"%%#.f\", 1.0)");
    1.45    SDLTest_AssertCheck(SDL_strcmp(text, expected) == 0, "Check text, expected: %s, got: %s", expected, text);
    1.46 -  SDLTest_AssertCheck(result == SDL_strlen(text), "Check result value, expected: %d, got: %d", SDL_strlen(text), result);
    1.47 +  SDLTest_AssertCheck(result == SDL_strlen(text), "Check result value, expected: %d, got: %d", (int) SDL_strlen(text), result);
    1.48  
    1.49    result = SDL_snprintf(text, sizeof(text), "%f", 1.0 + 1.0 / 3.0);
    1.50    expected = "1.333333";
    1.51    SDLTest_AssertPass("Call to SDL_snprintf(\"%%f\", 1.0 + 1.0 / 3.0)");
    1.52    SDLTest_AssertCheck(SDL_strcmp(text, expected) == 0, "Check text, expected: %s, got: %s", expected, text);
    1.53 -  SDLTest_AssertCheck(result == SDL_strlen(text), "Check result value, expected: %d, got: %d", SDL_strlen(text), result);
    1.54 +  SDLTest_AssertCheck(result == SDL_strlen(text), "Check result value, expected: %d, got: %d", (int) SDL_strlen(text), result);
    1.55  
    1.56    result = SDL_snprintf(text, sizeof(text), "%+f", 1.0 + 1.0 / 3.0);
    1.57    expected = "+1.333333";
    1.58    SDLTest_AssertPass("Call to SDL_snprintf(\"%%+f\", 1.0 + 1.0 / 3.0)");
    1.59    SDLTest_AssertCheck(SDL_strcmp(text, expected) == 0, "Check text, expected: %s, got: %s", expected, text);
    1.60 -  SDLTest_AssertCheck(result == SDL_strlen(text), "Check result value, expected: %d, got: %d", SDL_strlen(text), result);
    1.61 +  SDLTest_AssertCheck(result == SDL_strlen(text), "Check result value, expected: %d, got: %d", (int) SDL_strlen(text), result);
    1.62  
    1.63    result = SDL_snprintf(text, sizeof(text), "%.2f", 1.0 + 1.0 / 3.0);
    1.64    expected = "1.33";
    1.65    SDLTest_AssertPass("Call to SDL_snprintf(\"%%.2f\", 1.0 + 1.0 / 3.0)");
    1.66    SDLTest_AssertCheck(SDL_strcmp(text, expected) == 0, "Check text, expected: %s, got: %s", expected, text);
    1.67 -  SDLTest_AssertCheck(result == SDL_strlen(text), "Check result value, expected: %d, got: %d", SDL_strlen(text), result);
    1.68 +  SDLTest_AssertCheck(result == SDL_strlen(text), "Check result value, expected: %d, got: %d", (int) SDL_strlen(text), result);
    1.69  
    1.70    result = SDL_snprintf(text, sizeof(text), "%6.2f", 1.0 + 1.0 / 3.0);
    1.71    expected = "  1.33";
    1.72    SDLTest_AssertPass("Call to SDL_snprintf(\"%%6.2f\", 1.0 + 1.0 / 3.0)");
    1.73    SDLTest_AssertCheck(SDL_strcmp(text, expected) == 0, "Check text, expected: '%s', got: '%s'", expected, text);
    1.74 -  SDLTest_AssertCheck(result == SDL_strlen(text), "Check result value, expected: %d, got: %d", SDL_strlen(text), result);
    1.75 +  SDLTest_AssertCheck(result == SDL_strlen(text), "Check result value, expected: %d, got: %d", (int) SDL_strlen(text), result);
    1.76  
    1.77    result = SDL_snprintf(text, sizeof(text), "%06.2f", 1.0 + 1.0 / 3.0);
    1.78    expected = "001.33";
    1.79    SDLTest_AssertPass("Call to SDL_snprintf(\"%%06.2f\", 1.0 + 1.0 / 3.0)");
    1.80    SDLTest_AssertCheck(SDL_strcmp(text, expected) == 0, "Check text, expected: '%s', got: '%s'", expected, text);
    1.81 -  SDLTest_AssertCheck(result == SDL_strlen(text), "Check result value, expected: %d, got: %d", SDL_strlen(text), result);
    1.82 +  SDLTest_AssertCheck(result == SDL_strlen(text), "Check result value, expected: %d, got: %d", (int) SDL_strlen(text), result);
    1.83  
    1.84    result = SDL_snprintf(text, 5, "%06.2f", 1.0 + 1.0 / 3.0);
    1.85    expected = "001.";
    1.86 @@ -146,7 +146,7 @@
    1.87      text = SDL_getenv(name);
    1.88      SDLTest_AssertPass("Call to SDL_getenv('%s')", name);
    1.89      if (text != NULL) {
    1.90 -      SDLTest_Log("Expected: NULL, Got: '%s' (%i)", text, SDL_strlen(text));
    1.91 +      SDLTest_Log("Expected: NULL, Got: '%s' (%i)", text, (int) SDL_strlen(text));
    1.92      }
    1.93    } while (text != NULL);
    1.94