File 1983-Fix-tests-failing-due-to-new-warnings.patch of Package erlang

From 9f24166cf79d64ae8cf9faeed1b0cc5d0ee95024 Mon Sep 17 00:00:00 2001
From: Richard Carlsson <carlsson.richard@gmail.com>
Date: Tue, 2 Dec 2025 11:33:01 +0100
Subject: [PATCH 3/3] Fix tests failing due to new warnings

---
 lib/asn1/test/asn1_SUITE.erl         | 2 ++
 lib/asn1/test/asn1_app_SUITE.erl     | 2 ++
 lib/asn1/test/asn1_test_lib.erl      | 2 +-
 lib/asn1/test/testChoPrim.erl        | 2 ++
 lib/asn1/test/testEnumExt.erl        | 2 ++
 lib/asn1/test/testInfObj.erl         | 2 ++
 lib/compiler/test/warnings_SUITE.erl | 6 +++---
 lib/observer/test/Makefile           | 3 ++-
 lib/stdlib/test/erl_lint_SUITE.erl   | 8 ++++----
 lib/stdlib/test/qlc_SUITE.erl        | 2 +-
 10 files changed, 21 insertions(+), 10 deletions(-)

diff --git a/lib/asn1/test/asn1_SUITE.erl b/lib/asn1/test/asn1_SUITE.erl
index 151d776c53..39d2129671 100644
--- a/lib/asn1/test/asn1_SUITE.erl
+++ b/lib/asn1/test/asn1_SUITE.erl
@@ -23,6 +23,8 @@
 
 -module(asn1_SUITE).
 
+-compile(nowarn_deprecated_catch).
+
 %% Suppress compilation of an addititional module compiled for maps.
 -define(NO_MAPS_MODULE, asn1_test_lib_no_maps).
 
diff --git a/lib/asn1/test/asn1_app_SUITE.erl b/lib/asn1/test/asn1_app_SUITE.erl
index 98694cb8a9..ca153e38d8 100644
--- a/lib/asn1/test/asn1_app_SUITE.erl
+++ b/lib/asn1/test/asn1_app_SUITE.erl
@@ -28,6 +28,8 @@
          init_per_suite/1,end_per_suite/1,
          appup/1,fields/1,modules/1,export_all/1,app_depend/1]).
 
+-compile(nowarn_deprecated_catch).
+
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 
 all() ->
diff --git a/lib/asn1/test/asn1_test_lib.erl b/lib/asn1/test/asn1_test_lib.erl
index aad7f57a6e..ef6e5841a4 100644
--- a/lib/asn1/test/asn1_test_lib.erl
+++ b/lib/asn1/test/asn1_test_lib.erl
@@ -39,7 +39,7 @@ compile(File, Config, Options) -> compile_all([File], Config, Options).
 compile_all(Files, Config, Options0) ->
     DataDir = proplists:get_value(data_dir, Config),
     CaseDir = proplists:get_value(case_dir, Config),
-    Options = [{outdir,CaseDir},debug_info|Options0],
+    Options = [{outdir,CaseDir},debug_info,nowarn_deprecated_catch|Options0],
 
     Comp = fun(F) ->
 		   compile_file(filename:join(DataDir, F), Options)
diff --git a/lib/asn1/test/testChoPrim.erl b/lib/asn1/test/testChoPrim.erl
index fd4c110f92..809af46514 100644
--- a/lib/asn1/test/testChoPrim.erl
+++ b/lib/asn1/test/testChoPrim.erl
@@ -27,6 +27,8 @@
 
 -include_lib("common_test/include/ct.hrl").
 
+-compile(nowarn_deprecated_catch).
+
 bool(Rules) ->
     roundtrip('ChoCon', {bool0,true}),
     roundtrip('ChoCon', {bool1,true}),
diff --git a/lib/asn1/test/testEnumExt.erl b/lib/asn1/test/testEnumExt.erl
index ba37037dcd..ef1074034a 100644
--- a/lib/asn1/test/testEnumExt.erl
+++ b/lib/asn1/test/testEnumExt.erl
@@ -26,6 +26,8 @@
 
 -include_lib("common_test/include/ct.hrl").
 
+-compile(nowarn_deprecated_catch).
+
 main(Rule) when Rule =:= per; Rule =:= uper ->
     io:format("main(~p)~n",[Rule]),
 
diff --git a/lib/asn1/test/testInfObj.erl b/lib/asn1/test/testInfObj.erl
index 134cf17e4f..73ca060423 100644
--- a/lib/asn1/test/testInfObj.erl
+++ b/lib/asn1/test/testInfObj.erl
@@ -25,6 +25,8 @@
 
 -export([main/1]).
 
+-compile(nowarn_deprecated_catch).
+
 -record('InitiatingMessage',{procedureCode,criticality,value}).
 -record('InitiatingMessage2',{procedureCode,criticality,value}).
 -record('Iu-ReleaseCommand',{first,second}).
