summaryrefslogtreecommitdiff
path: root/test/testwm2.c
diff options
context:
space:
mode:
authorRyan C. Gordon <icculus@icculus.org>2019-05-19 01:45:15 -0400
committerRyan C. Gordon <icculus@icculus.org>2019-05-19 01:45:15 -0400
commita26bf77380cec9c0c5e07d9ab1784c2f773a2532 (patch)
tree6120ce96d6771d5092a177f4faf0c0ed3294c5f4 /test/testwm2.c
parent92049e2a1b320abe641f42181378cf68bae9f1bb (diff)
downloadsdl-a26bf77380cec9c0c5e07d9ab1784c2f773a2532.tar.gz
test: added SDLTest_CommonDefaultArgs()
This is for test apps that don't need custom command line arguments; it lets us reduce the boilerplate code a tiny bit.
Diffstat (limited to 'test/testwm2.c')
-rw-r--r--test/testwm2.c17
1 files changed, 3 insertions, 14 deletions
diff --git a/test/testwm2.c b/test/testwm2.c
index 2064aa6fc..9ec867b04 100644
--- a/test/testwm2.c
+++ b/test/testwm2.c
@@ -129,21 +129,10 @@ main(int argc, char *argv[])
if (!state) {
return 1;
}
- for (i = 1; i < argc;) {
- int consumed;
- consumed = SDLTest_CommonArg(state, i);
- if (consumed == 0) {
- consumed = -1;
- }
- if (consumed < 0) {
- SDL_Log("Usage: %s %s\n", argv[0], SDLTest_CommonUsage(state));
- quit(1);
- }
- i += consumed;
- }
- if (!SDLTest_CommonInit(state)) {
- quit(2);
+ if (!SDLTest_CommonDefaultArgs(state, argc, argv) || !SDLTest_CommonInit(state)) {
+ SDLTest_CommonQuit(state);
+ return 1;
}
SDL_EventState(SDL_DROPFILE, SDL_ENABLE);