comparison test/dynload_plain/dynload_plain.c @ 410:7608e34098b0

- cleanups, simplifications, some api clarification, ... - test cases consistency: * return status code depending on test results (for actual conformance tests, not stuff that is not an example or hack to check something, ..) * platform init helper added for some
author Tassilo Philipp
date Tue, 05 Oct 2021 21:53:04 +0200
parents dd5d03483314
children
comparison
equal deleted inserted replaced
409:15698dc0cba3 410:7608e34098b0
4 Library: test 4 Library: test
5 File: test/dynload_plain/dynload_plain.c 5 File: test/dynload_plain/dynload_plain.c
6 Description: 6 Description:
7 License: 7 License:
8 8
9 Copyright (c) 2017-2018 Tassilo Philipp <tphilipp@potion-studios.com> 9 Copyright (c) 2017-2021 Tassilo Philipp <tphilipp@potion-studios.com>
10 10
11 Permission to use, copy, modify, and distribute this software for any 11 Permission to use, copy, modify, and distribute this software for any
12 purpose with or without fee is hereby granted, provided that the above 12 purpose with or without fee is hereby granted, provided that the above
13 copyright notice and this permission notice appear in all copies. 13 copyright notice and this permission notice appear in all copies.
14 14
23 */ 23 */
24 24
25 25
26 #include "../../dynload/dynload.h" 26 #include "../../dynload/dynload.h"
27 #include "../common/platformInit.h" 27 #include "../common/platformInit.h"
28 #include "../common/platformInit.c" /* Impl. for functions only used in this translation unit */
28 29
29 #include <string.h> 30 #include <string.h>
30 #include <sys/stat.h> 31 #include <sys/stat.h>
31 #if defined(DC_WINDOWS) 32 #if defined(DC_WINDOWS)
32 # include <io.h> 33 # include <io.h>
86 "\\ReactOS\\system32\\msvcrt.dll", /* ReactOS */ 87 "\\ReactOS\\system32\\msvcrt.dll", /* ReactOS */
87 "C:\\ReactOS\\system32\\msvcrt.dll", 88 "C:\\ReactOS\\system32\\msvcrt.dll",
88 "\\Windows\\system32\\msvcrt.dll", /* Windows */ 89 "\\Windows\\system32\\msvcrt.dll", /* Windows */
89 "C:\\Windows\\system32\\msvcrt.dll" 90 "C:\\Windows\\system32\\msvcrt.dll"
90 }; 91 };
92
93 dcTest_initPlatform();
91 94
92 /* use first matching path of hacky hardcoded list, above */ 95 /* use first matching path of hacky hardcoded list, above */
93 for(i=0; i<(sizeof(clibs)/sizeof(const char*)); ++i) { 96 for(i=0; i<(sizeof(clibs)/sizeof(const char*)); ++i) {
94 if(access(clibs[i], F_OK) != -1) { 97 if(access(clibs[i], F_OK) != -1) {
95 path = clibs[i]; 98 path = clibs[i];
278 } 281 }
279 282
280 /* Check final score of right ones to see if all worked */ 283 /* Check final score of right ones to see if all worked */
281 r = (r == 16 + cmp_inode); 284 r = (r == 16 + cmp_inode);
282 printf("result: dynload_plain: %d\n", r); 285 printf("result: dynload_plain: %d\n", r);
286
287 dcTest_deInitPlatform();
288
283 return !r; 289 return !r;
284 } 290 }
285 291