Commit f018ca469439b7d73fee0103127bbed52fb4f6c2

Andreas Schiffler 2014-03-19T21:39:55

Add input validation to SDL_getenv/SDL_setenv; update Stdlib testsuite; add Hints testsuite

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
diff --git a/VisualC/tests/testautomation/testautomation_VS2008.vcproj b/VisualC/tests/testautomation/testautomation_VS2008.vcproj
index 5b5ffa6..e6f465b 100755
--- a/VisualC/tests/testautomation/testautomation_VS2008.vcproj
+++ b/VisualC/tests/testautomation/testautomation_VS2008.vcproj
@@ -271,6 +271,10 @@
 			RelativePath="..\..\..\test\testautomation_video.c"
 			>
 		</File>
+		<File
+			RelativePath="..\..\..\test\testautomation_hints.c"
+			>
+		</File>
 	</Files>
 	<Globals>
 	</Globals>
diff --git a/VisualC/tests/testautomation/testautomation_vs2010.vcxproj b/VisualC/tests/testautomation/testautomation_vs2010.vcxproj
index 3c4fe9d..0730159 100644
--- a/VisualC/tests/testautomation/testautomation_vs2010.vcxproj
+++ b/VisualC/tests/testautomation/testautomation_vs2010.vcxproj
@@ -194,6 +194,7 @@
     <ClCompile Include="..\..\..\test\testautomation_syswm.c" />
     <ClCompile Include="..\..\..\test\testautomation_timer.c" />
     <ClCompile Include="..\..\..\test\testautomation_video.c" />
+    <ClCompile Include="..\..\..\test\testautomation_hints.c" />
   </ItemGroup>
   <ItemGroup>
     <ClInclude Include="..\..\..\test\testautomation_suites.h" />
diff --git a/VisualC/tests/testautomation/testautomation_vs2012.vcxproj b/VisualC/tests/testautomation/testautomation_vs2012.vcxproj
index a026096..b50329c 100644
--- a/VisualC/tests/testautomation/testautomation_vs2012.vcxproj
+++ b/VisualC/tests/testautomation/testautomation_vs2012.vcxproj
@@ -198,6 +198,7 @@
     <ClCompile Include="..\..\..\test\testautomation_syswm.c" />
     <ClCompile Include="..\..\..\test\testautomation_timer.c" />
     <ClCompile Include="..\..\..\test\testautomation_video.c" />
+    <ClCompile Include="..\..\..\test\testautomation_hints.c" />
   </ItemGroup>
   <ItemGroup>
     <ClInclude Include="..\..\..\test\testautomation_suites.h" />
diff --git a/VisualC/tests/testautomation/testautomation_vs2013.vcxproj b/VisualC/tests/testautomation/testautomation_vs2013.vcxproj
index 7fb1222..8bded70 100644
--- a/VisualC/tests/testautomation/testautomation_vs2013.vcxproj
+++ b/VisualC/tests/testautomation/testautomation_vs2013.vcxproj
@@ -198,6 +198,7 @@
     <ClCompile Include="..\..\..\test\testautomation_syswm.c" />
     <ClCompile Include="..\..\..\test\testautomation_timer.c" />
     <ClCompile Include="..\..\..\test\testautomation_video.c" />
+    <ClCompile Include="..\..\..\test\testautomation_hints.c" />
   </ItemGroup>
   <ItemGroup>
     <ClInclude Include="..\..\..\test\testautomation_suites.h" />
diff --git a/src/stdlib/SDL_getenv.c b/src/stdlib/SDL_getenv.c
index 4492110..782b8cc 100644
--- a/src/stdlib/SDL_getenv.c
+++ b/src/stdlib/SDL_getenv.c
@@ -33,16 +33,27 @@ static size_t SDL_envmemlen = 0;
 #endif
 
 /* Put a variable into the environment */
