Update video_getSetWindowSize for windows
authorAndreas Schiffler <aschiffler@ferzkopp.net>
Thu, 08 Aug 2013 22:10:00 -0700
changeset 761590ff13467550
parent 7614 af0bd07212bd
child 7616 1eaa3b3c55c5
Update video_getSetWindowSize for windows
test/testautomation_video.c
     1.1 --- a/test/testautomation_video.c	Thu Aug 08 21:29:30 2013 -0700
     1.2 +++ b/test/testautomation_video.c	Thu Aug 08 22:10:00 2013 -0700
     1.3 @@ -1081,6 +1081,7 @@
     1.4    SDL_Window* window;
     1.5    int result;
     1.6    SDL_Rect display;
     1.7 +  int maxwVariation, maxhVariation;
     1.8    int wVariation, hVariation;
     1.9    int referenceW, referenceH;
    1.10    int currentW, currentH;
    1.11 @@ -1096,8 +1097,18 @@
    1.12    window = _createVideoSuiteTestWindow(title);
    1.13    if (window == NULL) return TEST_ABORTED;
    1.14  
    1.15 -  for (wVariation = 0; wVariation < 4; wVariation++) {
    1.16 -   for (hVariation = 0; hVariation < 4; hVariation++) {
    1.17 +#ifdef __WIN32__
    1.18 +  /* Platform clips window size to screen size */
    1.19 +  maxwVariation = 4;
    1.20 +  maxhVariation = 4;
    1.21 +#else
    1.22 +  /* Platform allows window size >= screen size */
    1.23 +  maxwVariation = 5;
    1.24 +  maxhVariation = 5;
    1.25 +#endif
    1.26 +  
    1.27 +  for (wVariation = 0; wVariation < maxwVariation; wVariation++) {
    1.28 +   for (hVariation = 0; hVariation < maxhVariation; hVariation++) {
    1.29      switch(wVariation) {
    1.30       case 0:
    1.31        /* 1 Pixel Wide */
    1.32 @@ -1108,10 +1119,14 @@
    1.33        desiredW = SDLTest_RandomIntegerInRange(1, 100);
    1.34        break;
    1.35       case 2:
    1.36 +      /* Width 1 pixel smaller than screen */
    1.37 +      desiredW = display.w - 1;
    1.38 +      break;
    1.39 +     case 3:
    1.40        /* Width at screen size */
    1.41        desiredW = display.w;
    1.42        break;
    1.43 -     case 3:
    1.44 +     case 4:
    1.45        /* Width 1 pixel larger than screen */
    1.46        desiredW = display.w + 1;
    1.47        break;
    1.48 @@ -1127,10 +1142,14 @@
    1.49        desiredH = SDLTest_RandomIntegerInRange(1, 100);
    1.50        break;
    1.51       case 2:
    1.52 +      /* Height 1 pixel smaller than screen */
    1.53 +      desiredH = display.h - 1;
    1.54 +      break;
    1.55 +     case 3:
    1.56        /* Height at screen size */
    1.57        desiredH = display.h;
    1.58        break;
    1.59 -     case 3:
    1.60 +     case 4:
    1.61        /* Height 1 pixel larger than screen */
    1.62        desiredH = display.h + 1;
    1.63        break;
    1.64 @@ -1152,13 +1171,13 @@
    1.65      currentW = desiredW + 1;
    1.66      SDL_GetWindowSize(window, &currentW, NULL);
    1.67      SDLTest_AssertPass("Call to SDL_GetWindowSize(&h=NULL)");
    1.68 -    SDLTest_AssertCheck(desiredW == currentW, "Verify returned width; expected: %d, got: %d", desiredW, currentH);
    1.69 +    SDLTest_AssertCheck(desiredW == currentW, "Verify returned width; expected: %d, got: %d", desiredW, currentW);
    1.70  
    1.71      /* Get just height */
    1.72      currentH = desiredH + 1;
    1.73      SDL_GetWindowSize(window, NULL, &currentH);
    1.74      SDLTest_AssertPass("Call to SDL_GetWindowSize(&w=NULL)");
    1.75 -    SDLTest_AssertCheck(desiredH == currentH, "Verify returned height; expected: %d, got: %d", desiredW, currentH);
    1.76 +    SDLTest_AssertCheck(desiredH == currentH, "Verify returned height; expected: %d, got: %d", desiredH, currentH);
    1.77     }
    1.78    }
    1.79