Skip to content

Commit

Permalink
Fix failing #testTrapiSubstitution
Browse files Browse the repository at this point in the history
Work on PLE in MA required *NOT* to `simplify` ASTs. This in turn
caused `#testTrapiSubstitution` to break because it assumed the bitvector
is simplified in a certain way.

To fix this, this commit rewrites the test in a way that does not depend
on particular way the bitvector get simplified.
  • Loading branch information
janvrany authored and shingarov committed Jun 24, 2024
1 parent ed20e30 commit e9f84fb
Showing 1 changed file with 5 additions and 8 deletions.
13 changes: 5 additions & 8 deletions src/ArchC-Core-Tests/ProcessorInstructionTest.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -295,19 +295,16 @@ ProcessorInstructionTest >> testSymbolicEncoding [

{ #category : #'tests - powerpc' }
ProcessorInstructionTest >> testTrapiSubstitution [
| instr groundedInstr encoding constituents |
| instr groundedInstr encoding holes |
instr := AcProcessorDescriptions powerpc instructionAt: 'twi'.
groundedInstr := instr inEnvironment: (Dictionary new
at: 'ra' put: 12;
at: 'si' put: 12345;
yourself).
encoding := groundedInstr binaryEncoding .
self assert: encoding functorName equals: 'concat'.
constituents := encoding args.
self assert: constituents size equals: 3.
self assert: constituents first length equals: 6.
self assert: constituents first value equals: 3.
self assert: constituents second sym equals: 'to'.
self assert: constituents third value == 16rC3039.

holes := encoding variables.
self assert: holes size equals: 1.
self assert: holes anyOne isBitVector.
self assert: holes anyOne length == 5.
]

0 comments on commit e9f84fb

Please sign in to comment.