class EL_CRC_32_TESTABLE
Client examples: COMMA_SEPARATED_IMPORT_TEST_SET ; COPIED_SVG_DIRECTORY_DATA_TEST_SET ; CREATEABLE_FROM_XPATH_MATCH_EVENTS_TEST_SET ; DOCUMENT_NODE_STRING_TEST_SET ; DOC_TYPE_TEST_SET ; ECD_READER_WRITER_TEST_SET ; EVOLICITY_TEST_SET ; FEATURE_EDITOR_COMMAND_TEST_SET ; FILE_SYNC_MANAGER_TEST_SET ; FTP_PROTOCOL_TEST_SET ; I18N_LOCALIZATION_TEST_SET ; ID3_TAG_INFO_TEST_SET ; JAVA_TEST_SET ; JSON_PARSING_TEST_SET ; LOCALE_COMPILER_TEST_SET ; MARKUP_ESCAPE_TEST_SET ; OBJECT_BUILDER_TEST_SET ; OPEN_OFFICE_TEST_SET ; PROTEIN_FOLDING_TEST_SET ; PYXIS_TO_XML_TEST_SET
Routines for use with EL_EQA_TEST_SET to do regression testing based on CRC-32 checksum of logged/console output. See do_test routine.
The type of log must be set to EL_CRC_32_CONSOLE_ONLY_LOG by running the test from a sub-application conforming to EL_CRC_32_AUTOTEST_APPLICATION
note
description: "[
Routines for use with ${EL_EQA_TEST_SET} to do regression testing based on CRC-32 checksum
of logged/console output. See **do_test** routine.
]"
notes: "[
The type of `log' must be set to ${EL_CRC_32_CONSOLE_ONLY_LOG} by running the test
from a sub-application conforming to ${EL_CRC_32_AUTOTEST_APPLICATION}
]"
author: "Finnian Reilly"
copyright: "Copyright (c) 2001-2022 Finnian Reilly"
contact: "finnian at eiffel hyphen loop dot com"
license: "MIT license (See: en.wikipedia.org/wiki/MIT_License)"
date: "2024-06-03 15:12:21 GMT (Monday 3rd June 2024)"
revision: "18"
deferred class
EL_CRC_32_TESTABLE
inherit
EL_MODULE_FILE
EL_MODULE_LOG
EL_MODULE_LOG_MANAGER
EL_SHARED_TEST_CRC
feature {NONE} -- Implementation
assert (a_tag: READABLE_STRING_GENERAL; a_condition: BOOLEAN)
deferred
end
do_test (name: STRING; target_checksum: NATURAL test: PROCEDURE; operands: TUPLE)
require
valid_lio: attached {EL_CRC_32_CONSOLE_AND_FILE_LOG} lio
valid_log_manager: attached {EL_CRC_32_LOG_MANAGER} Log_manager
valid_operands: test.valid_operands (operands)
local
actual_checksum: NATURAL
do
Test_crc.reset
if operands.is_empty then
log.enter (name)
else
log.enter_with_args (name, operands)
end
test.call (operands)
log.exit
actual_checksum := Test_crc.checksum
log.put_new_line
if target_checksum /= actual_checksum then
log.put_natural_field ("Expected checksum", target_checksum)
log.put_natural_field (" actual checksum", actual_checksum)
log.put_new_line
assert ("Routine %"" + name + "%" checksums agree", False)
end
end
end