From 256391d4f9b7425fd96b5b9f344b212751bdfda2 Mon Sep 17 00:00:00 2001 From: Lukas Larsson Date: Thu, 30 Jun 2011 14:33:28 +0200 Subject: Added enif_get_reverse_list to nif API --- erts/emulator/test/nif_SUITE.erl | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) (limited to 'erts/emulator/test/nif_SUITE.erl') diff --git a/erts/emulator/test/nif_SUITE.erl b/erts/emulator/test/nif_SUITE.erl index 91d695d979..813ed65f4b 100644 --- a/erts/emulator/test/nif_SUITE.erl +++ b/erts/emulator/test/nif_SUITE.erl @@ -35,7 +35,7 @@ resource_takeover/1, threading/1, send/1, send2/1, send3/1, send_threaded/1, neg/1, is_checks/1, - get_length/1, make_atom/1, make_string/1]). + get_length/1, make_atom/1, make_string/1, reverse_list_test/1]). -export([many_args_100/100]). @@ -60,7 +60,7 @@ all() -> iolist_as_binary, resource, resource_binary, resource_takeover, threading, send, send2, send3, send_threaded, neg, is_checks, get_length, make_atom, - make_string]. + make_string,reverse_list_test]. groups() -> []. @@ -1164,6 +1164,13 @@ make_string(Config) when is_list(Config) -> AStringWithAccents = [$E,$r,$l,$a,$n,$g,$ ,16#e4,$r,$ ,$e,$t,$t,$ ,$g,$e,$n,$e,$r,$e,$l,$l,$t,$ ,$p,$r,$o,$g,$r,$a,$m,$s,$p,$r,16#e5,$k], ?line Strings = {A0String,A0String,A0String,A0String0, AStringWithAccents}. +reverse_list_test(Config) -> + ?line ensure_lib_loaded(Config, 1), + List = lists:seq(1,100), + RevList = lists:reverse(List), + ?line RevList = reverse_list(List), + badarg = reverse_list(foo). + tmpmem() -> case erlang:system_info({allocator,temp_alloc}) of false -> undefined; @@ -1269,6 +1276,7 @@ send_blob_thread(_,_,_) -> ?nif_stub. join_send_thread(_) -> ?nif_stub. copy_blob(_) -> ?nif_stub. send_term(_,_) -> ?nif_stub. +reverse_list(_) -> ?nif_stub. nif_stub_error(Line) -> exit({nif_not_loaded,module,?MODULE,line,Line}). -- cgit v1.2.3 From 406460b546ae014d335b4b5f6b011ce3fbf26e5c Mon Sep 17 00:00:00 2001 From: Lukas Larsson Date: Fri, 1 Jul 2011 10:21:03 +0200 Subject: Rename enif_get_reverse_list to enif_make_reverse_list --- erts/emulator/test/nif_SUITE.erl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'erts/emulator/test/nif_SUITE.erl') diff --git a/erts/emulator/test/nif_SUITE.erl b/erts/emulator/test/nif_SUITE.erl index 813ed65f4b..3bc4ad610f 100644 --- a/erts/emulator/test/nif_SUITE.erl +++ b/erts/emulator/test/nif_SUITE.erl @@ -1169,7 +1169,7 @@ reverse_list_test(Config) -> List = lists:seq(1,100), RevList = lists:reverse(List), ?line RevList = reverse_list(List), - badarg = reverse_list(foo). + ?line badarg = reverse_list(foo). tmpmem() -> case erlang:system_info({allocator,temp_alloc}) of -- cgit v1.2.3