File 6683-tools-Fix-hprof-tests-on-32-bits.patch of Package erlang

From f598451fe21ae2e39698f944011526c6ca6d8ab6 Mon Sep 17 00:00:00 2001
From: Lukas Larsson <lukas@erlang.org>
Date: Mon, 18 Sep 2023 13:00:49 +0200
Subject: [PATCH] tools: Fix hprof tests on 32-bits

---
 lib/tools/test/hprof_SUITE.erl | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)

diff --git a/lib/tools/test/hprof_SUITE.erl b/lib/tools/test/hprof_SUITE.erl
index 674d8a6cc3..76db59b894 100644
--- a/lib/tools/test/hprof_SUITE.erl
+++ b/lib/tools/test/hprof_SUITE.erl
@@ -132,10 +132,16 @@ set_on_spawn(Config) when is_list(Config) ->
     %% only 1 process must be there
     ?assertEqual(1, maps:size(hprof:inspect(Profile)), {set_on_spawn, Profile}),
     %% check per-process stats
-    ?assertMatch({?MODULE, {_, 0}, 1, 9, 9, _}, lists:keyfind(?MODULE, 1, TotalProfile)),
+    case erlang:system_info(wordsize) of
+        8 -> ?assertMatch({?MODULE, {_, 0}, 1, 9, 9, _}, lists:keyfind(?MODULE, 1, TotalProfile));
+        4 -> ?assertMatch({?MODULE, {_, 0}, 1, 10, 10, _}, lists:keyfind(?MODULE, 1, TotalProfile))
+    end,
     %% MFA takes 6 more words. This test should be improved to depend less on the internal
     %%  implementation.
-    ?assertMatch({?MODULE, {seq, 1}, 1, 13, 13, _}, lists:keyfind(?MODULE, 1, TotalProfileMFA)).
+    case erlang:system_info(wordsize) of
+        8 -> ?assertMatch({?MODULE, {seq, 1}, 1, 13, 13, _}, lists:keyfind(?MODULE, 1, TotalProfileMFA));
+        4 -> ?assertMatch({?MODULE, {seq, 1}, 1, 14, 14, _}, lists:keyfind(?MODULE, 1, TotalProfileMFA))
+    end.
 
 seq(Max) ->
     {Pid, MRef} = spawn_monitor(fun () -> lists:seq(1, Max) end),
-- 
2.35.3

openSUSE Build Service is sponsored by