diff options
author | Sverker Eriksson <[email protected]> | 2016-12-16 16:26:08 +0100 |
---|---|---|
committer | Sverker Eriksson <[email protected]> | 2016-12-19 19:18:57 +0100 |
commit | 861b276f27952ecbb5a89748b86b7513946617f3 (patch) | |
tree | 530589c1951e1c352bfe0adcc4e66f2e5a829a12 /erts/emulator/test/nif_SUITE.erl | |
parent | 387ff8e3347d21e9ca5ad3d8c3a694bc79d38bca (diff) | |
download | otp-861b276f27952ecbb5a89748b86b7513946617f3.tar.gz otp-861b276f27952ecbb5a89748b86b7513946617f3.tar.bz2 otp-861b276f27952ecbb5a89748b86b7513946617f3.zip |
nif_SUITE: Add last_fd_stop_call
Diffstat (limited to 'erts/emulator/test/nif_SUITE.erl')
-rw-r--r-- | erts/emulator/test/nif_SUITE.erl | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/erts/emulator/test/nif_SUITE.erl b/erts/emulator/test/nif_SUITE.erl index 2401ff708c..c2429c3405 100644 --- a/erts/emulator/test/nif_SUITE.erl +++ b/erts/emulator/test/nif_SUITE.erl @@ -444,7 +444,7 @@ select(Config) when is_list(Config) -> ensure_lib_loaded(Config), Ref = make_ref(), - {R,W} = pipe_nif(), + {{R, R_ptr}, {W, W_ptr}} = pipe_nif(), ok = write_nif(W, <<"hej">>), <<"hej">> = read_nif(R, 3), @@ -472,6 +472,7 @@ select(Config) when is_list(Config) -> eagain = read_nif(R, 1), 0 = select_nif(W,?ERL_NIF_SELECT_STOP,W,Ref), timer:sleep(10), + {1, {W_ptr,_}} = last_fd_stop_call(), true = is_closed_nif(W), [] = flush(), 0 = select_nif(R,?ERL_NIF_SELECT_READ,R,Ref), @@ -480,6 +481,7 @@ select(Config) when is_list(Config) -> 0 = select_nif(R,?ERL_NIF_SELECT_STOP,R,Ref), timer:sleep(10), + {1, {R_ptr,_}} = last_fd_stop_call(), true = is_closed_nif(R), select_2(Config). @@ -490,7 +492,7 @@ select_2(Config) -> Ref1 = make_ref(), Ref2 = make_ref(), - {R,W} = pipe_nif(), + {{R, R_ptr}, {W, W_ptr}} = pipe_nif(), %% Change ref eagain = read_nif(R, 1), @@ -520,9 +522,13 @@ select_2(Config) -> [] = flush(), 0 = select_nif(R,?ERL_NIF_SELECT_STOP,R,Ref1), - 0 = select_nif(W,?ERL_NIF_SELECT_STOP,W,Ref1), timer:sleep(10), + {1, {R_ptr,_}} = last_fd_stop_call(), true = is_closed_nif(R), + + 0 = select_nif(W,?ERL_NIF_SELECT_STOP,W,Ref1), + timer:sleep(10), + {1, {W_ptr,1}} = last_fd_stop_call(), true = is_closed_nif(W), select_3(Config). @@ -2397,6 +2403,7 @@ pipe_nif() -> ?nif_stub. write_nif(_,_) -> ?nif_stub. read_nif(_,_) -> ?nif_stub. is_closed_nif(_) -> ?nif_stub. +last_fd_stop_call() -> ?nif_stub. %% maps is_map_nif(_) -> ?nif_stub. |