From 916b54792dcf564293869175ec1eec149d996a3f Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?St=C3=A9phane=20Adjemian=20=28Charybdis=29?=
 <stepan@adjemian.eu>
Date: Fri, 4 Oct 2024 12:51:05 +0200
Subject: [PATCH] Reset seed in each unit test.
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

⇒ Generated pseudo-random numbers will not change if we add new unit tests.
---
 matlab/missing/stats/gamrnd.m | 14 +++++++-------
 matlab/utilities/tests        |  2 +-
 tests/run_all_unit_tests.m    |  2 --
 3 files changed, 8 insertions(+), 10 deletions(-)

diff --git a/matlab/missing/stats/gamrnd.m b/matlab/missing/stats/gamrnd.m
index c4a77281d..f3021ec38 100644
--- a/matlab/missing/stats/gamrnd.m
+++ b/matlab/missing/stats/gamrnd.m
@@ -210,7 +210,7 @@ end
 if ~isoctave && ~user_has_matlab_license('statistics_toolbox')
     method = struct('small', 'Berman', 'large', 'Knuth');
     n = 1000000;
-    m = 1;
+    m = 3;
     a = 0.1;
     b = 1.0;
     try
@@ -287,7 +287,7 @@ end
 %@test:5
 if ~isoctave && ~user_has_matlab_license('statistics_toolbox')
     method = struct('small', 'Best', 'large', 'Knuth');
-    n = 10000000;
+    n = 1000000;
     m = 1;
     a = 0.1;
     b = 1.0;
@@ -326,8 +326,8 @@ end
 %@test:6
 if ~isoctave && ~user_has_matlab_license('statistics_toolbox')
     method = struct('small', 'Weibull-rejection', 'large', 'Knuth');
-    n = 10000000;
-    m = 1;
+    n = 1000000;
+    m = 3;
     a = 1.5;
     b = 1.0;
     try
@@ -365,7 +365,7 @@ end
 %@test:7
 if ~isoctave && ~user_has_matlab_license('statistics_toolbox')
     method = struct('small', 'Weibull-rejection', 'large', 'Cheng');
-    n = 10000000;
+    n = 1000000;
     m = 1;
     a = 1.5;
     b = 1.0;
@@ -404,8 +404,8 @@ end
 %@test:8
 if ~isoctave && ~user_has_matlab_license('statistics_toolbox')
     method = struct('small', 'Weibull-rejection', 'large', 'Best');
-    n = 10000000;
-    m = 1;
+    n = 1000000;
+    m = 20;
     a = 1.5;
     b = 1.0;
     try
diff --git a/matlab/utilities/tests b/matlab/utilities/tests
index 3362b3f43..c5ce76453 160000
--- a/matlab/utilities/tests
+++ b/matlab/utilities/tests
@@ -1 +1 @@
-Subproject commit 3362b3f43053a2bb5d3d3a1dbfb1a9e0c42a8fb8
+Subproject commit c5ce7645386c6d2e42a018957e245caa3dc05fde
diff --git a/tests/run_all_unit_tests.m b/tests/run_all_unit_tests.m
index 0bdffdb29..a31524b08 100644
--- a/tests/run_all_unit_tests.m
+++ b/tests/run_all_unit_tests.m
@@ -36,8 +36,6 @@ if isoctave
     mlist = mlist(find(~strcmp([matlab_dir filesep 'load_m_file_data_legacy.m'], mlist)));
 end
 
-rng(1);
-
 failedtests = {};
 
 for i = 1:length(mlist)
-- 
GitLab