Methode zum Aufruf aller Tests hinzugefügt

main
Gideon Regehr 2023-05-22 11:12:22 +02:00
parent b4e5be9316
commit 0018c0cf07
1 changed files with 31 additions and 0 deletions

View File

@ -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):