Skip to content

Commit 4f57fa6

Browse files
committed
add result hash validation
1 parent 6e0bf91 commit 4f57fa6

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

Octane/gbemu-part2.js

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9782,7 +9782,14 @@ var gameboy_rom='r+BPyZiEZwA+AeBPySAobeEq6gAgKlYj5WJv6SRmZjjhKuXqACDJ///////////
97829782
setupGameboy();
97839783

97849784
class Benchmark {
9785+
EXPECTED_RESULT_HASH = 0x1a2b3c4f;
97859786
runIteration() {
97869787
this.result = runGameboy();
97879788
}
9789+
9790+
validate() {
9791+
if (this.result != this.EXPECTED_RESULT_HASH)
9792+
throw new Error(`Got unexpected result hash ${this.result} instead of ${this.EXPECTED_RESULT_HASH}`)
9793+
9794+
}
97889795
}

0 commit comments

Comments
 (0)