Add parameter checking to SetWindowSize functions; add tests to video suite
authorAndreas Schiffler <aschiffler@ferzkopp.net>
Fri, 08 Mar 2013 23:33:07 -0800
changeset 6984ae9c4b12f3e2
parent 6983 b72f56ab9867
child 6985 a0f905ecdda3
Add parameter checking to SetWindowSize functions; add tests to video suite
include/SDL_video.h
src/video/SDL_video.c
test/testautomation_video.c
     1.1 --- a/include/SDL_video.h	Fri Mar 08 23:04:53 2013 -0800
     1.2 +++ b/include/SDL_video.h	Fri Mar 08 23:33:07 2013 -0800
     1.3 @@ -504,6 +504,9 @@
     1.4  /**
     1.5   *  \brief Get the position of a window.
     1.6   *  
     1.7 + *  \param x        Pointer to variable for storing the x position, may be NULL
     1.8 + *  \param y        Pointer to variable for storing the y position, may be NULL
     1.9 + *
    1.10   *  \sa SDL_SetWindowPosition()
    1.11   */
    1.12  extern DECLSPEC void SDLCALL SDL_GetWindowPosition(SDL_Window * window,
    1.13 @@ -512,6 +515,9 @@
    1.14  /**
    1.15   *  \brief Set the size of a window's client area.
    1.16   *  
    1.17 + *  \param w        The width of the window, must be >0
    1.18 + *  \param h        The height of the window, must be >0
    1.19 + *
    1.20   *  \note You can't change the size of a fullscreen window, it automatically
    1.21   *        matches the size of the display mode.
    1.22   *  
    1.23 @@ -523,6 +529,9 @@
    1.24  /**
    1.25   *  \brief Get the size of a window's client area.
    1.26   *  
    1.27 + *  \param w        Pointer to variable for storing the width, may be NULL
    1.28 + *  \param h        Pointer to variable for storing the height, may be NULL
    1.29 + *  
    1.30   *  \sa SDL_SetWindowSize()
    1.31   */
    1.32  extern DECLSPEC void SDLCALL SDL_GetWindowSize(SDL_Window * window, int *w,
    1.33 @@ -530,6 +539,9 @@
    1.34      
    1.35  /**
    1.36   *  \brief Set the minimum size of a window's client area.
    1.37 + *  
    1.38 + *  \param min_w     The minimum width of the window, must be >0
    1.39 + *  \param min_h     The minimum height of the window, must be >0
    1.40   *
    1.41   *  \note You can't change the minimum size of a fullscreen window, it
    1.42   *        automatically matches the size of the display mode.
    1.43 @@ -542,7 +554,10 @@
    1.44      
    1.45  /**
    1.46   *  \brief Get the minimum size of a window's client area.
    1.47 - *
    1.48 + *  
    1.49 + *  \param w        Pointer to variable for storing the minimum width, may be NULL
    1.50 + *  \param h        Pointer to variable for storing the minimum height, may be NULL
    1.51 + *  
    1.52   *  \sa SDL_GetWindowMaximumSize()
    1.53   *  \sa SDL_SetWindowMinimumSize()
    1.54   */
    1.55 @@ -552,6 +567,9 @@
    1.56  /**
    1.57   *  \brief Set the maximum size of a window's client area.
    1.58   *
    1.59 + *  \param max_w     The maximum width of the window, must be >0
    1.60 + *  \param max_h     The maximum height of the window, must be >0
    1.61 + *
    1.62   *  \note You can't change the maximum size of a fullscreen window, it
    1.63   *        automatically matches the size of the display mode.
    1.64   *
    1.65 @@ -563,6 +581,9 @@
    1.66      
    1.67  /**
    1.68   *  \brief Get the maximum size of a window's client area.
    1.69 + *  
    1.70 + *  \param w        Pointer to variable for storing the maximum width, may be NULL
    1.71 + *  \param h        Pointer to variable for storing the maximum height, may be NULL
    1.72   *
    1.73   *  \sa SDL_GetWindowMinimumSize()
    1.74   *  \sa SDL_SetWindowMaximumSize()
     2.1 --- a/src/video/SDL_video.c	Fri Mar 08 23:04:53 2013 -0800
     2.2 +++ b/src/video/SDL_video.c	Fri Mar 08 23:33:07 2013 -0800
     2.3 @@ -1566,6 +1566,14 @@
     2.4  SDL_SetWindowSize(SDL_Window * window, int w, int h)
     2.5  {
     2.6      CHECK_WINDOW_MAGIC(window, );
     2.7 +    if (w <= 0) {
     2.8 +        SDL_InvalidParamError("w");
     2.9 +        return;
    2.10 +    }
    2.11 +    if (h <= 0) {
    2.12 +        SDL_InvalidParamError("h");
    2.13 +        return;
    2.14 +    }
    2.15  
    2.16      /* FIXME: Should this change fullscreen modes? */
    2.17      if (!(window->flags & SDL_WINDOW_FULLSCREEN)) {
    2.18 @@ -1584,30 +1592,27 @@
    2.19  void
    2.20  SDL_GetWindowSize(SDL_Window * window, int *w, int *h)
    2.21  {
    2.22 -    int dummy;
    2.23 -
    2.24 -    if (!w) {
    2.25 -        w = &dummy;
    2.26 +    CHECK_WINDOW_MAGIC(window, );
    2.27 +    if (w) {
    2.28 +        *w = window->w;
    2.29      }
    2.30 -    if (!h) {
    2.31 -        h = &dummy;
    2.32 -    }
    2.33 -
    2.34 -    *w = 0;
    2.35 -    *h = 0;
    2.36 -
    2.37 -    CHECK_WINDOW_MAGIC(window, );
    2.38 -
    2.39 -    if (_this && window && window->magic == &_this->window_magic) {
    2.40 -        *w = window->w;
    2.41 +    if (h) {
    2.42          *h = window->h;
    2.43 -    }
    2.44 +    }                                
    2.45  }
    2.46  
    2.47  void
    2.48  SDL_SetWindowMinimumSize(SDL_Window * window, int min_w, int min_h)
    2.49  {
    2.50      CHECK_WINDOW_MAGIC(window, );
    2.51 +    if (min_w <= 0) {
    2.52 +        SDL_InvalidParamError("min_w");
    2.53 +        return;
    2.54 +    }
    2.55 +    if (min_h <= 0) {
    2.56 +        SDL_InvalidParamError("min_h");
    2.57 +        return;
    2.58 +    }
    2.59      
    2.60      if (!(window->flags & SDL_WINDOW_FULLSCREEN)) {
    2.61          window->min_w = min_w;
    2.62 @@ -1623,22 +1628,11 @@
    2.63  void
    2.64  SDL_GetWindowMinimumSize(SDL_Window * window, int *min_w, int *min_h)
    2.65  {
    2.66 -    int dummy;
    2.67 -    
    2.68 -    if (!min_w) {
    2.69 -        min_w = &dummy;
    2.70 +    CHECK_WINDOW_MAGIC(window, );
    2.71 +    if (min_w) {
    2.72 +        *min_w = window->min_w;
    2.73      }
    2.74 -    if (!min_h) {
    2.75 -        min_h = &dummy;
    2.76 -    }
    2.77 -    
    2.78 -    *min_w = 0;
    2.79 -    *min_h = 0;
    2.80 -    
    2.81 -    CHECK_WINDOW_MAGIC(window, );
    2.82 -    
    2.83 -    if (_this && window && window->magic == &_this->window_magic) {
    2.84 -        *min_w = window->min_w;
    2.85 +    if (min_h) {
    2.86          *min_h = window->min_h;
    2.87      }
    2.88  }
    2.89 @@ -1647,6 +1641,14 @@
    2.90  SDL_SetWindowMaximumSize(SDL_Window * window, int max_w, int max_h)
    2.91  {
    2.92      CHECK_WINDOW_MAGIC(window, );
    2.93 +    if (max_w <= 0) {
    2.94 +        SDL_InvalidParamError("max_w");
    2.95 +        return;
    2.96 +    }
    2.97 +    if (max_h <= 0) {
    2.98 +        SDL_InvalidParamError("max_h");
    2.99 +        return;
   2.100 +    }
   2.101      
   2.102      if (!(window->flags & SDL_WINDOW_FULLSCREEN)) {
   2.103          window->max_w = max_w;
   2.104 @@ -1662,22 +1664,11 @@
   2.105  void
   2.106  SDL_GetWindowMaximumSize(SDL_Window * window, int *max_w, int *max_h)
   2.107  {
   2.108 -    int dummy;
   2.109 -    
   2.110 -    if (!max_w) {
   2.111 -        max_w = &dummy;
   2.112 +    CHECK_WINDOW_MAGIC(window, );
   2.113 +    if (max_w) {
   2.114 +        *max_w = window->max_w;
   2.115      }
   2.116 -    if (!max_h) {
   2.117 -        max_h = &dummy;
   2.118 -    }
   2.119 -    
   2.120 -    *max_w = 0;
   2.121 -    *max_h = 0;
   2.122 -    
   2.123 -    CHECK_WINDOW_MAGIC(window, );
   2.124 -    
   2.125 -    if (_this && window && window->magic == &_this->window_magic) {
   2.126 -        *max_w = window->max_w;
   2.127 +    if (max_h) {
   2.128          *max_h = window->max_h;
   2.129      }
   2.130  }
     3.1 --- a/test/testautomation_video.c	Fri Mar 08 23:04:53 2013 -0800
     3.2 +++ b/test/testautomation_video.c	Fri Mar 08 23:33:07 2013 -0800
     3.3 @@ -33,7 +33,7 @@
     3.4    y = SDLTest_RandomIntegerInRange(1, 100);
     3.5    w = SDLTest_RandomIntegerInRange(320, 1024);
     3.6    h = SDLTest_RandomIntegerInRange(320, 768);
     3.7 -  flags = SDL_WINDOW_SHOWN;
     3.8 +  flags = SDL_WINDOW_SHOWN | SDL_WINDOW_RESIZABLE | SDL_WINDOW_BORDERLESS;
     3.9    
    3.10    window = SDL_CreateWindow(title, x, y, w, h, flags);
    3.11    SDLTest_AssertPass("Call to SDL_CreateWindow('Title',%d,%d,%d,%d,%d)", x, y, w, h, flags);
    3.12 @@ -315,7 +315,6 @@
    3.13      SDLTest_AssertPass("Call to SDL_CreateWindow('Title',%d,%d,%d,%d,%d)", x, y, w, h, flags);
    3.14      SDLTest_AssertCheck(window != NULL, "Validate that returned window struct is not NULL");
    3.15  
    3.16 -
    3.17      /* Clean up */    
    3.18      _destroyVideoSuiteTestWindow(window);  
    3.19    }
    3.20 @@ -596,6 +595,25 @@
    3.21    return TEST_COMPLETED;
    3.22  }
    3.23  
    3.24 +/* Helper function that checks for an 'Invalid window' error */
    3.25 +void _checkInvalidWindowError()
    3.26 +{
    3.27 +  const char *invalidWindowError = "Invalid window";
    3.28 +  char *lastError;
    3.29 +
    3.30 + lastError = (char *)SDL_GetError();
    3.31 +  SDLTest_AssertPass("SDL_GetError()");
    3.32 +  SDLTest_AssertCheck(lastError != NULL, "Verify error message is not NULL");
    3.33 +  if (lastError != NULL) {
    3.34 +      SDLTest_AssertCheck(SDL_strcmp(lastError, invalidWindowError) == 0,
    3.35 +         "SDL_GetError(): expected message '%s', was message: '%s'",
    3.36 +         invalidWindowError,
    3.37 +         lastError);
    3.38 +      SDL_ClearError();
    3.39 +      SDLTest_AssertPass("Call to SDL_ClearError()");  
    3.40 +  }
    3.41 +}
    3.42 +
    3.43  /**
    3.44   * @brief Tests call to SDL_GetWindowDisplayMode with invalid input
    3.45   *
    3.46 @@ -605,7 +623,6 @@
    3.47  video_getWindowDisplayModeNegative(void *arg)
    3.48  {
    3.49    const char *expectedError = "Parameter 'mode' is invalid";
    3.50 -  const char *invalidWindowError = "Invalid window";
    3.51    char *lastError;
    3.52    SDL_Window* window;
    3.53    const char* title = "video_getWindowDisplayModeNegative Test Window";
    3.54 @@ -636,16 +653,8 @@
    3.55    result = SDL_GetWindowDisplayMode(NULL, &mode);
    3.56    SDLTest_AssertPass("Call to SDL_GetWindowDisplayMode(window=NULL,...)");
    3.57    SDLTest_AssertCheck(result == -1, "Validate result value; expected: -1, got: %d", result);
    3.58 -  lastError = (char *)SDL_GetError();
    3.59 -  SDLTest_AssertPass("SDL_GetError()");
    3.60 -  SDLTest_AssertCheck(lastError != NULL, "Verify error message is not NULL");
    3.61 -  if (lastError != NULL) {
    3.62 -      SDLTest_AssertCheck(SDL_strcmp(lastError, invalidWindowError) == 0,
    3.63 -         "SDL_GetError(): expected message '%s', was message: '%s'",
    3.64 -         invalidWindowError,
    3.65 -         lastError);
    3.66 -  }
    3.67 -  
    3.68 +  _checkInvalidWindowError();
    3.69 +
    3.70    return TEST_COMPLETED;
    3.71  }
    3.72  
    3.73 @@ -718,28 +727,21 @@
    3.74  int
    3.75  video_getWindowGammaRampNegative(void *arg)
    3.76  {
    3.77 -  const char *invalidWindowError = "Invalid window";
    3.78 -  char *lastError;
    3.79    const char* title = "video_getWindowGammaRampNegative Test Window";
    3.80    Uint16 red[256];
    3.81    Uint16 green[256];
    3.82    Uint16 blue[256];
    3.83    int result;
    3.84  
    3.85 +  SDL_ClearError();
    3.86 +  SDLTest_AssertPass("Call to SDL_ClearError()");
    3.87 +
    3.88    /* Call against invalid window */ 
    3.89    result = SDL_GetWindowGammaRamp(NULL, red, green, blue);
    3.90    SDLTest_AssertPass("Call to SDL_GetWindowGammaRamp(window=NULL,r,g,b)");
    3.91    SDLTest_AssertCheck(result == -1, "Validate result value; expected: -1, got: %f", result);
    3.92 -  lastError = (char *)SDL_GetError();
    3.93 -  SDLTest_AssertPass("SDL_GetError()");
    3.94 -  SDLTest_AssertCheck(lastError != NULL, "Verify error message is not NULL");
    3.95 -  if (lastError != NULL) {
    3.96 -      SDLTest_AssertCheck(SDL_strcmp(lastError, invalidWindowError) == 0,
    3.97 -         "SDL_GetError(): expected message '%s', was message: '%s'",
    3.98 -         invalidWindowError,
    3.99 -         lastError);
   3.100 -  }
   3.101 -
   3.102 +  _checkInvalidWindowError();
   3.103 +  
   3.104    return TEST_COMPLETED;
   3.105  }
   3.106  
   3.107 @@ -772,8 +774,6 @@
   3.108  int
   3.109  video_getSetWindowGrab(void *arg)
   3.110  {
   3.111 -  const char *invalidWindowError = "Invalid window";
   3.112 -  char *lastError;
   3.113    const char* title = "video_getSetWindowGrab Test Window";
   3.114    SDL_Window* window;
   3.115    SDL_bool originalState, dummyState, currentState, desiredState;
   3.116 @@ -804,39 +804,15 @@
   3.117    /* Negative tests */
   3.118    dummyState = SDL_GetWindowGrab(NULL);
   3.119    SDLTest_AssertPass("Call to SDL_GetWindowGrab(window=NULL)");
   3.120 -  lastError = (char *)SDL_GetError();
   3.121 -  SDLTest_AssertPass("SDL_GetError()");
   3.122 -  SDLTest_AssertCheck(lastError != NULL, "Verify error message is not NULL");
   3.123 -  if (lastError != NULL) {
   3.124 -      SDLTest_AssertCheck(SDL_strcmp(lastError, invalidWindowError) == 0,
   3.125 -         "SDL_GetError(): expected message '%s', was message: '%s'",
   3.126 -         invalidWindowError,
   3.127 -         lastError);
   3.128 -  }
   3.129 +  _checkInvalidWindowError();
   3.130  
   3.131    SDL_SetWindowGrab(NULL, SDL_FALSE);
   3.132    SDLTest_AssertPass("Call to SDL_SetWindowGrab(window=NULL,SDL_FALSE)");
   3.133 -  lastError = (char *)SDL_GetError();
   3.134 -  SDLTest_AssertPass("SDL_GetError()");
   3.135 -  SDLTest_AssertCheck(lastError != NULL, "Verify error message is not NULL");
   3.136 -  if (lastError != NULL) {
   3.137 -      SDLTest_AssertCheck(SDL_strcmp(lastError, invalidWindowError) == 0,
   3.138 -         "SDL_GetError(): expected message '%s', was message: '%s'",
   3.139 -         invalidWindowError,
   3.140 -         lastError);
   3.141 -  }
   3.142 +  _checkInvalidWindowError();
   3.143  
   3.144    SDL_SetWindowGrab(NULL, SDL_TRUE);
   3.145    SDLTest_AssertPass("Call to SDL_SetWindowGrab(window=NULL,SDL_FALSE)");
   3.146 -  lastError = (char *)SDL_GetError();
   3.147 -  SDLTest_AssertPass("SDL_GetError()");
   3.148 -  SDLTest_AssertCheck(lastError != NULL, "Verify error message is not NULL");
   3.149 -  if (lastError != NULL) {
   3.150 -      SDLTest_AssertCheck(SDL_strcmp(lastError, invalidWindowError) == 0,
   3.151 -         "SDL_GetError(): expected message '%s', was message: '%s'",
   3.152 -         invalidWindowError,
   3.153 -         lastError);
   3.154 -  }
   3.155 +  _checkInvalidWindowError();
   3.156    
   3.157    /* State should still be F */
   3.158    desiredState = SDL_FALSE;
   3.159 @@ -857,6 +833,7 @@
   3.160    return TEST_COMPLETED;
   3.161  }
   3.162  
   3.163 +
   3.164  /**
   3.165   * @brief Tests call to SDL_GetWindowID and SDL_GetWindowFromID
   3.166   *
   3.167 @@ -866,8 +843,6 @@
   3.168  int
   3.169  video_getWindowId(void *arg)
   3.170  {
   3.171 -  const char *invalidWindowError = "Invalid window";
   3.172 -  char *lastError;
   3.173    const char* title = "video_getWindowId Test Window";
   3.174    SDL_Window* window;
   3.175    SDL_Window* result;
   3.176 @@ -906,18 +881,12 @@
   3.177    SDLTest_AssertCheck(result == NULL, "Verify result is NULL");
   3.178  
   3.179    /* Negative test */
   3.180 +  SDL_ClearError();
   3.181 +  SDLTest_AssertPass("Call to SDL_ClearError()");
   3.182    id = SDL_GetWindowID(NULL);
   3.183    SDLTest_AssertPass("Call to SDL_GetWindowID(window=NULL)");
   3.184 -  lastError = (char *)SDL_GetError();
   3.185 -  SDLTest_AssertPass("SDL_GetError()");
   3.186 -  SDLTest_AssertCheck(lastError != NULL, "Verify error message is not NULL");
   3.187 -  if (lastError != NULL) {
   3.188 -      SDLTest_AssertCheck(SDL_strcmp(lastError, invalidWindowError) == 0,
   3.189 -         "SDL_GetError(): expected message '%s', was message: '%s'",
   3.190 -         invalidWindowError,
   3.191 -         lastError);
   3.192 -  }
   3.193 -
   3.194 +  _checkInvalidWindowError();
   3.195 +  
   3.196    return TEST_COMPLETED;
   3.197  }
   3.198  
   3.199 @@ -929,8 +898,6 @@
   3.200  int
   3.201  video_getWindowPixelFormat(void *arg)
   3.202  {
   3.203 -  const char *invalidWindowError = "Invalid window";
   3.204 -  char *lastError;
   3.205    const char* title = "video_getWindowPixelFormat Test Window";
   3.206    SDL_Window* window;
   3.207    Uint32 format;
   3.208 @@ -948,17 +915,11 @@
   3.209    _destroyVideoSuiteTestWindow(window);
   3.210      
   3.211    /* Negative test */
   3.212 +  SDL_ClearError();
   3.213 +  SDLTest_AssertPass("Call to SDL_ClearError()");
   3.214    format = SDL_GetWindowPixelFormat(NULL);
   3.215    SDLTest_AssertPass("Call to SDL_GetWindowPixelFormat(window=NULL)");
   3.216 -  lastError = (char *)SDL_GetError();
   3.217 -  SDLTest_AssertPass("SDL_GetError()");
   3.218 -  SDLTest_AssertCheck(lastError != NULL, "Verify error message is not NULL");
   3.219 -  if (lastError != NULL) {
   3.220 -      SDLTest_AssertCheck(SDL_strcmp(lastError, invalidWindowError) == 0,
   3.221 -         "SDL_GetError(): expected message '%s', was message: '%s'",
   3.222 -         invalidWindowError,
   3.223 -         lastError);
   3.224 -  }
   3.225 +  _checkInvalidWindowError();
   3.226  
   3.227    return TEST_COMPLETED;
   3.228  }
   3.229 @@ -972,8 +933,6 @@
   3.230  int
   3.231  video_getSetWindowPosition(void *arg)
   3.232  {
   3.233 -  const char *invalidWindowError = "Invalid window";
   3.234 -  char *lastError;
   3.235    const char* title = "video_getSetWindowPosition Test Window";
   3.236    SDL_Window* window;
   3.237    int xVariation, yVariation;
   3.238 @@ -1065,8 +1024,10 @@
   3.239    currentY = referenceY;
   3.240    desiredX = SDLTest_RandomSint32();
   3.241    desiredY = SDLTest_RandomSint32();
   3.242 -  
   3.243 +
   3.244    /* Negative tests */
   3.245 +  SDL_ClearError();
   3.246 +  SDLTest_AssertPass("Call to SDL_ClearError()");  
   3.247    SDL_GetWindowPosition(NULL, &currentX, &currentY);
   3.248    SDLTest_AssertPass("Call to SDL_GetWindowPosition(window=NULL)");
   3.249    SDLTest_AssertCheck(
   3.250 @@ -1074,39 +1035,453 @@
   3.251    	"Verify that content of X and Y pointers has not been modified; expected: %d,%d; got: %d,%d",
   3.252    	referenceX, referenceY,
   3.253    	currentX, currentY);
   3.254 +  _checkInvalidWindowError();
   3.255 +
   3.256 +  SDL_GetWindowPosition(NULL, NULL, NULL);
   3.257 +  SDLTest_AssertPass("Call to SDL_GetWindowPosition(NULL, NULL, NULL)");
   3.258 +  _checkInvalidWindowError();
   3.259 +
   3.260 +  SDL_SetWindowPosition(NULL, desiredX, desiredY);
   3.261 +  SDLTest_AssertPass("Call to SDL_SetWindowPosition(window=NULL)");
   3.262 +  _checkInvalidWindowError();
   3.263 +  
   3.264 +  return TEST_COMPLETED;
   3.265 +}
   3.266 +
   3.267 +/* Helper function that checks for an 'Invalid parameter' error */
   3.268 +void _checkInvalidParameterError()
   3.269 +{
   3.270 +  const char *invalidParameterError = "Parameter";
   3.271 +  char *lastError;
   3.272 +
   3.273    lastError = (char *)SDL_GetError();
   3.274    SDLTest_AssertPass("SDL_GetError()");
   3.275    SDLTest_AssertCheck(lastError != NULL, "Verify error message is not NULL");
   3.276    if (lastError != NULL) {
   3.277 -      SDLTest_AssertCheck(SDL_strcmp(lastError, invalidWindowError) == 0,
   3.278 -         "SDL_GetError(): expected message '%s', was message: '%s'",
   3.279 -         invalidWindowError,
   3.280 +      SDLTest_AssertCheck(SDL_strncmp(lastError, invalidParameterError, SDL_strlen(invalidParameterError)) == 0,
   3.281 +         "SDL_GetError(): expected message starts with '%s', was message: '%s'",
   3.282 +         invalidParameterError,
   3.283           lastError);
   3.284 +      SDL_ClearError();
   3.285 +      SDLTest_AssertPass("Call to SDL_ClearError()");  
   3.286 +  }
   3.287 +}
   3.288 +
   3.289 +/**
   3.290 + * @brief Tests call to SDL_GetWindowSize and SDL_SetWindowSize
   3.291 + *
   3.292 + * @sa http://wiki.libsdl.org/moin.fcg/SDL_GetWindowSize
   3.293 + * @sa http://wiki.libsdl.org/moin.fcg/SDL_SetWindowSize
   3.294 + */
   3.295 +int
   3.296 +video_getSetWindowSize(void *arg)
   3.297 +{
   3.298 +  const char* title = "video_getSetWindowSize Test Window";
   3.299 +  SDL_Window* window;
   3.300 +  int result;
   3.301 +  SDL_Rect display;
   3.302 +  int wVariation, hVariation;
   3.303 +  int referenceW, referenceH;
   3.304 +  int currentW, currentH;
   3.305 +  int desiredW, desiredH;
   3.306 +
   3.307 +  /* Get display bounds for size range */
   3.308 +  result = SDL_GetDisplayBounds(0, &display);
   3.309 +  SDLTest_AssertPass("SDL_GetDisplayBounds()");
   3.310 +  SDLTest_AssertCheck(result == 0, "Verify return value; expected: 0, got: %d", result);
   3.311 +  if (result != 0) return TEST_ABORTED;
   3.312 +  
   3.313 +  /* Call against new test window */ 
   3.314 +  window = _createVideoSuiteTestWindow(title);
   3.315 +  if (window == NULL) return TEST_ABORTED;
   3.316 +  
   3.317 +  for (wVariation = 0; wVariation < 4; wVariation++) {
   3.318 +   for (hVariation = 0; hVariation < 4; hVariation++) {
   3.319 +    switch(wVariation) {
   3.320 +     case 0:
   3.321 +      /* 1 Pixel Wide */  
   3.322 +      desiredW = 1;
   3.323 +      break;
   3.324 +     case 1:
   3.325 +      /* Random width inside screen */  
   3.326 +      desiredW = SDLTest_RandomIntegerInRange(1, 100);
   3.327 +      break;
   3.328 +     case 2:
   3.329 +      /* Width at screen size */  
   3.330 +      desiredW = display.w;
   3.331 +      break;
   3.332 +     case 3:
   3.333 +      /* Width 1 pixel larger than screen */  
   3.334 +      desiredW = display.w + 1;
   3.335 +      break;
   3.336 +    }
   3.337 +
   3.338 +    switch(hVariation) {
   3.339 +     case 0:
   3.340 +      /* 1 Pixel High */  
   3.341 +      desiredH = 1;
   3.342 +      break;
   3.343 +     case 1:
   3.344 +      /* Random height inside screen */  
   3.345 +      desiredH = SDLTest_RandomIntegerInRange(1, 100);
   3.346 +      break;
   3.347 +     case 2:
   3.348 +      /* Height at screen size */  
   3.349 +      desiredH = display.h;
   3.350 +      break;
   3.351 +     case 3:
   3.352 +      /* Height 1 pixel larger than screen */  
   3.353 +      desiredH = display.h + 1;
   3.354 +      break;
   3.355 +    }
   3.356 +
   3.357 +    /* Set size */
   3.358 +    SDL_SetWindowSize(window, desiredW, desiredH);
   3.359 +    SDLTest_AssertPass("Call to SDL_SetWindowSize(...,%d,%d)", desiredW, desiredH);
   3.360 +   
   3.361 +    /* Get size */
   3.362 +    currentW = desiredW + 1;
   3.363 +    currentH = desiredH + 1;
   3.364 +    SDL_GetWindowSize(window, &currentW, &currentH);
   3.365 +    SDLTest_AssertPass("Call to SDL_GetWindowSize()");
   3.366 +    SDLTest_AssertCheck(desiredW == currentW, "Verify returned width; expected: %d, got: %d", desiredW, currentW);
   3.367 +    SDLTest_AssertCheck(desiredH == currentH, "Verify returned height; expected: %d, got: %d", desiredH, currentH);
   3.368 +
   3.369 +    /* Get just width */
   3.370 +    currentW = desiredW + 1;    
   3.371 +    SDL_GetWindowSize(window, &currentW, NULL);
   3.372 +    SDLTest_AssertPass("Call to SDL_GetWindowSize(&h=NULL)");
   3.373 +    SDLTest_AssertCheck(desiredW == currentW, "Verify returned width; expected: %d, got: %d", desiredW, currentH);
   3.374 +
   3.375 +    /* Get just height */
   3.376 +    currentH = desiredH + 1;
   3.377 +    SDL_GetWindowSize(window, NULL, &currentH);
   3.378 +    SDLTest_AssertPass("Call to SDL_GetWindowSize(&w=NULL)");
   3.379 +    SDLTest_AssertCheck(desiredH == currentH, "Verify returned height; expected: %d, got: %d", desiredW, currentH);
   3.380 +   }
   3.381    }
   3.382  
   3.383 -  SDL_GetWindowPosition(NULL, NULL, NULL);
   3.384 -  SDLTest_AssertPass("Call to SDL_GetWindowPosition(NULL, NULL, NULL)");
   3.385 -  lastError = (char *)SDL_GetError();
   3.386 -  SDLTest_AssertPass("SDL_GetError()");
   3.387 -  SDLTest_AssertCheck(lastError != NULL, "Verify error message is not NULL");
   3.388 -  if (lastError != NULL) {
   3.389 -      SDLTest_AssertCheck(SDL_strcmp(lastError, invalidWindowError) == 0,
   3.390 -         "SDL_GetError(): expected message '%s', was message: '%s'",
   3.391 -         invalidWindowError,
   3.392 -         lastError);
   3.393 +  /* Dummy call with both pointers NULL */
   3.394 +  SDL_GetWindowSize(window, NULL, NULL);
   3.395 +  SDLTest_AssertPass("Call to SDL_GetWindowSize(&w=NULL,&h=NULL)");
   3.396 +
   3.397 +  /* Negative tests for parameter input */
   3.398 +  SDL_ClearError();
   3.399 +  SDLTest_AssertPass("Call to SDL_ClearError()");  
   3.400 +  for (desiredH = -2; desiredH < 2; desiredH++) {
   3.401 +    for (desiredW = -2; desiredW < 2; desiredW++) {
   3.402 +      if (desiredW <= 0 || desiredH <= 0) { 
   3.403 +        SDL_SetWindowSize(window, desiredW, desiredH);
   3.404 +        SDLTest_AssertPass("Call to SDL_SetWindowSize(...,%d,%d)", desiredW, desiredH);
   3.405 +        _checkInvalidParameterError();
   3.406 +      }
   3.407 +    }
   3.408 +  }
   3.409 +   
   3.410 +  /* Clean up */    
   3.411 +  _destroyVideoSuiteTestWindow(window);
   3.412 +    
   3.413 +  /* Set some 'magic' value for later check that nothing was changed */
   3.414 +  referenceW = SDLTest_RandomSint32();
   3.415 +  referenceH = SDLTest_RandomSint32();
   3.416 +  currentW = referenceW;
   3.417 +  currentH = referenceH;
   3.418 +  desiredW = SDLTest_RandomSint32();
   3.419 +  desiredH = SDLTest_RandomSint32();
   3.420 +  
   3.421 +  /* Negative tests for window input */
   3.422 +  SDL_ClearError();
   3.423 +  SDLTest_AssertPass("Call to SDL_ClearError()");
   3.424 +  SDL_GetWindowSize(NULL, &currentW, &currentH);
   3.425 +  SDLTest_AssertPass("Call to SDL_GetWindowSize(window=NULL)");
   3.426 +  SDLTest_AssertCheck(
   3.427 +  	currentW == referenceW && currentH == referenceH, 
   3.428 +  	"Verify that content of W and H pointers has not been modified; expected: %d,%d; got: %d,%d",
   3.429 +  	referenceW, referenceH,
   3.430 +  	currentW, currentH);
   3.431 +  _checkInvalidWindowError();
   3.432 +
   3.433 +  SDL_GetWindowSize(NULL, NULL, NULL);
   3.434 +  SDLTest_AssertPass("Call to SDL_GetWindowSize(NULL, NULL, NULL)");
   3.435 +  _checkInvalidWindowError();
   3.436 +
   3.437 +  SDL_SetWindowSize(NULL, desiredW, desiredH);
   3.438 +  SDLTest_AssertPass("Call to SDL_SetWindowSize(window=NULL)");
   3.439 +  _checkInvalidWindowError();
   3.440 +  
   3.441 +  return TEST_COMPLETED;
   3.442 +}
   3.443 +
   3.444 +/**
   3.445 + * @brief Tests call to SDL_GetWindowMinimumSize and SDL_SetWindowMinimumSize
   3.446 + *
   3.447 + */
   3.448 +int
   3.449 +video_getSetWindowMinimumSize(void *arg)
   3.450 +{
   3.451 +  const char* title = "video_getSetWindowMinimumSize Test Window";
   3.452 +  SDL_Window* window;
   3.453 +  int result;
   3.454 +  SDL_Rect display;
   3.455 +  int wVariation, hVariation;
   3.456 +  int referenceW, referenceH;
   3.457 +  int currentW, currentH;
   3.458 +  int desiredW, desiredH;
   3.459 +
   3.460 +  /* Get display bounds for size range */
   3.461 +  result = SDL_GetDisplayBounds(0, &display);
   3.462 +  SDLTest_AssertPass("SDL_GetDisplayBounds()");
   3.463 +  SDLTest_AssertCheck(result == 0, "Verify return value; expected: 0, got: %d", result);
   3.464 +  if (result != 0) return TEST_ABORTED;
   3.465 +
   3.466 +  /* Call against new test window */ 
   3.467 +  window = _createVideoSuiteTestWindow(title);
   3.468 +  if (window == NULL) return TEST_ABORTED;
   3.469 +  
   3.470 +  for (wVariation = 0; wVariation < 5; wVariation++) {
   3.471 +   for (hVariation = 0; hVariation < 5; hVariation++) {
   3.472 +    switch(wVariation) {
   3.473 +     case 0:
   3.474 +      /* 1 Pixel Wide */  
   3.475 +      desiredW = 1;
   3.476 +      break;
   3.477 +     case 1:
   3.478 +      /* Random width inside screen */  
   3.479 +      desiredW = SDLTest_RandomIntegerInRange(2, display.w - 1);
   3.480 +      break;
   3.481 +     case 2:
   3.482 +      /* Width at screen size */  
   3.483 +      desiredW = display.w;
   3.484 +      break;
   3.485 +    }
   3.486 +
   3.487 +    switch(hVariation) {
   3.488 +     case 0:
   3.489 +      /* 1 Pixel High */  
   3.490 +      desiredH = 1;
   3.491 +      break;
   3.492 +     case 1:
   3.493 +      /* Random height inside screen */  
   3.494 +      desiredH = SDLTest_RandomIntegerInRange(2, display.h - 1);
   3.495 +      break;
   3.496 +     case 2:
   3.497 +      /* Height at screen size */  
   3.498 +      desiredH = display.h;
   3.499 +      break;
   3.500 +     case 4:
   3.501 +      /* Height 1 pixel larger than screen */  
   3.502 +      desiredH = display.h + 1;
   3.503 +      break;
   3.504 +    }
   3.505 +
   3.506 +    /* Set size */
   3.507 +    SDL_SetWindowMinimumSize(window, desiredW, desiredH);
   3.508 +    SDLTest_AssertPass("Call to SDL_SetWindowMinimumSize(...,%d,%d)", desiredW, desiredH);
   3.509 +   
   3.510 +    /* Get size */
   3.511 +    currentW = desiredW + 1;
   3.512 +    currentH = desiredH + 1;
   3.513 +    SDL_GetWindowMinimumSize(window, &currentW, &currentH);
   3.514 +    SDLTest_AssertPass("Call to SDL_GetWindowMinimumSize()");
   3.515 +    SDLTest_AssertCheck(desiredW == currentW, "Verify returned width; expected: %d, got: %d", desiredW, currentW);
   3.516 +    SDLTest_AssertCheck(desiredH == currentH, "Verify returned height; expected: %d, got: %d", desiredH, currentH);
   3.517 +
   3.518 +    /* Get just width */
   3.519 +    currentW = desiredW + 1;    
   3.520 +    SDL_GetWindowMinimumSize(window, &currentW, NULL);
   3.521 +    SDLTest_AssertPass("Call to SDL_GetWindowMinimumSize(&h=NULL)");
   3.522 +    SDLTest_AssertCheck(desiredW == currentW, "Verify returned width; expected: %d, got: %d", desiredW, currentH);
   3.523 +
   3.524 +    /* Get just height */
   3.525 +    currentH = desiredH + 1;
   3.526 +    SDL_GetWindowMinimumSize(window, NULL, &currentH);
   3.527 +    SDLTest_AssertPass("Call to SDL_GetWindowMinimumSize(&w=NULL)");
   3.528 +    SDLTest_AssertCheck(desiredH == currentH, "Verify returned height; expected: %d, got: %d", desiredW, currentH);
   3.529 +   }
   3.530    }
   3.531  
   3.532 -  SDL_SetWindowPosition(NULL, desiredX, desiredY);
   3.533 -  SDLTest_AssertPass("Call to SDL_SetWindowPosition(window=NULL)");
   3.534 -  lastError = (char *)SDL_GetError();
   3.535 -  SDLTest_AssertPass("SDL_GetError()");
   3.536 -  SDLTest_AssertCheck(lastError != NULL, "Verify error message is not NULL");
   3.537 -  if (lastError != NULL) {
   3.538 -      SDLTest_AssertCheck(SDL_strcmp(lastError, invalidWindowError) == 0,
   3.539 -         "SDL_GetError(): expected message '%s', was message: '%s'",
   3.540 -         invalidWindowError,
   3.541 -         lastError);
   3.542 +  /* Dummy call with both pointers NULL */
   3.543 +  SDL_GetWindowMinimumSize(window, NULL, NULL);
   3.544 +  SDLTest_AssertPass("Call to SDL_GetWindowMinimumSize(&w=NULL,&h=NULL)");
   3.545 +
   3.546 +  /* Negative tests for parameter input */
   3.547 +  SDL_ClearError();
   3.548 +  SDLTest_AssertPass("Call to SDL_ClearError()");  
   3.549 +  for (desiredH = -2; desiredH < 2; desiredH++) {
   3.550 +    for (desiredW = -2; desiredW < 2; desiredW++) {
   3.551 +      if (desiredW <= 0 || desiredH <= 0) { 
   3.552 +        SDL_SetWindowMinimumSize(window, desiredW, desiredH);
   3.553 +        SDLTest_AssertPass("Call to SDL_SetWindowMinimumSize(...,%d,%d)", desiredW, desiredH);
   3.554 +        _checkInvalidParameterError();
   3.555 +      }
   3.556 +    }
   3.557    }
   3.558 +   
   3.559 +  /* Clean up */    
   3.560 +  _destroyVideoSuiteTestWindow(window);
   3.561 +    
   3.562 +  /* Set some 'magic' value for later check that nothing was changed */
   3.563 +  referenceW = SDLTest_RandomSint32();
   3.564 +  referenceH = SDLTest_RandomSint32();
   3.565 +  currentW = referenceW;
   3.566 +  currentH = referenceH;
   3.567 +  desiredW = SDLTest_RandomSint32();
   3.568 +  desiredH = SDLTest_RandomSint32();
   3.569 +  
   3.570 +  /* Negative tests for window input */
   3.571 +  SDL_ClearError();
   3.572 +  SDLTest_AssertPass("Call to SDL_ClearError()");
   3.573 +  SDL_GetWindowMinimumSize(NULL, &currentW, &currentH);
   3.574 +  SDLTest_AssertPass("Call to SDL_GetWindowMinimumSize(window=NULL)");
   3.575 +  SDLTest_AssertCheck(
   3.576 +  	currentW == referenceW && currentH == referenceH, 
   3.577 +  	"Verify that content of W and H pointers has not been modified; expected: %d,%d; got: %d,%d",
   3.578 +  	referenceW, referenceH,
   3.579 +  	currentW, currentH);
   3.580 +  _checkInvalidWindowError();
   3.581 +
   3.582 +  SDL_GetWindowMinimumSize(NULL, NULL, NULL);
   3.583 +  SDLTest_AssertPass("Call to SDL_GetWindowMinimumSize(NULL, NULL, NULL)");
   3.584 +  _checkInvalidWindowError();
   3.585 +
   3.586 +  SDL_SetWindowMinimumSize(NULL, desiredW, desiredH);
   3.587 +  SDLTest_AssertPass("Call to SDL_SetWindowMinimumSize(window=NULL)");
   3.588 +  _checkInvalidWindowError();
   3.589 +  
   3.590 +  return TEST_COMPLETED;
   3.591 +}
   3.592 +
   3.593 +/**
   3.594 + * @brief Tests call to SDL_GetWindowMaximumSize and SDL_SetWindowMaximumSize
   3.595 + *
   3.596 + */
   3.597 +int
   3.598 +video_getSetWindowMaximumSize(void *arg)
   3.599 +{
   3.600 +  const char* title = "video_getSetWindowMaximumSize Test Window";
   3.601 +  SDL_Window* window;
   3.602 +  int result;
   3.603 +  SDL_Rect display;
   3.604 +  int wVariation, hVariation;
   3.605 +  int referenceW, referenceH;
   3.606 +  int currentW, currentH;
   3.607 +  int desiredW, desiredH;
   3.608 +
   3.609 +  /* Get display bounds for size range */
   3.610 +  result = SDL_GetDisplayBounds(0, &display);
   3.611 +  SDLTest_AssertPass("SDL_GetDisplayBounds()");
   3.612 +  SDLTest_AssertCheck(result == 0, "Verify return value; expected: 0, got: %d", result);
   3.613 +  if (result != 0) return TEST_ABORTED;
   3.614 +
   3.615 +  /* Call against new test window */ 
   3.616 +  window = _createVideoSuiteTestWindow(title);
   3.617 +  if (window == NULL) return TEST_ABORTED;
   3.618 +  
   3.619 +  for (wVariation = 0; wVariation < 3; wVariation++) {
   3.620 +   for (hVariation = 0; hVariation < 3; hVariation++) {
   3.621 +    switch(wVariation) {
   3.622 +     case 0:
   3.623 +      /* 1 Pixel Wide */  
   3.624 +      desiredW = 1;
   3.625 +      break;
   3.626 +     case 1:
   3.627 +      /* Random width inside screen */  
   3.628 +      desiredW = SDLTest_RandomIntegerInRange(2, display.w - 1);
   3.629 +      break;
   3.630 +     case 2:
   3.631 +      /* Width at screen size */  
   3.632 +      desiredW = display.w;
   3.633 +      break;
   3.634 +    }
   3.635 +
   3.636 +    switch(hVariation) {
   3.637 +     case 0:
   3.638 +      /* 1 Pixel High */  
   3.639 +      desiredH = 1;
   3.640 +      break;
   3.641 +     case 1:
   3.642 +      /* Random height inside screen */  
   3.643 +      desiredH = SDLTest_RandomIntegerInRange(2, display.h - 1);
   3.644 +      break;
   3.645 +     case 2:
   3.646 +      /* Height at screen size */  
   3.647 +      desiredH = display.h;
   3.648 +      break;
   3.649 +    }
   3.650 +
   3.651 +    /* Set size */
   3.652 +    SDL_SetWindowMaximumSize(window, desiredW, desiredH);
   3.653 +    SDLTest_AssertPass("Call to SDL_SetWindowMaximumSize(...,%d,%d)", desiredW, desiredH);
   3.654 +   
   3.655 +    /* Get size */
   3.656 +    currentW = desiredW + 1;
   3.657 +    currentH = desiredH + 1;
   3.658 +    SDL_GetWindowMaximumSize(window, &currentW, &currentH);
   3.659 +    SDLTest_AssertPass("Call to SDL_GetWindowMaximumSize()");
   3.660 +    SDLTest_AssertCheck(desiredW == currentW, "Verify returned width; expected: %d, got: %d", desiredW, currentW);
   3.661 +    SDLTest_AssertCheck(desiredH == currentH, "Verify returned height; expected: %d, got: %d", desiredH, currentH);
   3.662 +
   3.663 +    /* Get just width */
   3.664 +    currentW = desiredW + 1;    
   3.665 +    SDL_GetWindowMaximumSize(window, &currentW, NULL);
   3.666 +    SDLTest_AssertPass("Call to SDL_GetWindowMaximumSize(&h=NULL)");
   3.667 +    SDLTest_AssertCheck(desiredW == currentW, "Verify returned width; expected: %d, got: %d", desiredW, currentH);
   3.668 +
   3.669 +    /* Get just height */
   3.670 +    currentH = desiredH + 1;
   3.671 +    SDL_GetWindowMaximumSize(window, NULL, &currentH);
   3.672 +    SDLTest_AssertPass("Call to SDL_GetWindowMaximumSize(&w=NULL)");
   3.673 +    SDLTest_AssertCheck(desiredH == currentH, "Verify returned height; expected: %d, got: %d", desiredW, currentH);
   3.674 +   }
   3.675 +  }
   3.676 +
   3.677 +  /* Dummy call with both pointers NULL */
   3.678 +  SDL_GetWindowMaximumSize(window, NULL, NULL);
   3.679 +  SDLTest_AssertPass("Call to SDL_GetWindowMaximumSize(&w=NULL,&h=NULL)");
   3.680 +
   3.681 +  /* Negative tests for parameter input */
   3.682 +  SDL_ClearError();
   3.683 +  SDLTest_AssertPass("Call to SDL_ClearError()");  
   3.684 +  for (desiredH = -2; desiredH < 2; desiredH++) {
   3.685 +    for (desiredW = -2; desiredW < 2; desiredW++) {
   3.686 +      if (desiredW <= 0 || desiredH <= 0) { 
   3.687 +        SDL_SetWindowMaximumSize(window, desiredW, desiredH);
   3.688 +        SDLTest_AssertPass("Call to SDL_SetWindowMaximumSize(...,%d,%d)", desiredW, desiredH);
   3.689 +        _checkInvalidParameterError();
   3.690 +      }
   3.691 +    }
   3.692 +  }
   3.693 +   
   3.694 +  /* Clean up */    
   3.695 +  _destroyVideoSuiteTestWindow(window);
   3.696 +    
   3.697 +  /* Set some 'magic' value for later check that nothing was changed */
   3.698 +  referenceW = SDLTest_RandomSint32();
   3.699 +  referenceH = SDLTest_RandomSint32();
   3.700 +  currentW = referenceW;
   3.701 +  currentH = referenceH;
   3.702 +  desiredW = SDLTest_RandomSint32();
   3.703 +  desiredH = SDLTest_RandomSint32();
   3.704 +  
   3.705 +  /* Negative tests */
   3.706 +  SDL_ClearError();
   3.707 +  SDLTest_AssertPass("Call to SDL_ClearError()");
   3.708 +  SDL_GetWindowMaximumSize(NULL, &currentW, &currentH);
   3.709 +  SDLTest_AssertPass("Call to SDL_GetWindowMaximumSize(window=NULL)");
   3.710 +  SDLTest_AssertCheck(
   3.711 +  	currentW == referenceW && currentH == referenceH, 
   3.712 +  	"Verify that content of W and H pointers has not been modified; expected: %d,%d; got: %d,%d",
   3.713 +  	referenceW, referenceH,
   3.714 +  	currentW, currentH);
   3.715 +  _checkInvalidWindowError();
   3.716 +
   3.717 +  SDL_GetWindowMaximumSize(NULL, NULL, NULL);
   3.718 +  SDLTest_AssertPass("Call to SDL_GetWindowMaximumSize(NULL, NULL, NULL)");
   3.719 +  _checkInvalidWindowError();
   3.720 +
   3.721 +  SDL_SetWindowMaximumSize(NULL, desiredW, desiredH);
   3.722 +  SDLTest_AssertPass("Call to SDL_SetWindowMaximumSize(window=NULL)");
   3.723 +  _checkInvalidWindowError();
   3.724    
   3.725    return TEST_COMPLETED;
   3.726  }
   3.727 @@ -1160,7 +1535,7 @@
   3.728  		{ (SDLTest_TestCaseFp)video_getWindowGammaRampNegative, "video_getWindowGammaRampNegative",  "Get window gamma ramp against invalid input", TEST_ENABLED };
   3.729  
   3.730  static const SDLTest_TestCaseReference videoTest16 =
   3.731 -		{ (SDLTest_TestCaseFp)video_getSetWindowGrab, "video_getSetWindowGrab",  "Checks SDL_GetWindowGrab and SDL_SetWindowGrab", TEST_ENABLED };
   3.732 +		{ (SDLTest_TestCaseFp)video_getSetWindowGrab, "video_getSetWindowGrab",  "Checks SDL_GetWindowGrab and SDL_SetWindowGrab positive and negative cases", TEST_ENABLED };
   3.733  
   3.734  static const SDLTest_TestCaseReference videoTest17 =
   3.735  		{ (SDLTest_TestCaseFp)video_getWindowId, "video_getWindowId",  "Checks SDL_GetWindowID and SDL_GetWindowFromID", TEST_ENABLED };
   3.736 @@ -1169,14 +1544,24 @@
   3.737  		{ (SDLTest_TestCaseFp)video_getWindowPixelFormat, "video_getWindowPixelFormat",  "Checks SDL_GetWindowPixelFormat", TEST_ENABLED };
   3.738  
   3.739  static const SDLTest_TestCaseReference videoTest19 =
   3.740 -		{ (SDLTest_TestCaseFp)video_getSetWindowPosition, "video_getSetWindowPosition",  "Checks SDL_GetWindowPosition and SDL_SetWindowPosition", TEST_ENABLED };
   3.741 +		{ (SDLTest_TestCaseFp)video_getSetWindowPosition, "video_getSetWindowPosition",  "Checks SDL_GetWindowPosition and SDL_SetWindowPosition positive and negative cases", TEST_ENABLED };
   3.742 +
   3.743 +static const SDLTest_TestCaseReference videoTest20 =
   3.744 +		{ (SDLTest_TestCaseFp)video_getSetWindowSize, "video_getSetWindowSize",  "Checks SDL_GetWindowSize and SDL_SetWindowSize positive and negative cases", TEST_ENABLED };
   3.745 +
   3.746 +static const SDLTest_TestCaseReference videoTest21 =
   3.747 +		{ (SDLTest_TestCaseFp)video_getSetWindowMinimumSize, "video_getSetWindowMinimumSize",  "Checks SDL_GetWindowMinimumSize and SDL_SetWindowMinimumSize positive and negative cases", TEST_ENABLED };
   3.748 +
   3.749 +static const SDLTest_TestCaseReference videoTest22 =
   3.750 +		{ (SDLTest_TestCaseFp)video_getSetWindowMaximumSize, "video_getSetWindowMaximumSize",  "Checks SDL_GetWindowMaximumSize and SDL_SetWindowMaximumSize positive and negative cases", TEST_ENABLED };
   3.751  
   3.752  /* Sequence of Video test cases */
   3.753  static const SDLTest_TestCaseReference *videoTests[] =  {
   3.754  	&videoTest1, &videoTest2, &videoTest3, &videoTest4, &videoTest5, &videoTest6, 
   3.755  	&videoTest7, &videoTest8, &videoTest9, &videoTest10, &videoTest11, &videoTest12, 
   3.756  	&videoTest13, &videoTest14, &videoTest15, &videoTest16, &videoTest17, 
   3.757 -	&videoTest18, &videoTest19, NULL
   3.758 +	&videoTest18, &videoTest19, &videoTest20, &videoTest21, &videoTest22, 
   3.759 +	NULL
   3.760  };
   3.761  
   3.762  /* Video test suite (global) */