Hallo,
Ich möchte einen Komponententest für ein Modul erstellen, das eine Tabelle in vielen Zellen bearbeitet. Also überlegte ich, gegen eine Checksumme der Tabelle zu testen
Ich konnte keine Funktion finden, die Ihnen eine Prüfsumme für eine sofort einsatzbereite Tabelle liefert.
Hat jemand eine gute Idee, wie es geht?
Freundliche Grüße
Stefan
Ich würde vorschlagen, die BlobMD5-Funktion zu verwenden. Möglicherweise möchten Sie die Daten in der Tabelle überprüfen und nicht das Festplatten-Image der Tabelle, da JMP möglicherweise den Binärdaten auf der Festplatte ein Datum hinzufügt oder sogar das Format in einer zukünftigen Version ändert. Das erste Beispiel ist wahrscheinlich NICHT das, was Sie für einen Komponententest wollen.
// capture the md5 of the data the table saves to disk
Show(
Hex(/* make it printable */
Blob MD5(/* get the hash */
Load Text File(
"$SAMPLE_DATA/big class.jmp",
BLOB/* the result is a BLOB, not a string */
)
)
)
);
// capture the md5 of the script that will produce the table
dt = Open( "$SAMPLE_DATA/big class.jmp" );
Show( Hex( Blob MD5( Char To Blob( Char( dt << getscript ) ) ) ) );
// capture the md5 of some numeric columns in the table; avoids numeric to character conversions
Show( Hex( Blob MD5( Matrix To Blob( dt[0, {height, age, weight}], "float", 8, "little" ) ) ) );
// capture the md5 of some mixed columns in the table
Show( Hex( Blob MD5( Char To Blob( Char( dt[0, {name, height, age, weight}] ) ) ) ) );