1
Fork 0
mirror of git://git.sv.gnu.org/emacs.git synced 2026-01-06 11:50:51 -08:00
emacs/mps/test/conerr/18.c
Gareth Rees 1d47d8f232 Get the mmqa test system working on windows. in detail:
1. Document how to run it on Windows from a Cygwin shell.
2. Ignore trailing spaces when analyzing test output.
3. Use the directory separator "/" since we're running under Cygwin.
4. No need for cat.exe, strings.exe, or tee.exe (these are supplied by Cygwin).
5. Microsoft Visual C/C++ needs /D_CRT_SECURE_NO_WARNINGS to avoid a warning about scanf.
6. The Microsoft Visual C/C++ linker no longer takes the options /debugtype:both or /debug:full. Replace with /debug.
7. Remove /pdb:none option (we want the PDB so that we can debug the result).
8. windows.h defines an UNALIGNED macro, so need to #undef it.
9. The long int type is 32 bits on 64-bit Windows, so we need size_t instead.
10. The values in the LPEXCEPTION_RECORD structure have type ULONG_PTR.
11. Test cases are expecting access violations to report abort=true, but on Windows they are caught by the exception handler, so report abort=true in this case.
12. mpsw3.h has gone, but we do need mpswin.h.

Fix some of the test cases:
1. Avoid compiler warning about overflowed multiplication in argerr/153.c.
2. In conerr/2.c, conerr/8.c and conerr/13.c, malloc enough space so that the signature check doesn't cause an access violation.
3. In conerr/25.c, allocate an object whose size is aligned to the platform alignment, which is 16 bytes on w3i6mv.
4. In connerr/18.c, conerr/53.c and conerr/54.c, update the location and text of the expected assertions.

Copied from Perforce
 Change: 191564
 ServerID: perforce.ravenbrook.com
2016-04-22 15:00:27 +01:00

52 lines
1 KiB
C

/*
TEST_HEADER
id = $Id$
summary = create a pool with a format in the wrong arena
language = c
link = testlib.o
OUTPUT_SPEC
assert = true
assertfile P= poolabs.c
assertcond = FormatArena(format) == arena
END_HEADER
*/
#include "testlib.h"
#include "mpsclo.h"
static void test(void)
{
mps_arena_t arena0;
mps_arena_t arena1;
mps_pool_t pool;
mps_fmt_t format;
cdie(mps_arena_create(&arena0, mps_arena_class_vm(), mmqaArenaSIZE), "create arena 0");
cdie(mps_arena_create(&arena1, mps_arena_class_vm(), mmqaArenaSIZE), "create arena 1");
cdie(
mps_fmt_create_k(&format, arena0, mps_args_none),
"create format in arena 0");
cdie(
mps_pool_create(&pool, arena1, mps_class_lo(), format),
"create pool in arena 1");
mps_pool_destroy(pool);
comment("Destroyed pool.");
mps_fmt_destroy(format);
comment("Destroyed format.");
mps_arena_destroy(arena0);
comment("Destroyed arena 0.");
mps_arena_destroy(arena1);
comment("Destroyed arena 1.");
}
int main(void)
{
easy_tramp(test);
return 0;
}