3. Generalities#

This procedure allows you to test the non-regression of files produced by the Aster commands, mainly IMPR_RESU, but it can be used on any text file.

To test a file, we extract the list of real numbers and the list of integers present in the file, the cardinal of these lists, and all the remaining text (once the numbers have been extracted).

For numbers, we check the non-regression of the sum, the absolute sum or the min/max of the values to within precision. Real and integer numbers are treated separately.

We also check (and this is the only mandatory test) the cardinal from the list of real numbers identified in the file.

To test the text in the file, we use the Python module md5, which provides a « signature » of the text (called md5sum). Thus, any variation of a text (title, name of a component) compared to a reference file will cause a change in the signature of the file.

Note 1:

The file must be closed for the value to be reliable (with for example DEFI_FICHIER, ACTION = “LIBERER”).

Note 2:

The command does not provide relevant information on binary files.

The test_file function can be called outside of Code_Aster to get the md5sum value of a file:

iret, sum = test_file (filename=”file_name”,

type_test = “SOMM”,

verbose=True)

Note 3

For integers, the value tested on integers is truncated to the largest integer that can be represented in 32 bits (approximately 2.e9) .