Mercurial > pub > dyncall > dyncall
diff test/resolve_self/main.c @ 214:0592eb360af2
tests:
- added dynload_plain test
- added some more output to resolv_self
- cleanups
author | Tassilo Philipp |
---|---|
date | Thu, 06 Apr 2017 02:13:57 +0200 |
parents | 3e629dc19168 |
children | 318a9ffc2b85 |
line wrap: on
line diff
--- a/test/resolve_self/main.c Tue Mar 28 15:45:20 2017 +0200 +++ b/test/resolve_self/main.c Thu Apr 06 02:13:57 2017 +0200 @@ -6,7 +6,7 @@ Description: License: - Copyright (c) 2011-2015 Daniel Adler <dadler@uni-goettingen.de>, + Copyright (c) 2011-2017 Daniel Adler <dadler@uni-goettingen.de>, Tassilo Philipp <tphilipp@potion-studios.com> Permission to use, copy, modify, and distribute this software for any @@ -48,11 +48,17 @@ int status; DLLib* pLib = dlLoadLibrary(NULL); assert(pLib); + printf("self loaded at %p\n", pLib); address = dlFindSymbol(pLib, "add_dd_d"); - assert(address); - result = ( (double (*) (double,double) ) address ) (20.0, 3.0); - status = (result == 23); + if(address) { + printf("address of function add_dd_d at %p\n", address); + result = ( (double (*) (double,double) ) address ) (20.0, 3.0); + status = (result == 23); + } else { + printf("can't resolve address of add_dd_d, it doesn't seem to be a *dynamic* symbol\n"); + status = 0; + } printf("result: resolve_self: %d\n", status); return 0; }