Created
August 8, 2017 14:51
-
-
Save jcttrll/3fa81878e6d985842df730daf1a86ee2 to your computer and use it in GitHub Desktop.
Spock test with data table
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@Unroll | |
"LD X, [M] -> #value.hex32"() { | |
setup: | |
Rx3588Processor processor | |
rom.put(0x00 as byte) | |
rom.putInt(value as int) | |
when: | |
processor = new Rx3588Processor().attachRom(rom.array()) | |
processor.setRegister("M", 1) | |
processor.setRegister("F", 0x00000000) | |
processor.run() | |
then: | |
processor.getFlag("Z") == Z | |
processor.getFlag("S") == S | |
when: | |
processor = new Rx3588Processor().attachRom(rom.array()) | |
processor.setRegister("M", 1) | |
processor.setRegister("F", 0xffffffff) | |
processor.run() | |
then: | |
processor.getFlag("Z") == Z | |
processor.getFlag("S") == S | |
where: | |
value || Z | S | |
0x00000000 || 1 | 0 | |
0x7fffffff || 0 | 0 | |
0x80000000 || 0 | 1 | |
0xffffffff || 0 | 1 | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment