Skip to content

Instantly share code, notes, and snippets.

@jcttrll
Created August 8, 2017 14:51
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jcttrll/3fa81878e6d985842df730daf1a86ee2 to your computer and use it in GitHub Desktop.
Save jcttrll/3fa81878e6d985842df730daf1a86ee2 to your computer and use it in GitHub Desktop.
Spock test with data table
@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