+/* Note: Name may not contain a '=' character. (Reference: http://www.unix.com/man-page/Linux/3/setenv/) */
 #if defined(HAVE_SETENV)
 int
 SDL_setenv(const char *name, const char *value, int overwrite)
 {
+    /* Input validation */
+    if (!name || SDL_strlen(name) == 0 || SDL_strchr(name, '=') != NULL || !value) {
+        return (-1);
+    }
+    
     return setenv(name, value, overwrite);
 }
 #elif defined(__WIN32__)
 int
 SDL_setenv(const char *name, const char *value, int overwrite)
 {
+    /* Input validation */
+    if (!name || SDL_strlen(name) == 0 || SDL_strchr(name, '=') != NULL || !value) {
+        return (-1);
+    }
+    
     if (!overwrite) {
         char ch = 0;
         const size_t len = GetEnvironmentVariableA(name, &ch, sizeof (ch));
@@ -63,6 +74,11 @@ SDL_setenv(const char *name, const char *value, int overwrite)
     size_t len;
     char *new_variable;
 
+    /* Input validation */
+    if (!name || SDL_strlen(name) == 0 || SDL_strchr(name, '=') != NULL || !value) {
+        return (-1);
+    }
+    
     if (getenv(name) != NULL) {
         if (overwrite) {
             unsetenv(name);
@@ -91,8 +107,8 @@ SDL_setenv(const char *name, const char *value, int overwrite)
     char **new_env;
     char *new_variable;
 
-    /* A little error checking */
-    if (!name || !value) {
+    /* Input validation */
+    if (!name || SDL_strlen(name) == 0 || SDL_strchr(name, '=') != NULL || !value) {
         return (-1);
     }
 
@@ -152,6 +168,11 @@ SDL_setenv(const char *name, const char *value, int overwrite)
 char *
 SDL_getenv(const char *name)
 {
+    /* Input validation */
+    if (!name || SDL_strlen(name)==0) {
+        return NULL;
+    }
+
     return getenv(name);
 }
 #elif defined(__WIN32__)
@@ -160,6 +181,11 @@ SDL_getenv(const char *name)
 {
     size_t bufferlen;
 
+    /* Input validation */
+    if (!name || SDL_strlen(name)==0) {
+        return NULL;
+    }
+    
     bufferlen =
         GetEnvironmentVariableA(name, SDL_envmem, (DWORD) SDL_envmemlen);
     if (bufferlen == 0) {
@@ -183,6 +209,11 @@ SDL_getenv(const char *name)
     int len, i;
     char *value;
 
+    /* Input validation */
+    if (!name || SDL_strlen(name)==0) {
+        return NULL;
+    }
+    
     value = (char *) 0;
     if (SDL_env) {
         len = SDL_strlen(name);
diff --git a/test/Makefile.in b/test/Makefile.in
index bf03896..7ed1a7a 100644
--- a/test/Makefile.in
+++ b/test/Makefile.in
@@ -92,7 +92,8 @@ testautomation$(EXE): $(srcdir)/testautomation.c \
 		      $(srcdir)/testautomation_surface.c \
 		      $(srcdir)/testautomation_syswm.c \
 		      $(srcdir)/testautomation_timer.c \
-		      $(srcdir)/testautomation_video.c
+		      $(srcdir)/testautomation_video.c \
+		      $(srcdir)/testautomation_hints.c
 	$(CC) -o $@ $^ $(CFLAGS) $(LIBS) 
 
 testmultiaudio$(EXE): $(srcdir)/testmultiaudio.c
diff --git a/test/testautomation_hints.c b/test/testautomation_hints.c
new file mode 100644
index 0000000..a6beb88
--- /dev/null
+++ b/test/testautomation_hints.c
@@ -0,0 +1,168 @@
+/**
+ * Hints test suite
+ */
+
+#include <stdio.h>
+
+#include "SDL.h"
+#include "SDL_test.h"
+
+
+const int _numHintsEnum = 25;
+char* _HintsEnum[] =
+  {
+    SDL_HINT_ACCELEROMETER_AS_JOYSTICK,
+    SDL_HINT_FRAMEBUFFER_ACCELERATION,
+    SDL_HINT_GAMECONTROLLERCONFIG,
+    SDL_HINT_GRAB_KEYBOARD,
+    SDL_HINT_IDLE_TIMER_DISABLED,
+    SDL_HINT_JOYSTICK_ALLOW_BACKGROUND_EVENTS,
+    SDL_HINT_MAC_CTRL_CLICK_EMULATE_RIGHT_CLICK,
+    SDL_HINT_MOUSE_RELATIVE_MODE_WARP,
+    SDL_HINT_ORIENTATIONS,
+    SDL_HINT_RENDER_DIRECT3D_THREADSAFE,
+    SDL_HINT_RENDER_DRIVER,
+    SDL_HINT_RENDER_OPENGL_SHADERS,
+    SDL_HINT_RENDER_SCALE_QUALITY,
+    SDL_HINT_RENDER_VSYNC,
+    SDL_HINT_TIMER_RESOLUTION,
+    SDL_HINT_VIDEO_ALLOW_SCREENSAVER,
+    SDL_HINT_VIDEO_HIGHDPI_DISABLED,
+    SDL_HINT_VIDEO_MAC_FULLSCREEN_SPACES,
+    SDL_HINT_VIDEO_MINIMIZE_ON_FOCUS_LOSS,
+    SDL_HINT_VIDEO_WINDOW_SHARE_PIXEL_FORMAT,
+    SDL_HINT_VIDEO_WIN_D3DCOMPILER,
+    SDL_HINT_VIDEO_X11_XINERAMA,
+    SDL_HINT_VIDEO_X11_XRANDR,
+    SDL_HINT_VIDEO_X11_XVIDMODE,
+    SDL_HINT_XINPUT_ENABLED,
+  };
+char* _HintsVerbose[] =
+  {
+    "SDL_HINT_ACCELEROMETER_AS_JOYSTICK",
+    "SDL_HINT_FRAMEBUFFER_ACCELERATION",
+    "SDL_HINT_GAMECONTROLLERCONFIG",
+    "SDL_HINT_GRAB_KEYBOARD",
+    "SDL_HINT_IDLE_TIMER_DISABLED",
+    "SDL_HINT_JOYSTICK_ALLOW_BACKGROUND_EVENTS",
+    "SDL_HINT_MAC_CTRL_CLICK_EMULATE_RIGHT_CLICK",
+    "SDL_HINT_MOUSE_RELATIVE_MODE_WARP",
+    "SDL_HINT_ORIENTATIONS",
+    "SDL_HINT_RENDER_DIRECT3D_THREADSAFE",
+    "SDL_HINT_RENDER_DRIVER",
+    "SDL_HINT_RENDER_OPENGL_SHADERS",
+    "SDL_HINT_RENDER_SCALE_QUALITY",
+    "SDL_HINT_RENDER_VSYNC",
+    "SDL_HINT_TIMER_RESOLUTION",
+    "SDL_HINT_VIDEO_ALLOW_SCREENSAVER",
+    "SDL_HINT_VIDEO_HIGHDPI_DISABLED",
+    "SDL_HINT_VIDEO_MAC_FULLSCREEN_SPACES",
+    "SDL_HINT_VIDEO_MINIMIZE_ON_FOCUS_LOSS",
+    "SDL_HINT_VIDEO_WINDOW_SHARE_PIXEL_FORMAT",
+    "SDL_HINT_VIDEO_WIN_D3DCOMPILER",
+    "SDL_HINT_VIDEO_X11_XINERAMA",
+    "SDL_HINT_VIDEO_X11_XRANDR",
+    "SDL_HINT_VIDEO_X11_XVIDMODE",
+    "SDL_HINT_XINPUT_ENABLED"
+  };
+
+
+/* Test case functions */
+
+/**
+ * @brief Call to SDL_GetHint
+ */
+int
+hints_getHint(void *arg)
+{
+  char *result1;
+  char *result2;
+  int i;
+    
+  for (i=0; i<_numHintsEnum; i++) {
+    result1 = (char *)SDL_GetHint((char*)_HintsEnum[i]);
+    SDLTest_AssertPass("Call to SDL_GetHint(%s) - using define definition", (char*)_HintsEnum[i]);
+    result2 = (char *)SDL_GetHint((char *)_HintsVerbose[i]);
+    SDLTest_AssertPass("Call to SDL_GetHint(%s) - using string definition", (char*)_HintsVerbose[i]);
+    SDLTest_AssertCheck(
+      (result1 == NULL && result2 == NULL) || (SDL_strcmp(result1, result2) == 0),
+      "Verify returned values are equal; got: result1='%s' result2='%s",
+      (result1 == NULL) ? "null" : result1,
+      (result2 == NULL) ? "null" : result2);
+  }
+  
+  return TEST_COMPLETED;
+}
+
+/**
+ * @brief Call to SDL_SetHint
+ */
+int
+hints_setHint(void *arg)
+{
+  char *originalValue;
+  char *value;
+  char *testValue;
+  SDL_bool result;
+  int i, j;
+
+  /* Create random values to set */                    
+  value = SDLTest_RandomAsciiStringOfSize(10);
+    
+  for (i=0; i<_numHintsEnum; i++) {
+    /* Capture current value */
+    originalValue = (char *)SDL_GetHint((char*)_HintsEnum[i]);
+    SDLTest_AssertPass("Call to SDL_GetHint(%s)", (char*)_HintsEnum[i]);
+    
+    /* Set value (twice) */
+    for (j=1; j<=2; j++) {
+      result = SDL_SetHint((char*)_HintsEnum[i], value);
+      SDLTest_AssertPass("Call to SDL_SetHint(%s, %s) (iteration %i)", (char*)_HintsEnum[i], value, j);
+      SDLTest_AssertCheck(
+        result == SDL_TRUE || result == SDL_FALSE, 
+        "Verify valid result was returned, got: %i",
+        (int)result);
+      testValue = (char *)SDL_GetHint((char*)_HintsEnum[i]);
+      SDLTest_AssertPass("Call to SDL_GetHint(%s) - using string definition", (char*)_HintsVerbose[i]);
+      SDLTest_AssertCheck(
+        (SDL_strcmp(value, testValue) == 0),
+        "Verify returned value equals set value; got: testValue='%s' value='%s",
+        (testValue == NULL) ? "null" : testValue,
+        value);
+    }
+      
+    /* Reset original value */
+    result = SDL_SetHint((char*)_HintsEnum[i], originalValue);
+    SDLTest_AssertPass("Call to SDL_SetHint(%s, originalValue)", (char*)_HintsEnum[i]);
+    SDLTest_AssertCheck(
+      result == SDL_TRUE || result == SDL_FALSE, 
+      "Verify valid result was returned, got: %i",
+      (int)result);
+  }
+  
+  SDL_free(value);
+  
+  return TEST_COMPLETED;
+}
+
+/* ================= Test References ================== */
+
+/* Hints test cases */
+static const SDLTest_TestCaseReference hintsTest1 =
+        { (SDLTest_TestCaseFp)hints_getHint, "hints_getHint", "Call to SDL_GetHint", TEST_ENABLED };
+
+static const SDLTest_TestCaseReference hintsTest2 =
+        { (SDLTest_TestCaseFp)hints_setHint, "hints_setHint", "Call to SDL_SetHint", TEST_ENABLED };
+
+/* Sequence of Hints test cases */
+static const SDLTest_TestCaseReference *hintsTests[] =  {
+    &hintsTest1, &hintsTest2, NULL
+};
+
+/* Hints test suite (global) */
+SDLTest_TestSuiteReference hintsTestSuite = {
+    "Hints",
+    NULL,
+    hintsTests,
+    NULL
+};
diff --git a/test/testautomation_stdlib.c b/test/testautomation_stdlib.c
index 93ce891..7da8d30 100644
--- a/test/testautomation_stdlib.c
+++ b/test/testautomation_stdlib.c
@@ -119,6 +119,140 @@ stdlib_snprintf(void *arg)
   return TEST_COMPLETED;
 }
 
+/**
+ * @brief Call to SDL_getenv and SDL_setenv
+ */
+int
+stdlib_getsetenv(void *arg)
+{
+  const int nameLen = 16;
+  int counter;
+  int result;
+  char name[nameLen + 1];
+  char * value1;
+  char * value2;
+  char * expected;
+  int overwrite;
+  char * text;
+
+  /* Create a random name. This tests SDL_getenv, since we need to */
+  /* make sure the variable is not set yet (it shouldn't). */
+  do {
+    for(counter = 0; counter < nameLen; counter++) {
+      name[counter] = (char)SDLTest_RandomIntegerInRange(65, 90);
+    }
+    name[nameLen] = '\0';
+    
+    text = SDL_getenv(name);
+    SDLTest_AssertPass("Call to SDL_getenv('%s')", name);
+    if (text != NULL) {
+      SDLTest_Log("Expected: NULL, Got: '%s' (%i)", text, SDL_strlen(text));
+    }
+  } while (text != NULL);
+   
+  /* Create random values to set */                    
+  value1 = SDLTest_RandomAsciiStringOfSize(10);
+  value2 = SDLTest_RandomAsciiStringOfSize(10);
+
+  /* Set value 1 without overwrite */
+  overwrite = 0;
+  expected = value1;
+  result = SDL_setenv(name, value1, overwrite);
+  SDLTest_AssertPass("Call to SDL_setenv('%s','%s', %i)", name, value1, overwrite);
+  SDLTest_AssertCheck(result == 0, "Check result, expected: 0, got: %i", result);
+
+  /* Check value */
+  text = SDL_getenv(name);
+  SDLTest_AssertPass("Call to SDL_getenv('%s')", name);
+  SDLTest_AssertCheck(text != NULL, "Verify returned text is not NULL");
+  if (text != NULL) {
+    SDLTest_AssertCheck(
+      SDL_strcmp(text, expected) == 0, 
+      "Verify returned text, expected: %s, got: %s",
+      expected,
+      text);
+  }
+  
+  /* Set value 2 with overwrite */
+  overwrite = 1;
+  expected = value2;    
+  result = SDL_setenv(name, value2, overwrite);
+  SDLTest_AssertPass("Call to SDL_setenv('%s','%s', %i)", name, value2, overwrite);
+  SDLTest_AssertCheck(result == 0, "Check result, expected: 0, got: %i", result);
+
+  /* Check value */
+  text = SDL_getenv(name);
+  SDLTest_AssertPass("Call to SDL_getenv('%s')", name);
+  SDLTest_AssertCheck(text != NULL, "Verify returned text is not NULL");
+  if (text != NULL) {
+    SDLTest_AssertCheck(
+      SDL_strcmp(text, expected) == 0, 
+      "Verify returned text, expected: %s, got: %s",
+      expected,
+      text);
+  }
+
+  /* Set value 1 without overwrite */
+  overwrite = 0;
+  expected = value2;    
+  result = SDL_setenv(name, value1, overwrite);
+  SDLTest_AssertPass("Call to SDL_setenv('%s','%s', %i)", name, value1, overwrite);
+  SDLTest_AssertCheck(result == 0, "Check result, expected: 0, got: %i", result);
+
+  /* Check value */
+  text = SDL_getenv(name);
+  SDLTest_AssertPass("Call to SDL_getenv('%s')", name);
+  SDLTest_AssertCheck(text != NULL, "Verify returned text is not NULL");
+  if (text != NULL) {
+    SDLTest_AssertCheck(
+      SDL_strcmp(text, expected) == 0, 
+      "Verify returned text, expected: %s, got: %s",
+      expected,
+      text);
+  }
+  
+  /* Set value 1 without overwrite */
+  overwrite = 1;
+  expected = value1;
+  result = SDL_setenv(name, value1, overwrite);
+  SDLTest_AssertPass("Call to SDL_setenv('%s','%s', %i)", name, value1, overwrite);
+  SDLTest_AssertCheck(result == 0, "Check result, expected: 0, got: %i", result);
+
+  /* Check value */
+  text = SDL_getenv(name);
+  SDLTest_AssertPass("Call to SDL_getenv('%s')", name);
+  SDLTest_AssertCheck(text != NULL, "Verify returned text is not NULL");
+  if (text != NULL) {
+    SDLTest_AssertCheck(
+      SDL_strcmp(text, expected) == 0, 
+      "Verify returned text, expected: %s, got: %s",
+      expected,
+      text);
+  }
+
+  /* Negative cases */
+  for (overwrite=0; overwrite <= 1; overwrite++) { 
+    result = SDL_setenv(NULL, value1, overwrite);
+    SDLTest_AssertPass("Call to SDL_setenv(NULL,'%s', %i)", value1, overwrite);
+    SDLTest_AssertCheck(result == -1, "Check result, expected: -1, got: %i", result);
+    result = SDL_setenv("", value1, overwrite);
+    SDLTest_AssertPass("Call to SDL_setenv('','%s', %i)", value1, overwrite);
+    SDLTest_AssertCheck(result == -1, "Check result, expected: -1, got: %i", result);
+    result = SDL_setenv("=", value1, overwrite);
+    SDLTest_AssertPass("Call to SDL_setenv('=','%s', %i)", value1, overwrite);
+    SDLTest_AssertCheck(result == -1, "Check result, expected: -1, got: %i", result);
+    result = SDL_setenv(name, NULL, overwrite);
+    SDLTest_AssertPass("Call to SDL_setenv('%s', NULL, %i)", name, overwrite);
+    SDLTest_AssertCheck(result == -1, "Check result, expected: -1, got: %i", result);
+  }
+
+  /* Clean up */
+  SDL_free(value1);
+  SDL_free(value2);
+    
+  return TEST_COMPLETED;
+}
+
 /* ================= Test References ================== */
 
 /* Standard C routine test cases */
@@ -128,14 +262,17 @@ static const SDLTest_TestCaseReference stdlibTest1 =
 static const SDLTest_TestCaseReference stdlibTest2 =
         { (SDLTest_TestCaseFp)stdlib_snprintf, "stdlib_snprintf", "Call to SDL_snprintf", TEST_ENABLED };
 
+static const SDLTest_TestCaseReference stdlibTest3 =
+        { (SDLTest_TestCaseFp)stdlib_getsetenv, "stdlib_getsetenv", "Call to SDL_getenv and SDL_setenv", TEST_ENABLED };
+
 /* Sequence of Standard C routine test cases */
 static const SDLTest_TestCaseReference *stdlibTests[] =  {
-    &stdlibTest1, &stdlibTest2, NULL
+    &stdlibTest1, &stdlibTest2, &stdlibTest3, NULL
 };
 
 /* Timer test suite (global) */
 SDLTest_TestSuiteReference stdlibTestSuite = {
-    "Standard C routines",
+    "Stdlib",
     NULL,
     stdlibTests,
     NULL
diff --git a/test/testautomation_suites.h b/test/testautomation_suites.h
index 1ba7c95..b5f921e 100644
--- a/test/testautomation_suites.h
+++ b/test/testautomation_suites.h
@@ -26,6 +26,7 @@ extern SDLTest_TestSuiteReference surfaceTestSuite;
 extern SDLTest_TestSuiteReference syswmTestSuite;
 extern SDLTest_TestSuiteReference timerTestSuite;
 extern SDLTest_TestSuiteReference videoTestSuite;
+extern SDLTest_TestSuiteReference hintsTestSuite;
 
 /* All test suites */
 SDLTest_TestSuiteReference *testSuites[] =  {
@@ -46,6 +47,7 @@ SDLTest_TestSuiteReference *testSuites[] =  {
     &syswmTestSuite,
     &timerTestSuite,
     &videoTestSuite,
+    &hintsTestSuite,
     NULL
 };