From 3ddf0126dfcb60f0554e2d52187fa012f378e428 Mon Sep 17 00:00:00 2001 From: Patrik Nyblom Date: Thu, 11 Feb 2010 10:15:53 +0100 Subject: Teach {wordsize,internal|external} to system_info/1 Some test suites need to differentiate between 32-bit terms and 32-bit pointers. While at it, remove some more warnings in process.c for SMP and debug. --- erts/emulator/test/obsolete_SUITE.erl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'erts/emulator/test') diff --git a/erts/emulator/test/obsolete_SUITE.erl b/erts/emulator/test/obsolete_SUITE.erl index 33c4726699..eb7e34ad6b 100644 --- a/erts/emulator/test/obsolete_SUITE.erl +++ b/erts/emulator/test/obsolete_SUITE.erl @@ -32,9 +32,9 @@ all(doc) -> []; all(suite) -> - case catch erlang:system_info(wordsize) of + case catch erlang:system_info({wordsize,external}) of 4 -> [erl_threads]; - _ -> {skip, "Only expected to work on 32-bit architectures"} + _ -> {skip, "Only expected to work on true 32-bit architectures"} end. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -- cgit v1.2.3 From ac0b3f0a64705717d21e4a3d84d91d9c44f3baf7 Mon Sep 17 00:00:00 2001 From: Patrik Nyblom Date: Thu, 11 Feb 2010 11:00:47 +0100 Subject: Correct the VM to work for more test suites The following test suites now work: send_term_SUITE trace_nif_SUITE binary_SUITE match_spec_SUITE node_container_SUITE beam_literals_SUITE Also add a testcases for system_info({wordsize,internal|external}). --- erts/emulator/test/system_info_SUITE.erl | 24 ++++++++++++++++++++++-- 1 file changed, 22 insertions(+), 2 deletions(-) (limited to 'erts/emulator/test') diff --git a/erts/emulator/test/system_info_SUITE.erl b/erts/emulator/test/system_info_SUITE.erl index e782d2f293..ba433d4e11 100644 --- a/erts/emulator/test/system_info_SUITE.erl +++ b/erts/emulator/test/system_info_SUITE.erl @@ -35,12 +35,12 @@ %-compile(export_all). -export([all/1, init_per_testcase/2, fin_per_testcase/2]). --export([process_count/1, system_version/1, misc_smoke_tests/1, heap_size/1]). +-export([process_count/1, system_version/1, misc_smoke_tests/1, heap_size/1, wordsize/1]). -define(DEFAULT_TIMEOUT, ?t:minutes(2)). all(doc) -> []; -all(suite) -> [process_count, system_version, misc_smoke_tests, heap_size]. +all(suite) -> [process_count, system_version, misc_smoke_tests, heap_size, wordsize]. init_per_testcase(_Case, Config) when is_list(Config) -> Dog = ?t:timetrap(?DEFAULT_TIMEOUT), @@ -145,3 +145,23 @@ heap_size(Config) when is_list(Config) -> ?line Hmin = proplists:get_value(min_heap_size, GCinf), ok. +wordsize(suite) -> + []; +wordsize(doc) -> + ["Tests the various wordsize variants"]; +wordsize(Config) when is_list(Config) -> + ?line A = erlang:system_info(wordsize), + ?line true = is_integer(A), + ?line A = erlang:system_info({wordsize,internal}), + ?line B = erlang:system_info({wordsize,external}), + ?line true = A =< B, + case {B,A} of + {4,4} -> + {comment, "True 32-bit emulator"}; + {8,8} -> + {comment, "True 64-bit emulator"}; + {8,4} -> + {comment, "Halfword 64-bit emulator"}; + Other -> + exit({unexpected_wordsizes,Other}) + end. -- cgit v1.2.3 From 24095d93fb28bdd60abe771a426e39c6ff0f72c7 Mon Sep 17 00:00:00 2001 From: Patrik Nyblom Date: Fri, 12 Mar 2010 16:09:26 +0100 Subject: Teach testcase in driver_suite the new prototype for driver_async The testcase core dunmped. Also made sure the key could actually store long integers in driver_async (which is more of a cosmetic change). --- erts/emulator/test/driver_SUITE_data/peek_non_existing_queue_drv.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'erts/emulator/test') diff --git a/erts/emulator/test/driver_SUITE_data/peek_non_existing_queue_drv.c b/erts/emulator/test/driver_SUITE_data/peek_non_existing_queue_drv.c index f429a5b51e..2ac86b1ec2 100644 --- a/erts/emulator/test/driver_SUITE_data/peek_non_existing_queue_drv.c +++ b/erts/emulator/test/driver_SUITE_data/peek_non_existing_queue_drv.c @@ -127,7 +127,7 @@ static int control(ErlDrvData drv_data, char **rbuf, int rlen) { PeekNonXQDrvData *dp = (PeekNonXQDrvData *) drv_data; - unsigned int key = 0; + unsigned long key = 0; char *res_str = "ok"; ErlDrvSysInfo si; driver_system_info(&si, sizeof(ErlDrvSysInfo)); -- cgit v1.2.3