test/testautomation_clipboard.c
changeset 7191 75360622e65f
parent 7144 c700de9c8ed4
child 7477 a73210626b97
     1.1 --- a/test/testautomation_clipboard.c	Sat May 18 12:48:50 2013 -0700
     1.2 +++ b/test/testautomation_clipboard.c	Sat May 18 14:17:52 2013 -0700
     1.3 @@ -21,9 +21,9 @@
     1.4  int
     1.5  clipboard_testHasClipboardText(void *arg)
     1.6  {
     1.7 -	SDL_bool result;
     1.8 -	result = SDL_HasClipboardText();
     1.9 -	SDLTest_AssertPass("Call to SDL_HasClipboardText succeeded");
    1.10 +    SDL_bool result;
    1.11 +    result = SDL_HasClipboardText();
    1.12 +    SDLTest_AssertPass("Call to SDL_HasClipboardText succeeded");
    1.13  
    1.14      return TEST_COMPLETED;
    1.15  }
    1.16 @@ -37,11 +37,11 @@
    1.17  int
    1.18  clipboard_testGetClipboardText(void *arg)
    1.19  {
    1.20 -	char *charResult;
    1.21 -	charResult = SDL_GetClipboardText();
    1.22 -	SDLTest_AssertPass("Call to SDL_GetClipboardText succeeded");
    1.23 +    char *charResult;
    1.24 +    charResult = SDL_GetClipboardText();
    1.25 +    SDLTest_AssertPass("Call to SDL_GetClipboardText succeeded");
    1.26  
    1.27 -	if (charResult) SDL_free(charResult);
    1.28 +    if (charResult) SDL_free(charResult);
    1.29  
    1.30      return TEST_COMPLETED;
    1.31  }
    1.32 @@ -54,19 +54,19 @@
    1.33  int
    1.34  clipboard_testSetClipboardText(void *arg)
    1.35  {
    1.36 -	char *textRef = SDLTest_RandomAsciiString();
    1.37 -	char *text = SDL_strdup(textRef);
    1.38 -	int result;
    1.39 -	result = SDL_SetClipboardText((const char *)text);
    1.40 -	SDLTest_AssertPass("Call to SDL_SetClipboardText succeeded");
    1.41 -	SDLTest_AssertCheck(
    1.42 -		result == 0,
    1.43 -		"Validate SDL_SetClipboardText result, expected 0, got %i",
    1.44 -		result);
    1.45 -	SDLTest_AssertCheck(
    1.46 -		SDL_strcmp(textRef, text) == 0,
    1.47 -		"Verify SDL_SetClipboardText did not modify input string, expected '%s', got '%s'",
    1.48 -		textRef, text);
    1.49 +    char *textRef = SDLTest_RandomAsciiString();
    1.50 +    char *text = SDL_strdup(textRef);
    1.51 +    int result;
    1.52 +    result = SDL_SetClipboardText((const char *)text);
    1.53 +    SDLTest_AssertPass("Call to SDL_SetClipboardText succeeded");
    1.54 +    SDLTest_AssertCheck(
    1.55 +        result == 0,
    1.56 +        "Validate SDL_SetClipboardText result, expected 0, got %i",
    1.57 +        result);
    1.58 +    SDLTest_AssertCheck(
    1.59 +        SDL_strcmp(textRef, text) == 0,
    1.60 +        "Verify SDL_SetClipboardText did not modify input string, expected '%s', got '%s'",
    1.61 +        textRef, text);
    1.62  
    1.63      /* Cleanup */
    1.64      if (textRef) SDL_free(textRef);
    1.65 @@ -85,64 +85,64 @@
    1.66  int
    1.67  clipboard_testClipboardTextFunctions(void *arg)
    1.68  {
    1.69 -	char *textRef = SDLTest_RandomAsciiString();
    1.70 -	char *text = SDL_strdup(textRef);
    1.71 -	SDL_bool boolResult;
    1.72 -	int intResult;
    1.73 -	char *charResult;
    1.74 +    char *textRef = SDLTest_RandomAsciiString();
    1.75 +    char *text = SDL_strdup(textRef);
    1.76 +    SDL_bool boolResult;
    1.77 +    int intResult;
    1.78 +    char *charResult;
    1.79  
    1.80 -	/* Clear clipboard text state */
    1.81 -	boolResult = SDL_HasClipboardText();
    1.82 -	SDLTest_AssertPass("Call to SDL_HasClipboardText succeeded");
    1.83 -	if (boolResult == SDL_TRUE) {
    1.84 +    /* Clear clipboard text state */
    1.85 +    boolResult = SDL_HasClipboardText();
    1.86 +    SDLTest_AssertPass("Call to SDL_HasClipboardText succeeded");
    1.87 +    if (boolResult == SDL_TRUE) {
    1.88          intResult = SDL_SetClipboardText((const char *)NULL);
    1.89          SDLTest_AssertPass("Call to SDL_SetClipboardText(NULL) succeeded");
    1.90 -	    SDLTest_AssertCheck(
    1.91 -			intResult == 0,
    1.92 -			"Verify result from SDL_SetClipboardText(NULL), expected 0, got %i",
    1.93 -			intResult);
    1.94 -	    charResult = SDL_GetClipboardText();
    1.95 -		SDLTest_AssertPass("Call to SDL_GetClipboardText succeeded");
    1.96 -	    boolResult = SDL_HasClipboardText();
    1.97 -		SDLTest_AssertPass("Call to SDL_HasClipboardText succeeded");
    1.98 -	    SDLTest_AssertCheck(
    1.99 +        SDLTest_AssertCheck(
   1.100 +            intResult == 0,
   1.101 +            "Verify result from SDL_SetClipboardText(NULL), expected 0, got %i",
   1.102 +            intResult);
   1.103 +        charResult = SDL_GetClipboardText();
   1.104 +        SDLTest_AssertPass("Call to SDL_GetClipboardText succeeded");
   1.105 +        boolResult = SDL_HasClipboardText();
   1.106 +        SDLTest_AssertPass("Call to SDL_HasClipboardText succeeded");
   1.107 +        SDLTest_AssertCheck(
   1.108              boolResult == SDL_FALSE,
   1.109 -	        "Verify SDL_HasClipboardText returned SDL_FALSE, got %s",
   1.110 -			(boolResult) ? "SDL_TRUE" : "SDL_FALSE");
   1.111 +            "Verify SDL_HasClipboardText returned SDL_FALSE, got %s",
   1.112 +            (boolResult) ? "SDL_TRUE" : "SDL_FALSE");
   1.113      }
   1.114  
   1.115      /* Empty clipboard  */
   1.116 -	charResult = SDL_GetClipboardText();
   1.117 -	SDLTest_AssertPass("Call to SDL_GetClipboardText succeeded");
   1.118 -	SDLTest_AssertCheck(
   1.119 -		charResult != NULL,
   1.120 -		"Verify SDL_GetClipboardText did not return NULL");
   1.121 -	SDLTest_AssertCheck(
   1.122 -		SDL_strlen(charResult) == 0,
   1.123 -		"Verify SDL_GetClipboardText returned string with length 0, got length %i",
   1.124 -		SDL_strlen(charResult));
   1.125 +    charResult = SDL_GetClipboardText();
   1.126 +    SDLTest_AssertPass("Call to SDL_GetClipboardText succeeded");
   1.127 +    SDLTest_AssertCheck(
   1.128 +        charResult != NULL,
   1.129 +        "Verify SDL_GetClipboardText did not return NULL");
   1.130 +    SDLTest_AssertCheck(
   1.131 +        SDL_strlen(charResult) == 0,
   1.132 +        "Verify SDL_GetClipboardText returned string with length 0, got length %i",
   1.133 +        SDL_strlen(charResult));
   1.134      intResult = SDL_SetClipboardText((const char *)text);
   1.135 -	SDLTest_AssertPass("Call to SDL_SetClipboardText succeeded");
   1.136 -	SDLTest_AssertCheck(
   1.137 -		intResult == 0,
   1.138 -		"Verify result from SDL_SetClipboardText(NULL), expected 0, got %i",
   1.139 -		intResult);
   1.140 -	SDLTest_AssertCheck(
   1.141 -		SDL_strcmp(textRef, text) == 0,
   1.142 -		"Verify SDL_SetClipboardText did not modify input string, expected '%s', got '%s'",
   1.143 -		textRef, text);
   1.144 -	boolResult = SDL_HasClipboardText();
   1.145 -	SDLTest_AssertPass("Call to SDL_HasClipboardText succeeded");
   1.146 -	SDLTest_AssertCheck(
   1.147 +    SDLTest_AssertPass("Call to SDL_SetClipboardText succeeded");
   1.148 +    SDLTest_AssertCheck(
   1.149 +        intResult == 0,
   1.150 +        "Verify result from SDL_SetClipboardText(NULL), expected 0, got %i",
   1.151 +        intResult);
   1.152 +    SDLTest_AssertCheck(
   1.153 +        SDL_strcmp(textRef, text) == 0,
   1.154 +        "Verify SDL_SetClipboardText did not modify input string, expected '%s', got '%s'",
   1.155 +        textRef, text);
   1.156 +    boolResult = SDL_HasClipboardText();
   1.157 +    SDLTest_AssertPass("Call to SDL_HasClipboardText succeeded");
   1.158 +    SDLTest_AssertCheck(
   1.159          boolResult == SDL_TRUE,
   1.160 -	    "Verify SDL_HasClipboardText returned SDL_TRUE, got %s",
   1.161 -		(boolResult) ? "SDL_TRUE" : "SDL_FALSE");
   1.162 -	charResult = SDL_GetClipboardText();
   1.163 -	SDLTest_AssertPass("Call to SDL_GetClipboardText succeeded");
   1.164 -	SDLTest_AssertCheck(
   1.165 -		strcmp(textRef, charResult) == 0,
   1.166 -		"Verify SDL_GetClipboardText returned correct string, expected '%s', got '%s'",
   1.167 -		textRef, charResult);
   1.168 +        "Verify SDL_HasClipboardText returned SDL_TRUE, got %s",
   1.169 +        (boolResult) ? "SDL_TRUE" : "SDL_FALSE");
   1.170 +    charResult = SDL_GetClipboardText();
   1.171 +    SDLTest_AssertPass("Call to SDL_GetClipboardText succeeded");
   1.172 +    SDLTest_AssertCheck(
   1.173 +        strcmp(textRef, charResult) == 0,
   1.174 +        "Verify SDL_GetClipboardText returned correct string, expected '%s', got '%s'",
   1.175 +        textRef, charResult);
   1.176  
   1.177      /* Cleanup */
   1.178      if (textRef) SDL_free(textRef);
   1.179 @@ -157,26 +157,26 @@
   1.180  
   1.181  /* Clipboard test cases */
   1.182  static const SDLTest_TestCaseReference clipboardTest1 =
   1.183 -		{ (SDLTest_TestCaseFp)clipboard_testHasClipboardText, "clipboard_testHasClipboardText", "Check call to SDL_HasClipboardText", TEST_ENABLED };
   1.184 +        { (SDLTest_TestCaseFp)clipboard_testHasClipboardText, "clipboard_testHasClipboardText", "Check call to SDL_HasClipboardText", TEST_ENABLED };
   1.185  
   1.186  static const SDLTest_TestCaseReference clipboardTest2 =
   1.187 -		{ (SDLTest_TestCaseFp)clipboard_testGetClipboardText, "clipboard_testGetClipboardText", "Check call to SDL_GetClipboardText", TEST_ENABLED };
   1.188 +        { (SDLTest_TestCaseFp)clipboard_testGetClipboardText, "clipboard_testGetClipboardText", "Check call to SDL_GetClipboardText", TEST_ENABLED };
   1.189  
   1.190  static const SDLTest_TestCaseReference clipboardTest3 =
   1.191 -		{ (SDLTest_TestCaseFp)clipboard_testSetClipboardText, "clipboard_testSetClipboardText", "Check call to SDL_SetClipboardText", TEST_ENABLED };
   1.192 +        { (SDLTest_TestCaseFp)clipboard_testSetClipboardText, "clipboard_testSetClipboardText", "Check call to SDL_SetClipboardText", TEST_ENABLED };
   1.193  
   1.194  static const SDLTest_TestCaseReference clipboardTest4 =
   1.195 -		{ (SDLTest_TestCaseFp)clipboard_testClipboardTextFunctions, "clipboard_testClipboardTextFunctions", "End-to-end test of SDL_xyzClipboardText functions", TEST_ENABLED };
   1.196 +        { (SDLTest_TestCaseFp)clipboard_testClipboardTextFunctions, "clipboard_testClipboardTextFunctions", "End-to-end test of SDL_xyzClipboardText functions", TEST_ENABLED };
   1.197  
   1.198  /* Sequence of Clipboard test cases */
   1.199  static const SDLTest_TestCaseReference *clipboardTests[] =  {
   1.200 -	&clipboardTest1, &clipboardTest2, &clipboardTest3, &clipboardTest4, NULL
   1.201 +    &clipboardTest1, &clipboardTest2, &clipboardTest3, &clipboardTest4, NULL
   1.202  };
   1.203  
   1.204  /* Clipboard test suite (global) */
   1.205  SDLTest_TestSuiteReference clipboardTestSuite = {
   1.206 -	"Clipboard",
   1.207 -	NULL,
   1.208 -	clipboardTests,
   1.209 -	NULL
   1.210 +    "Clipboard",
   1.211 +    NULL,
   1.212 +    clipboardTests,
   1.213 +    NULL
   1.214  };