From dce00e268eb36048a729db9a2a9aebd4df0e7395 Mon Sep 17 00:00:00 2001 From: Patrik Nyblom Date: Fri, 7 May 2010 09:33:56 +0200 Subject: Add more tests and make some go easier on small systems Even more tests added to cover more error cases, some tests made easier on systems with small memories and timeouts made longer due to timetraps on solaris daily builds. --- erts/emulator/beam/erl_bif_binary.c | 17 ++++------------- 1 file changed, 4 insertions(+), 13 deletions(-) (limited to 'erts/emulator/beam') diff --git a/erts/emulator/beam/erl_bif_binary.c b/erts/emulator/beam/erl_bif_binary.c index cba17ee6eb..0a40e28474 100644 --- a/erts/emulator/beam/erl_bif_binary.c +++ b/erts/emulator/beam/erl_bif_binary.c @@ -1365,16 +1365,12 @@ static BIF_RETTYPE binary_match_trap(BIF_ALIST_3) Eterm result; Binary *bin = ((ProcBin *) binary_val(BIF_ARG_3))->val; runres = do_binary_match(BIF_P,BIF_ARG_1,0,0,NIL,bin,BIF_ARG_2,&result); - switch (runres) { - case DO_BIN_MATCH_OK: + if (runres == DO_BIN_MATCH_OK) { BIF_RET(result); - case DO_BIN_MATCH_RESTART: + } else { BUMP_ALL_REDS(BIF_P); BIF_TRAP3(&binary_match_trap_export, BIF_P, BIF_ARG_1, result, BIF_ARG_3); - default: - /* Cannot badarg in the trap */ - erl_exit(1, "Internal error in binary_match_trap."); } } @@ -1384,20 +1380,15 @@ static BIF_RETTYPE binary_matches_trap(BIF_ALIST_3) Eterm result; Binary *bin = ((ProcBin *) binary_val(BIF_ARG_3))->val; runres = do_binary_matches(BIF_P,BIF_ARG_1,0,0,NIL,bin,BIF_ARG_2,&result); - switch (runres) { - case DO_BIN_MATCH_OK: + if (runres == DO_BIN_MATCH_OK) { BIF_RET(result); - case DO_BIN_MATCH_RESTART: + } else { BUMP_ALL_REDS(BIF_P); BIF_TRAP3(&binary_matches_trap_export, BIF_P, BIF_ARG_1, result, BIF_ARG_3); - default: - /* Cannot badarg in the trap */ - erl_exit(1, "Internal error in binary_matches_trap."); } } - BIF_RETTYPE binary_match_3(BIF_ALIST_3) { Uint hsstart; -- cgit v1.2.3