diff --git a/lib/compiler/test/warnings_SUITE.erl b/lib/compiler/test/warnings_SUITE.erl
index 2c4766b0e6..5fa0e18891 100644
--- a/lib/compiler/test/warnings_SUITE.erl
+++ b/lib/compiler/test/warnings_SUITE.erl
@@ -731,7 +731,7 @@ maps(Config) when is_list(Config) ->
                  {'EXIT',{badarg,_}} = (catch(M#{ a => 1 })),
                  ok.
            ">>,
-           [],
+           [nowarn_deprecated_catch],
            {warnings,[{{4,48},sys_core_fold,{failed,bad_map_update}}]}},
 	   {bad_map_src2,
            <<"
@@ -741,7 +741,7 @@ maps(Config) when is_list(Config) ->
 		 ok.
 	     id(I) -> I.
            ">>,
-	   [inline],
+	   [inline,nowarn_deprecated_catch],
 	    []},
 	   {bad_map_src3,
            <<"
@@ -749,7 +749,7 @@ maps(Config) when is_list(Config) ->
                  {'EXIT',{badarg,_}} = (catch <<>>#{ a := 1}),
                  ok.
            ">>,
-           [],
+           [nowarn_deprecated_catch],
            {warnings,[{{3,51},sys_core_fold,{failed,bad_map_update}}]}},
            {ok_map_literal_key,
            <<"
diff --git a/lib/observer/test/Makefile b/lib/observer/test/Makefile
index c576d42a0e..d165fb44c0 100644
--- a/lib/observer/test/Makefile
+++ b/lib/observer/test/Makefile
@@ -64,7 +64,8 @@ RELSYSDIR = $(RELEASE_PATH)/observer_test
 # FLAGS
 # ----------------------------------------------------
 ERL_MAKE_FLAGS +=
-ERL_COMPILE_FLAGS += +warnings_as_errors +nowarn_export_all +nowarn_missing_spec_documented
+ERL_COMPILE_FLAGS += +warnings_as_errors +nowarn_export_all +nowarn_missing_spec_documented +nowarn_deprecated_catch
+
 ERL_COMPILE_FLAGS := $(filter-out +deterministic,$(ERL_COMPILE_FLAGS))
 
 EBIN = .
diff --git a/lib/stdlib/test/erl_lint_SUITE.erl b/lib/stdlib/test/erl_lint_SUITE.erl
index b1fc026c91..c7d7a7a753 100644
--- a/lib/stdlib/test/erl_lint_SUITE.erl
+++ b/lib/stdlib/test/erl_lint_SUITE.erl
@@ -790,7 +790,7 @@ unused_unsafe_vars_warn(Config) when is_list(Config) ->
                   _ = case ok of _ -> fun() -> ok end end,
                   fun (X) -> X end.
            ">>,
-           [warn_unused_vars],
+           [warn_unused_vars,nowarn_deprecated_catch],
            []}],
     run(Config, Ts),
     ok.
@@ -912,7 +912,7 @@ shadow_vars(Config) when is_list(Config) ->
                   _ = case ok of _ -> fun() -> ok end end,
                   fun (MS) -> MS end. % MS not shadowed here
            ">>,
-           [],
+           [nowarn_deprecated_catch],
            []}],
     [] = run(Config, Ts),
     ok.
@@ -1374,7 +1374,7 @@ unsafe_vars(Config) when is_list(Config) ->
                   case X of _ -> catch _Y = 1 end,
                   _Y."
            >>,
-           [],
+           [nowarn_deprecated_catch],
            {errors,[{{3,19},erl_lint,{unsafe_var,'_Y',{'catch',{2,34}}}}],
             []}},
            {unsafe9,
@@ -1403,7 +1403,7 @@ unsafe_vars(Config) when is_list(Config) ->
                   end,
                   {A,B,C,D}."
            >>,
-           [],
+           [nowarn_deprecated_catch],
            {errors,[{{24,20},erl_lint,{unsafe_var,'A',{'catch',{4,27}}}},
                     {{24,22},erl_lint,{unsafe_var,'B',{'case',{2,19}}}},
                     {{24,26},erl_lint,{unsafe_var,'D',{'case',{2,19}}}}],
diff --git a/lib/stdlib/test/qlc_SUITE.erl b/lib/stdlib/test/qlc_SUITE.erl
index 55e8426775..560407e2ef 100644
--- a/lib/stdlib/test/qlc_SUITE.erl
+++ b/lib/stdlib/test/qlc_SUITE.erl
@@ -8014,7 +8014,7 @@ compile_file(Config, Test0, Opts0) ->
                            "-import(qlc_SUITE, [lookup_keys/1]). "
                            "-include_lib(\"stdlib/include/qlc.hrl\"). ",
                            Test0]),
-    Opts = [export_all,nowarn_export_all,return,nowarn_unused_record,{outdir,?privdir}|Opts0],
+    Opts = [export_all,nowarn_export_all,return,nowarn_unused_record,nowarn_deprecated_catch,{outdir,?privdir}|Opts0],
     ok = file:write_file(File, Test),
     case compile:file(File, Opts) of
         {ok, _M, Ws} -> warnings(File, Ws);
-- 
2.51.0

openSUSE Build Service is sponsored by