Closed kevinramharak closed 4 years ago
Any ideas on how to make testing easier to implement?
It's definitely planned to add Fakes for Cubot & CPU etc. Even better would be to abstract all the Assembler/CPU code to allow for different ISAs. I'll keep you updated on my progress
I added some helper functions, let me know what you think.
Example:
That seems way easier. Expressing the assembly in java is hard. This would make it trivial
Hey Simon,
I was trying to add tests for each instruction because i am not confident they all work 100% correctly, but it is really hard to add tests for some instructions. For example the
CallInstruction
expects aCPU instance
and theCPU
instance either uses theGameServer
singleton (which does not exist in tests) or you can give it a fake config, but then you need to give it aCubot
instance.The more complicated the instruction becomes the hard it is to test. I know you have some refactoring in mind. Any ideas on how to make testing easier to implement?