Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
home:Ledest:erlang:24
erlang
2274-erts-Improve-nif_SUITE-neg.patch
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File 2274-erts-Improve-nif_SUITE-neg.patch of Package erlang
From 5aaf03795c1c7a59a1826020f7b1d298d1e919dc Mon Sep 17 00:00:00 2001 From: Sverker Eriksson <sverker@erlang.org> Date: Thu, 11 Nov 2021 23:39:03 +0100 Subject: [PATCH 4/8] erts: Improve nif_SUITE:neg --- erts/emulator/test/nif_SUITE.erl | 6 ++++-- erts/emulator/test/nif_SUITE_data/Makefile.src | 2 ++ erts/emulator/test/nif_SUITE_data/nif_mod.4.c | 2 ++ erts/emulator/test/nif_SUITE_data/nif_mod.5.c | 2 ++ erts/emulator/test/nif_SUITE_data/nif_mod.c | 7 +++++++ 5 files changed, 17 insertions(+), 2 deletions(-) create mode 100644 erts/emulator/test/nif_SUITE_data/nif_mod.4.c create mode 100644 erts/emulator/test/nif_SUITE_data/nif_mod.5.c diff --git a/erts/emulator/test/nif_SUITE.erl b/erts/emulator/test/nif_SUITE.erl index 6629fc3cce..a0d36a8791 100644 --- a/erts/emulator/test/nif_SUITE.erl +++ b/erts/emulator/test/nif_SUITE.erl @@ -2505,8 +2505,10 @@ neg(Config) when is_list(Config) -> {ok,nif_mod,Bin} = compile:file(File, [binary,return_errors]), {module,nif_mod} = erlang:load_module(nif_mod,Bin), - {error,{load_failed,_}} = nif_mod:load_nif_lib(Config, 0), - {error,{bad_lib,_}} = nif_mod:load_nif_lib(Config, no_init), + {error,{load_failed,"Failed to load NIF library"++_}} = nif_mod:load_nif_lib(Config, 0), + {error,{bad_lib,"Failed to find library init"++_}} = nif_mod:load_nif_lib(Config, 3), + {error,{bad_lib,"Function not found"++_}} = nif_mod:load_nif_lib(Config, 4), + {error,{bad_lib,"Duplicate NIF entry for"++_}} = nif_mod:load_nif_lib(Config, 5), verify_tmpmem(TmpMem), ok. diff --git a/erts/emulator/test/nif_SUITE_data/Makefile.src b/erts/emulator/test/nif_SUITE_data/Makefile.src index 69dd2d6757..ebbdfe5315 100644 --- a/erts/emulator/test/nif_SUITE_data/Makefile.src +++ b/erts/emulator/test/nif_SUITE_data/Makefile.src @@ -3,6 +3,8 @@ NIF_LIBS = nif_SUITE.1@dll@ \ nif_mod.1@dll@ \ nif_mod.2@dll@ \ nif_mod.3@dll@ \ + nif_mod.4@dll@ \ + nif_mod.5@dll@ \ nif_mod.1.2_0@dll@ \ nif_mod.2.2_0@dll@ \ nif_mod.3.2_0@dll@ \ diff --git a/erts/emulator/test/nif_SUITE_data/nif_mod.4.c b/erts/emulator/test/nif_SUITE_data/nif_mod.4.c new file mode 100644 index 0000000000..78ede3fbec --- /dev/null +++ b/erts/emulator/test/nif_SUITE_data/nif_mod.4.c @@ -0,0 +1,2 @@ +#define NIF_LIB_VER 4 +#include "nif_mod.c" diff --git a/erts/emulator/test/nif_SUITE_data/nif_mod.5.c b/erts/emulator/test/nif_SUITE_data/nif_mod.5.c new file mode 100644 index 0000000000..ea6ab1a07b --- /dev/null +++ b/erts/emulator/test/nif_SUITE_data/nif_mod.5.c @@ -0,0 +1,2 @@ +#define NIF_LIB_VER 5 +#include "nif_mod.c" diff --git a/erts/emulator/test/nif_SUITE_data/nif_mod.c b/erts/emulator/test/nif_SUITE_data/nif_mod.c index edc2a7aac5..6aea107513 100644 --- a/erts/emulator/test/nif_SUITE_data/nif_mod.c +++ b/erts/emulator/test/nif_SUITE_data/nif_mod.c @@ -391,6 +391,13 @@ static ErlNifFunc nif_funcs[] = #ifdef HAVE_ENIF_MONITOR_PROCESS {"monitor_process", 3, monitor_process}, #endif +#if NIF_LIB_VER == 4 + {"non_existing", 2, get_resource}, /* error: not found */ +#endif +#if NIF_LIB_VER == 5 + {"make_new_resource", 2, get_resource}, /* error: duplicate */ +#endif + /* Keep lib_version_check last to maximize the loading "patch distance" between it and lib_version */ {"lib_version_check", 0, lib_version} -- 2.31.1
Locations
Projects
Search
Status Monitor
Help
OpenBuildService.org
Documentation
API Documentation
Code of Conduct
Contact
Support
@OBShq
Terms
openSUSE Build Service is sponsored by
The Open Build Service is an
openSUSE project
.
Sign Up
Log In
Places
Places
All Projects
Status Monitor