comparison test/malloc_wx/test_wx.c @ 251:3f7c69fadfc3

- regression fix for changing writable to executable memory for platforms where mmap has no MAP_ANON (usually older platforms, e.g. solaris 7)
author Tassilo Philipp
date Sun, 14 May 2017 02:26:21 +0200
parents 3999750fae28
children f5577f6bf97a
comparison
equal deleted inserted replaced
250:7cb8a0aaf638 251:3f7c69fadfc3
4 Library: test 4 Library: test
5 File: test/malloc_wx/test_wx.c 5 File: test/malloc_wx/test_wx.c
6 Description: 6 Description:
7 License: 7 License:
8 8
9 Copyright (c) 2007-2015 Daniel Adler <dadler@uni-goettingen.de>, 9 Copyright (c) 2007-2017 Daniel Adler <dadler@uni-goettingen.de>,
10 Tassilo Philipp <tphilipp@potion-studios.com> 10 Tassilo Philipp <tphilipp@potion-studios.com>
11 11
12 Permission to use, copy, modify, and distribute this software for any 12 Permission to use, copy, modify, and distribute this software for any
13 purpose with or without fee is hereby granted, provided that the above 13 purpose with or without fee is hereby granted, provided that the above
14 copyright notice and this permission notice appear in all copies. 14 copyright notice and this permission notice appear in all copies.
35 int err; 35 int err;
36 void* ptr; 36 void* ptr;
37 dcTest_initPlatform(); 37 dcTest_initPlatform();
38 38
39 err = dcAllocWX(23, &ptr); 39 err = dcAllocWX(23, &ptr);
40 if(!err) err = dcInitExecWX(ptr, 23); 40 if(!err) {
41 if(!err) dcFreeWX(ptr, 23); 41 err = dcInitExecWX(ptr, 23);
42 dcFreeWX(ptr, 23);
43 }
42 printf("result: test_alloc_wx: %d\n", (!err) ? 1 : 0 ); 44 printf("result: test_alloc_wx: %d\n", (!err) ? 1 : 0 );
43 45
44 dcTest_deInitPlatform(); 46 dcTest_deInitPlatform();
45 47
46 return err; 48 return err;