diff options
author | Jon Turney <jon.turney@dronecode.org.uk> | 2018-06-07 18:00:18 +0100 |
---|---|---|
committer | Jon Turney <jon.turney@dronecode.org.uk> | 2018-06-11 11:49:12 +0100 |
commit | 4bc6b68bae3a11d9a77ac5511d3dd54aa2d9ff3b (patch) | |
tree | f004501f83c105669d5434c7fec5df674fd64eac | |
parent | 80ce5e08171bcc163b961bf1ce695b9d1e93ca10 (diff) | |
download | meson-4bc6b68bae3a11d9a77ac5511d3dd54aa2d9ff3b.tar.gz |
Also test that the resource has the expected contents
-rw-r--r-- | test cases/windows/16 resource scripts with duplicate filenames/meson.build | 15 | ||||
-rw-r--r-- | test cases/windows/16 resource scripts with duplicate filenames/verify.c | 23 |
2 files changed, 32 insertions, 6 deletions
diff --git a/test cases/windows/16 resource scripts with duplicate filenames/meson.build b/test cases/windows/16 resource scripts with duplicate filenames/meson.build index ec6d98d82..4073a8e7c 100644 --- a/test cases/windows/16 resource scripts with duplicate filenames/meson.build +++ b/test cases/windows/16 resource scripts with duplicate filenames/meson.build @@ -8,9 +8,12 @@ subdir('c') main = win.compile_resources('rsrc.rc') -# these make the resource compilation a dependency of something which is built -# by default -static_library('libmain', main) -static_library('liba', a) -static_library('libb', b) -static_library('libc', c) +testa = executable('testa', 'verify.c', a) +testb = executable('testb', 'verify.c', b) +testc = executable('testc', 'verify.c', c) +testmain = executable('testmain', 'verify.c', main) + +test('a', testa, args: 'a') +test('b', testb, args: 'b') +test('c', testc, args: 'c') +test('main', testmain, args: 'main') diff --git a/test cases/windows/16 resource scripts with duplicate filenames/verify.c b/test cases/windows/16 resource scripts with duplicate filenames/verify.c new file mode 100644 index 000000000..4d2ccf028 --- /dev/null +++ b/test cases/windows/16 resource scripts with duplicate filenames/verify.c @@ -0,0 +1,23 @@ +#include <assert.h> +#include <windows.h> + +int main(int arc, char *argv[]) +{ + // verify that the expected resource exists and has the expected contents + HRSRC hRsrc; + unsigned int size; + HGLOBAL hGlobal; + void* data; + + hRsrc = FindResource(NULL, argv[1], RT_RCDATA); + assert(hRsrc); + + size = SizeofResource(NULL, hRsrc); + hGlobal = LoadResource(NULL, hRsrc); + data = LockResource(hGlobal); + + assert(size == strlen(argv[1])); + assert(memcmp(data, argv[1], size) == 0); + + return 0; +} |