From 0018c0cf07bdd72057b4ac596e70abf55433f766 Mon Sep 17 00:00:00 2001 From: Gideon Regehr <2023558@stud.hs-mannheim.de> Date: Mon, 22 May 2023 11:12:22 +0200 Subject: [PATCH] =?UTF-8?q?Methode=20zum=20Aufruf=20aller=20Tests=20hinzug?= =?UTF-8?q?ef=C3=BCgt?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Python_Tests/TotOnline.py | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) diff --git a/Python_Tests/TotOnline.py b/Python_Tests/TotOnline.py index d58777b..bd90084 100644 --- a/Python_Tests/TotOnline.py +++ b/Python_Tests/TotOnline.py @@ -8,6 +8,37 @@ from scipy.special import gammaincc as gammaincc class TotOnline: + + @staticmethod + def run_all_tests(binary_data: str): + # Run total_failure_test + p_value, result = TotOnline.total_failure_test(binary_data, 10) + if not result: + return False + + # Run monobit_test + p_value, result = TotOnline.monobit_test(binary_data) + if not result: + return False + + # Run block_frequency_test + p_value, result = TotOnline.block_frequency_test(binary_data, 128) + if not result: + return False + + # Run run_test + p_value, result = TotOnline.run_test(binary_data) + if not result: + return False + + # Run longest_one_block_test + p_value, result = TotOnline.longest_one_block_test(binary_data) + if not result: + return False + + # All tests passed + return True + @staticmethod def total_failure_test(binary_data: str, pattern_length=10):