Add parameter checking to SetWindowSize functions; add tests to video suite
authorAndreas Schiffler
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 -    }
    2.27 -    if (!h) {
    2.28 -        h = &dummy;
    2.29 +    CHECK_WINDOW_MAGIC(window, );
    2.30 +    if (w) {
    2.31 +        *w = window->w;
    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 -    }
    2.71 -    if (!min_h) {
    2.72 -        min_h = &dummy;
    2.73 +    CHECK_WINDOW_MAGIC(window, );
    2.74 +    if (min_w) {
    2.75 +        *min_w = window->min_w;
    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 -    }
   2.113 -    if (!max_h) {
   2.114 -        max_h = &dummy;
   2.115 +    CHECK_WINDOW_MAGIC(window, );
   2.116 +    if (max_w) {
   2.117 +        *max_w = window->max_w;
   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 -  lastError = (char *)SDL_GetError();
   3.255 -  SDLTest_AssertPass("SDL_GetError()");
   3.256 -  SDLTest_AssertCheck(lastError != NULL, "Verify error message is not NULL");
   3.257 -  if (lastError != NULL) {
   3.258 -      SDLTest_AssertCheck(SDL_strcmp(lastError, invalidWindowError) == 0,
   3.259 -         "SDL_GetError(): expected message '%s', was message: '%s'",
   3.260 -         invalidWindowError,
   3.261 -         lastError);
   3.262 -  }
   3.263 +  _checkInvalidWindowError();
   3.264  
   3.265    SDL_GetWindowPosition(NULL, NULL, NULL);
   3.266    SDLTest_AssertPass("Call to SDL_GetWindowPosition(NULL, NULL, NULL)");
   3.267 +  _checkInvalidWindowError();
   3.268 +
   3.269 +  SDL_SetWindowPosition(NULL, desiredX, desiredY);
   3.270 +  SDLTest_AssertPass("Call to SDL_SetWindowPosition(window=NULL)");
   3.271 +  _checkInvalidWindowError();
   3.272 +  
   3.273 +  return TEST_COMPLETED;
   3.274 +}
   3.275 +
   3.276 +/* Helper function that checks for an 'Invalid parameter' error */
   3.277 +void _checkInvalidParameterError()
   3.278 +{
   3.279 +  const char *invalidParameterError = "Parameter";
   3.280 +  char *lastError;
   3.281 +
   3.282    lastError = (char *)SDL_GetError();
   3.283    SDLTest_AssertPass("SDL_GetError()");
   3.284    SDLTest_AssertCheck(lastError != NULL, "Verify error message is not NULL");
   3.285    if (lastError != NULL) {
   3.286 -      SDLTest_AssertCheck(SDL_strcmp(lastError, invalidWindowError) == 0,
   3.287 -         "SDL_GetError(): expected message '%s', was message: '%s'",
   3.288 -         invalidWindowError,
   3.289 +      SDLTest_AssertCheck(SDL_strncmp(lastError, invalidParameterError, SDL_strlen(invalidParameterError)) == 0,
   3.290 +         "SDL_GetError(): expected message starts with '%s', was message: '%s'",
   3.291 +         invalidParameterError,
   3.292           lastError);
   3.293 +      SDL_ClearError();
   3.294 +      SDLTest_AssertPass("Call to SDL_ClearError()");  
   3.295 +  }
   3.296 +}
   3.297 +
   3.298 +/**
   3.299 + * @brief Tests call to SDL_GetWindowSize and SDL_SetWindowSize
   3.300 + *
   3.301 + * @sa http://wiki.libsdl.org/moin.fcg/SDL_GetWindowSize
   3.302 + * @sa http://wiki.libsdl.org/moin.fcg/SDL_SetWindowSize
   3.303 + */
   3.304 +int
   3.305 +video_getSetWindowSize(void *arg)
   3.306 +{
   3.307 +  const char* title = "video_getSetWindowSize Test Window";
   3.308 +  SDL_Window* window;
   3.309 +  int result;
   3.310 +  SDL_Rect display;
   3.311 +  int wVariation, hVariation;
   3.312 +  int referenceW, referenceH;
   3.313 +  int currentW, currentH;
   3.314 +  int desiredW, desiredH;
   3.315 +
   3.316 +  /* Get display bounds for size range */
   3.317 +  result = SDL_GetDisplayBounds(0, &display);
   3.318 +  SDLTest_AssertPass("SDL_GetDisplayBounds()");
   3.319 +  SDLTest_AssertCheck(result == 0, "Verify return value; expected: 0, got: %d", result);
   3.320 +  if (result != 0) return TEST_ABORTED;
   3.321 +  
   3.322 +  /* Call against new test window */ 
   3.323 +  window = _createVideoSuiteTestWindow(title);
   3.324 +  if (window == NULL) return TEST_ABORTED;
   3.325 +  
   3.326 +  for (wVariation = 0; wVariation < 4; wVariation++) {
   3.327 +   for (hVariation = 0; hVariation < 4; hVariation++) {
   3.328 +    switch(wVariation) {
   3.329 +     case 0:
   3.330 +      /* 1 Pixel Wide */  
   3.331 +      desiredW = 1;
   3.332 +      break;
   3.333 +     case 1:
   3.334 +      /* Random width inside screen */  
   3.335 +      desiredW = SDLTest_RandomIntegerInRange(1, 100);
   3.336 +      break;
   3.337 +     case 2:
   3.338 +      /* Width at screen size */  
   3.339 +      desiredW = display.w;
   3.340 +      break;
   3.341 +     case 3:
   3.342 +      /* Width 1 pixel larger than screen */  
   3.343 +      desiredW = display.w + 1;
   3.344 +      break;
   3.345 +    }
   3.346 +
   3.347 +    switch(hVariation) {
   3.348 +     case 0:
   3.349 +      /* 1 Pixel High */  
   3.350 +      desiredH = 1;
   3.351 +      break;
   3.352 +     case 1:
   3.353 +      /* Random height inside screen */  
   3.354 +      desiredH = SDLTest_RandomIntegerInRange(1, 100);
   3.355 +      break;
   3.356 +     case 2:
   3.357 +      /* Height at screen size */  
   3.358 +      desiredH = display.h;
   3.359 +      break;
   3.360 +     case 3:
   3.361 +      /* Height 1 pixel larger than screen */  
   3.362 +      desiredH = display.h + 1;
   3.363 +      break;
   3.364 +    }
   3.365 +
   3.366 +    /* Set size */
   3.367 +    SDL_SetWindowSize(window, desiredW, desiredH);
   3.368 +    SDLTest_AssertPass("Call to SDL_SetWindowSize(...,%d,%d)", desiredW, desiredH);
   3.369 +   
   3.370 +    /* Get size */
   3.371 +    currentW = desiredW + 1;
   3.372 +    currentH = desiredH + 1;
   3.373 +    SDL_GetWindowSize(window, &currentW, &currentH);
   3.374 +    SDLTest_AssertPass("Call to SDL_GetWindowSize()");
   3.375 +    SDLTest_AssertCheck(desiredW == currentW, "Verify returned width; expected: %d, got: %d", desiredW, currentW);
   3.376 +    SDLTest_AssertCheck(desiredH == currentH, "Verify returned height; expected: %d, got: %d", desiredH, currentH);
   3.377 +
   3.378 +    /* Get just width */
   3.379 +    currentW = desiredW + 1;    
   3.380 +    SDL_GetWindowSize(window, &currentW, NULL);
   3.381 +    SDLTest_AssertPass("Call to SDL_GetWindowSize(&h=NULL)");
   3.382 +    SDLTest_AssertCheck(desiredW == currentW, "Verify returned width; expected: %d, got: %d", desiredW, currentH);
   3.383 +
   3.384 +    /* Get just height */
   3.385 +    currentH = desiredH + 1;
   3.386 +    SDL_GetWindowSize(window, NULL, &currentH);
   3.387 +    SDLTest_AssertPass("Call to SDL_GetWindowSize(&w=NULL)");
   3.388 +    SDLTest_AssertCheck(desiredH == currentH, "Verify returned height; expected: %d, got: %d", desiredW, currentH);
   3.389 +   }
   3.390    }
   3.391  
   3.392 -  SDL_SetWindowPosition(NULL, desiredX, desiredY);
   3.393 -  SDLTest_AssertPass("Call to SDL_SetWindowPosition(window=NULL)");
   3.394 -  lastError = (char *)SDL_GetError();
   3.395 -  SDLTest_AssertPass("SDL_GetError()");
   3.396 -  SDLTest_AssertCheck(lastError != NULL, "Verify error message is not NULL");
   3.397 -  if (lastError != NULL) {
   3.398 -      SDLTest_AssertCheck(SDL_strcmp(lastError, invalidWindowError) == 0,
   3.399 -         "SDL_GetError(): expected message '%s', was message: '%s'",
   3.400 -         invalidWindowError,
   3.401 -         lastError);
   3.402 +  /* Dummy call with both pointers NULL */
   3.403 +  SDL_GetWindowSize(window, NULL, NULL);
   3.404 +  SDLTest_AssertPass("Call to SDL_GetWindowSize(&w=NULL,&h=NULL)");
   3.405 +
   3.406 +  /* Negative tests for parameter input */
   3.407 +  SDL_ClearError();
   3.408 +  SDLTest_AssertPass("Call to SDL_ClearError()");  
   3.409 +  for (desiredH = -2; desiredH < 2; desiredH++) {
   3.410 +    for (desiredW = -2; desiredW < 2; desiredW++) {
   3.411 +      if (desiredW <= 0 || desiredH <= 0) { 
   3.412 +        SDL_SetWindowSize(window, desiredW, desiredH);
   3.413 +        SDLTest_AssertPass("Call to SDL_SetWindowSize(...,%d,%d)", desiredW, desiredH);
   3.414 +        _checkInvalidParameterError();
   3.415 +      }
   3.416 +    }
   3.417 +  }
   3.418 +   
   3.419 +  /* Clean up */    
   3.420 +  _destroyVideoSuiteTestWindow(window);
   3.421 +    
   3.422 +  /* Set some 'magic' value for later check that nothing was changed */
   3.423 +  referenceW = SDLTest_RandomSint32();
   3.424 +  referenceH = SDLTest_RandomSint32();
   3.425 +  currentW = referenceW;
   3.426 +  currentH = referenceH;
   3.427 +  desiredW = SDLTest_RandomSint32();
   3.428 +  desiredH = SDLTest_RandomSint32();
   3.429 +  
   3.430 +  /* Negative tests for window input */
   3.431 +  SDL_ClearError();
   3.432 +  SDLTest_AssertPass("Call to SDL_ClearError()");
   3.433 +  SDL_GetWindowSize(NULL, &currentW, &currentH);
   3.434 +  SDLTest_AssertPass("Call to SDL_GetWindowSize(window=NULL)");
   3.435 +  SDLTest_AssertCheck(
   3.436 +  	currentW == referenceW && currentH == referenceH, 
   3.437 +  	"Verify that content of W and H pointers has not been modified; expected: %d,%d; got: %d,%d",
   3.438 +  	referenceW, referenceH,
   3.439 +  	currentW, currentH);
   3.440 +  _checkInvalidWindowError();
   3.441 +
   3.442 +  SDL_GetWindowSize(NULL, NULL, NULL);
   3.443 +  SDLTest_AssertPass("Call to SDL_GetWindowSize(NULL, NULL, NULL)");
   3.444 +  _checkInvalidWindowError();
   3.445 +
   3.446 +  SDL_SetWindowSize(NULL, desiredW, desiredH);
   3.447 +  SDLTest_AssertPass("Call to SDL_SetWindowSize(window=NULL)");
   3.448 +  _checkInvalidWindowError();
   3.449 +  
   3.450 +  return TEST_COMPLETED;
   3.451 +}
   3.452 +
   3.453 +/**
   3.454 + * @brief Tests call to SDL_GetWindowMinimumSize and SDL_SetWindowMinimumSize
   3.455 + *
   3.456 + */
   3.457 +int
   3.458 +video_getSetWindowMinimumSize(void *arg)
   3.459 +{
   3.460 +  const char* title = "video_getSetWindowMinimumSize Test Window";
   3.461 +  SDL_Window* window;
   3.462 +  int result;
   3.463 +  SDL_Rect display;
   3.464 +  int wVariation, hVariation;
   3.465 +  int referenceW, referenceH;
   3.466 +  int currentW, currentH;
   3.467 +  int desiredW, desiredH;
   3.468 +
   3.469 +  /* Get display bounds for size range */
   3.470 +  result = SDL_GetDisplayBounds(0, &display);
   3.471 +  SDLTest_AssertPass("SDL_GetDisplayBounds()");
   3.472 +  SDLTest_AssertCheck(result == 0, "Verify return value; expected: 0, got: %d", result);
   3.473 +  if (result != 0) return TEST_ABORTED;
   3.474 +
   3.475 +  /* Call against new test window */ 
   3.476 +  window = _createVideoSuiteTestWindow(title);
   3.477 +  if (window == NULL) return TEST_ABORTED;
   3.478 +  
   3.479 +  for (wVariation = 0; wVariation < 5; wVariation++) {
   3.480 +   for (hVariation = 0; hVariation < 5; hVariation++) {
   3.481 +    switch(wVariation) {
   3.482 +     case 0:
   3.483 +      /* 1 Pixel Wide */  
   3.484 +      desiredW = 1;
   3.485 +      break;
   3.486 +     case 1:
   3.487 +      /* Random width inside screen */  
   3.488 +      desiredW = SDLTest_RandomIntegerInRange(2, display.w - 1);
   3.489 +      break;
   3.490 +     case 2:
   3.491 +      /* Width at screen size */  
   3.492 +      desiredW = display.w;
   3.493 +      break;
   3.494 +    }
   3.495 +
   3.496 +    switch(hVariation) {
   3.497 +     case 0:
   3.498 +      /* 1 Pixel High */  
   3.499 +      desiredH = 1;
   3.500 +      break;
   3.501 +     case 1:
   3.502 +      /* Random height inside screen */  
   3.503 +      desiredH = SDLTest_RandomIntegerInRange(2, display.h - 1);
   3.504 +      break;
   3.505 +     case 2:
   3.506 +      /* Height at screen size */  
   3.507 +      desiredH = display.h;
   3.508 +      break;
   3.509 +     case 4:
   3.510 +      /* Height 1 pixel larger than screen */  
   3.511 +      desiredH = display.h + 1;
   3.512 +      break;
   3.513 +    }
   3.514 +
   3.515 +    /* Set size */
   3.516 +    SDL_SetWindowMinimumSize(window, desiredW, desiredH);
   3.517 +    SDLTest_AssertPass("Call to SDL_SetWindowMinimumSize(...,%d,%d)", desiredW, desiredH);
   3.518 +   
   3.519 +    /* Get size */
   3.520 +    currentW = desiredW + 1;
   3.521 +    currentH = desiredH + 1;
   3.522 +    SDL_GetWindowMinimumSize(window, &currentW, &currentH);
   3.523 +    SDLTest_AssertPass("Call to SDL_GetWindowMinimumSize()");
   3.524 +    SDLTest_AssertCheck(desiredW == currentW, "Verify returned width; expected: %d, got: %d", desiredW, currentW);
   3.525 +    SDLTest_AssertCheck(desiredH == currentH, "Verify returned height; expected: %d, got: %d", desiredH, currentH);
   3.526 +
   3.527 +    /* Get just width */
   3.528 +    currentW = desiredW + 1;    
   3.529 +    SDL_GetWindowMinimumSize(window, &currentW, NULL);
   3.530 +    SDLTest_AssertPass("Call to SDL_GetWindowMinimumSize(&h=NULL)");
   3.531 +    SDLTest_AssertCheck(desiredW == currentW, "Verify returned width; expected: %d, got: %d", desiredW, currentH);
   3.532 +
   3.533 +    /* Get just height */
   3.534 +    currentH = desiredH + 1;
   3.535 +    SDL_GetWindowMinimumSize(window, NULL, &currentH);
   3.536 +    SDLTest_AssertPass("Call to SDL_GetWindowMinimumSize(&w=NULL)");
   3.537 +    SDLTest_AssertCheck(desiredH == currentH, "Verify returned height; expected: %d, got: %d", desiredW, currentH);
   3.538 +   }
   3.539 +  }
   3.540 +
   3.541 +  /* Dummy call with both pointers NULL */
   3.542 +  SDL_GetWindowMinimumSize(window, NULL, NULL);
   3.543 +  SDLTest_AssertPass("Call to SDL_GetWindowMinimumSize(&w=NULL,&h=NULL)");
   3.544 +
   3.545 +  /* Negative tests for parameter input */
   3.546 +  SDL_ClearError();
   3.547 +  SDLTest_AssertPass("Call to SDL_ClearError()");  
   3.548 +  for (desiredH = -2; desiredH < 2; desiredH++) {
   3.549 +    for (desiredW = -2; desiredW < 2; desiredW++) {
   3.550 +      if (desiredW <= 0 || desiredH <= 0) { 
   3.551 +        SDL_SetWindowMinimumSize(window, desiredW, desiredH);
   3.552 +        SDLTest_AssertPass("Call to SDL_SetWindowMinimumSize(...,%d,%d)", desiredW, desiredH);
   3.553 +        _checkInvalidParameterError();
   3.554 +      }
   3.555 +    }
   3.556    }
   3.557 +   
   3.558 +  /* Clean up */    
   3.559 +  _destroyVideoSuiteTestWindow(window);
   3.560 +    
   3.561 +  /* Set some 'magic' value for later check that nothing was changed */
   3.562 +  referenceW = SDLTest_RandomSint32();
   3.563 +  referenceH = SDLTest_RandomSint32();
   3.564 +  currentW = referenceW;
   3.565 +  currentH = referenceH;
   3.566 +  desiredW = SDLTest_RandomSint32();
   3.567 +  desiredH = SDLTest_RandomSint32();
   3.568 +  
   3.569 +  /* Negative tests for window input */
   3.570 +  SDL_ClearError();
   3.571 +  SDLTest_AssertPass("Call to SDL_ClearError()");
   3.572 +  SDL_GetWindowMinimumSize(NULL, &currentW, &currentH);
   3.573 +  SDLTest_AssertPass("Call to SDL_GetWindowMinimumSize(window=NULL)");
   3.574 +  SDLTest_AssertCheck(
   3.575 +  	currentW == referenceW && currentH == referenceH, 
   3.576 +  	"Verify that content of W and H pointers has not been modified; expected: %d,%d; got: %d,%d",
   3.577 +  	referenceW, referenceH,
   3.578 +  	currentW, currentH);
   3.579 +  _checkInvalidWindowError();
   3.580 +
   3.581 +  SDL_GetWindowMinimumSize(NULL, NULL, NULL);
   3.582 +  SDLTest_AssertPass("Call to SDL_GetWindowMinimumSize(NULL, NULL, NULL)");
   3.583 +  _checkInvalidWindowError();
   3.584 +
   3.585 +  SDL_SetWindowMinimumSize(NULL, desiredW, desiredH);
   3.586 +  SDLTest_AssertPass("Call to SDL_SetWindowMinimumSize(window=NULL)");
   3.587 +  _checkInvalidWindowError();
   3.588 +  
   3.589 +  return TEST_COMPLETED;
   3.590 +}
   3.591 +
   3.592 +/**
   3.593 + * @brief Tests call to SDL_GetWindowMaximumSize and SDL_SetWindowMaximumSize
   3.594 + *
   3.595 + */
   3.596 +int
   3.597 +video_getSetWindowMaximumSize(void *arg)
   3.598 +{
   3.599 +  const char* title = "video_getSetWindowMaximumSize Test Window";
   3.600 +  SDL_Window* window;
   3.601 +  int result;
   3.602 +  SDL_Rect display;
   3.603 +  int wVariation, hVariation;
   3.604 +  int referenceW, referenceH;
   3.605 +  int currentW, currentH;
   3.606 +  int desiredW, desiredH;
   3.607 +
   3.608 +  /* Get display bounds for size range */
   3.609 +  result = SDL_GetDisplayBounds(0, &display);
   3.610 +  SDLTest_AssertPass("SDL_GetDisplayBounds()");
   3.611 +  SDLTest_AssertCheck(result == 0, "Verify return value; expected: 0, got: %d", result);
   3.612 +  if (result != 0) return TEST_ABORTED;
   3.613 +
   3.614 +  /* Call against new test window */ 
   3.615 +  window = _createVideoSuiteTestWindow(title);
   3.616 +  if (window == NULL) return TEST_ABORTED;
   3.617 +  
   3.618 +  for (wVariation = 0; wVariation < 3; wVariation++) {
   3.619 +   for (hVariation = 0; hVariation < 3; hVariation++) {
   3.620 +    switch(wVariation) {
   3.621 +     case 0:
   3.622 +      /* 1 Pixel Wide */  
   3.623 +      desiredW = 1;
   3.624 +      break;
   3.625 +     case 1:
   3.626 +      /* Random width inside screen */  
   3.627 +      desiredW = SDLTest_RandomIntegerInRange(2, display.w - 1);
   3.628 +      break;
   3.629 +     case 2:
   3.630 +      /* Width at screen size */  
   3.631 +      desiredW = display.w;
   3.632 +      break;
   3.633 +    }
   3.634 +
   3.635 +    switch(hVariation) {
   3.636 +     case 0:
   3.637 +      /* 1 Pixel High */  
   3.638 +      desiredH = 1;
   3.639 +      break;
   3.640 +     case 1:
   3.641 +      /* Random height inside screen */  
   3.642 +      desiredH = SDLTest_RandomIntegerInRange(2, display.h - 1);
   3.643 +      break;
   3.644 +     case 2:
   3.645 +      /* Height at screen size */  
   3.646 +      desiredH = display.h;
   3.647 +      break;
   3.648 +    }
   3.649 +
   3.650 +    /* Set size */
   3.651 +    SDL_SetWindowMaximumSize(window, desiredW, desiredH);
   3.652 +    SDLTest_AssertPass("Call to SDL_SetWindowMaximumSize(...,%d,%d)", desiredW, desiredH);
   3.653 +   
   3.654 +    /* Get size */
   3.655 +    currentW = desiredW + 1;
   3.656 +    currentH = desiredH + 1;
   3.657 +    SDL_GetWindowMaximumSize(window, &currentW, &currentH);
   3.658 +    SDLTest_AssertPass("Call to SDL_GetWindowMaximumSize()");
   3.659 +    SDLTest_AssertCheck(desiredW == currentW, "Verify returned width; expected: %d, got: %d", desiredW, currentW);
   3.660 +    SDLTest_AssertCheck(desiredH == currentH, "Verify returned height; expected: %d, got: %d", desiredH, currentH);
   3.661 +
   3.662 +    /* Get just width */
   3.663 +    currentW = desiredW + 1;    
   3.664 +    SDL_GetWindowMaximumSize(window, &currentW, NULL);
   3.665 +    SDLTest_AssertPass("Call to SDL_GetWindowMaximumSize(&h=NULL)");
   3.666 +    SDLTest_AssertCheck(desiredW == currentW, "Verify returned width; expected: %d, got: %d", desiredW, currentH);
   3.667 +
   3.668 +    /* Get just height */
   3.669 +    currentH = desiredH + 1;
   3.670 +    SDL_GetWindowMaximumSize(window, NULL, &currentH);
   3.671 +    SDLTest_AssertPass("Call to SDL_GetWindowMaximumSize(&w=NULL)");
   3.672 +    SDLTest_AssertCheck(desiredH == currentH, "Verify returned height; expected: %d, got: %d", desiredW, currentH);
   3.673 +   }
   3.674 +  }
   3.675 +
   3.676 +  /* Dummy call with both pointers NULL */
   3.677 +  SDL_GetWindowMaximumSize(window, NULL, NULL);
   3.678 +  SDLTest_AssertPass("Call to SDL_GetWindowMaximumSize(&w=NULL,&h=NULL)");
   3.679 +
   3.680 +  /* Negative tests for parameter input */
   3.681 +  SDL_ClearError();
   3.682 +  SDLTest_AssertPass("Call to SDL_ClearError()");  
   3.683 +  for (desiredH = -2; desiredH < 2; desiredH++) {
   3.684 +    for (desiredW = -2; desiredW < 2; desiredW++) {
   3.685 +      if (desiredW <= 0 || desiredH <= 0) { 
   3.686 +        SDL_SetWindowMaximumSize(window, desiredW, desiredH);
   3.687 +        SDLTest_AssertPass("Call to SDL_SetWindowMaximumSize(...,%d,%d)", desiredW, desiredH);
   3.688 +        _checkInvalidParameterError();
   3.689 +      }
   3.690 +    }
   3.691 +  }
   3.692 +   
   3.693 +  /* Clean up */    
   3.694 +  _destroyVideoSuiteTestWindow(window);
   3.695 +    
   3.696 +  /* Set some 'magic' value for later check that nothing was changed */
   3.697 +  referenceW = SDLTest_RandomSint32();
   3.698 +  referenceH = SDLTest_RandomSint32();
   3.699 +  currentW = referenceW;
   3.700 +  currentH = referenceH;
   3.701 +  desiredW = SDLTest_RandomSint32();
   3.702 +  desiredH = SDLTest_RandomSint32();
   3.703 +  
   3.704 +  /* Negative tests */
   3.705 +  SDL_ClearError();
   3.706 +  SDLTest_AssertPass("Call to SDL_ClearError()");
   3.707 +  SDL_GetWindowMaximumSize(NULL, &currentW, &currentH);
   3.708 +  SDLTest_AssertPass("Call to SDL_GetWindowMaximumSize(window=NULL)");
   3.709 +  SDLTest_AssertCheck(
   3.710 +  	currentW == referenceW && currentH == referenceH, 
   3.711 +  	"Verify that content of W and H pointers has not been modified; expected: %d,%d; got: %d,%d",
   3.712 +  	referenceW, referenceH,
   3.713 +  	currentW, currentH);
   3.714 +  _checkInvalidWindowError();
   3.715 +
   3.716 +  SDL_GetWindowMaximumSize(NULL, NULL, NULL);
   3.717 +  SDLTest_AssertPass("Call to SDL_GetWindowMaximumSize(NULL, NULL, NULL)");
   3.718 +  _checkInvalidWindowError();
   3.719 +
   3.720 +  SDL_SetWindowMaximumSize(NULL, desiredW, desiredH);
   3.721 +  SDLTest_AssertPass("Call to SDL_SetWindowMaximumSize(window=NULL)");
   3.722 +  _checkInvalidWindowError();
   3.723    
   3.724    return TEST_COMPLETED;
   3.725  }
   3.726 @@ -1160,7 +1535,7 @@
   3.727  		{ (SDLTest_TestCaseFp)video_getWindowGammaRampNegative, "video_getWindowGammaRampNegative",  "Get window gamma ramp against invalid input", TEST_ENABLED };
   3.728  
   3.729  static const SDLTest_TestCaseReference videoTest16 =
   3.730 -		{ (SDLTest_TestCaseFp)video_getSetWindowGrab, "video_getSetWindowGrab",  "Checks SDL_GetWindowGrab and SDL_SetWindowGrab", TEST_ENABLED };
   3.731 +		{ (SDLTest_TestCaseFp)video_getSetWindowGrab, "video_getSetWindowGrab",  "Checks SDL_GetWindowGrab and SDL_SetWindowGrab positive and negative cases", TEST_ENABLED };
   3.732  
   3.733  static const SDLTest_TestCaseReference videoTest17 =
   3.734  		{ (SDLTest_TestCaseFp)video_getWindowId, "video_getWindowId",  "Checks SDL_GetWindowID and SDL_GetWindowFromID", TEST_ENABLED };
   3.735 @@ -1169,14 +1544,24 @@
   3.736  		{ (SDLTest_TestCaseFp)video_getWindowPixelFormat, "video_getWindowPixelFormat",  "Checks SDL_GetWindowPixelFormat", TEST_ENABLED };
   3.737  
   3.738  static const SDLTest_TestCaseReference videoTest19 =
   3.739 -		{ (SDLTest_TestCaseFp)video_getSetWindowPosition, "video_getSetWindowPosition",  "Checks SDL_GetWindowPosition and SDL_SetWindowPosition", TEST_ENABLED };
   3.740 +		{ (SDLTest_TestCaseFp)video_getSetWindowPosition, "video_getSetWindowPosition",  "Checks SDL_GetWindowPosition and SDL_SetWindowPosition positive and negative cases", TEST_ENABLED };
   3.741 +
   3.742 +static const SDLTest_TestCaseReference videoTest20 =
   3.743 +		{ (SDLTest_TestCaseFp)video_getSetWindowSize, "video_getSetWindowSize",  "Checks SDL_GetWindowSize and SDL_SetWindowSize positive and negative cases", TEST_ENABLED };
   3.744 +
   3.745 +static const SDLTest_TestCaseReference videoTest21 =
   3.746 +		{ (SDLTest_TestCaseFp)video_getSetWindowMinimumSize, "video_getSetWindowMinimumSize",  "Checks SDL_GetWindowMinimumSize and SDL_SetWindowMinimumSize positive and negative cases", TEST_ENABLED };
   3.747 +
   3.748 +static const SDLTest_TestCaseReference videoTest22 =
   3.749 +		{ (SDLTest_TestCaseFp)video_getSetWindowMaximumSize, "video_getSetWindowMaximumSize",  "Checks SDL_GetWindowMaximumSize and SDL_SetWindowMaximumSize positive and negative cases", TEST_ENABLED };
   3.750  
   3.751  /* Sequence of Video test cases */
   3.752  static const SDLTest_TestCaseReference *videoTests[] =  {
   3.753  	&videoTest1, &videoTest2, &videoTest3, &videoTest4, &videoTest5, &videoTest6, 
   3.754  	&videoTest7, &videoTest8, &videoTest9, &videoTest10, &videoTest11, &videoTest12, 
   3.755  	&videoTest13, &videoTest14, &videoTest15, &videoTest16, &videoTest17, 
   3.756 -	&videoTest18, &videoTest19, NULL
   3.757 +	&videoTest18, &videoTest19, &videoTest20, &videoTest21, &videoTest22, 
   3.758 +	NULL
   3.759  };
   3.760  
   3.761  /* Video test suite (global) */