Mercurial > sdl-ios-xcode
comparison src/stdlib/SDL_getenv.c @ 3591:db4af3cb938e
Updated test code to use SDL_setenv()
author | Sam Lantinga <slouken@libsdl.org> |
---|---|
date | Thu, 17 Dec 2009 07:46:13 +0000 |
parents | 65f66674b7fb |
children | f7b03b6838cb |
comparison
equal
deleted
inserted
replaced
3590:493f252a455c | 3591:db4af3cb938e |
---|---|
212 } else { | 212 } else { |
213 printf("failed\n"); | 213 printf("failed\n"); |
214 } | 214 } |
215 printf("Setting FIRST=VALUE1 in the environment... "); | 215 printf("Setting FIRST=VALUE1 in the environment... "); |
216 fflush(stdout); | 216 fflush(stdout); |
217 if (SDL_putenv("FIRST=VALUE1") == 0) { | 217 if (SDL_setenv("FIRST", "VALUE1", 0) == 0) { |
218 printf("okay\n"); | 218 printf("okay\n"); |
219 } else { | 219 } else { |
220 printf("failed\n"); | 220 printf("failed\n"); |
221 } | 221 } |
222 printf("Getting FIRST from the environment... "); | 222 printf("Getting FIRST from the environment... "); |
227 } else { | 227 } else { |
228 printf("failed\n"); | 228 printf("failed\n"); |
229 } | 229 } |
230 printf("Setting SECOND=VALUE2 in the environment... "); | 230 printf("Setting SECOND=VALUE2 in the environment... "); |
231 fflush(stdout); | 231 fflush(stdout); |
232 if (SDL_putenv("SECOND=VALUE2") == 0) { | 232 if (SDL_setenv("SECOND", "VALUE2", 0) == 0) { |
233 printf("okay\n"); | 233 printf("okay\n"); |
234 } else { | 234 } else { |
235 printf("failed\n"); | 235 printf("failed\n"); |
236 } | 236 } |
237 printf("Getting SECOND from the environment... "); | 237 printf("Getting SECOND from the environment... "); |
242 } else { | 242 } else { |
243 printf("failed\n"); | 243 printf("failed\n"); |
244 } | 244 } |
245 printf("Setting FIRST=NOVALUE in the environment... "); | 245 printf("Setting FIRST=NOVALUE in the environment... "); |
246 fflush(stdout); | 246 fflush(stdout); |
247 if (SDL_putenv("FIRST=NOVALUE") == 0) { | 247 if (SDL_setenv("FIRST", "NOVALUE", 1) == 0) { |
248 printf("okay\n"); | 248 printf("okay\n"); |
249 } else { | 249 } else { |
250 printf("failed\n"); | 250 printf("failed\n"); |
251 } | 251 } |
252 printf("Getting FIRST from the environment... "); | 252 printf("Getting FIRST from the environment... "); |
265 printf("failed\n"); | 265 printf("failed\n"); |
266 } | 266 } |
267 return (0); | 267 return (0); |
268 } | 268 } |
269 #endif /* TEST_MAIN */ | 269 #endif /* TEST_MAIN */ |
270 | |
270 /* vi: set ts=4 sw=4 expandtab: */ | 271 /* vi: set ts=4 sw=4 expandtab: */ |