From: Gary P. <gpa...@gm...> - 2009-07-08 08:09:04
|
Stupid static state! It's the one thing that breaks my inner child on a daily basis :( I truly hate it because it's useful for normal code (I could debate that) but it breaks testing in a spectacular way - yes, that's a bad thing. A *very* bad thing. I REALLY want to fix this problem - it's a serious bug to be honest. We shouldn't have any static state in CIlib. You will need to kinda "register" an algorithm (mock or real) and then run the test code. The algorithm will need to have it's current algorithm placed on the internal algorithm stack so that the Algorithm.get() will work. On the other hand, this depends on how you are testing your code. Could you please provide the unit test method? Regards, Gary On Wednesday 08 July 2009 09:51:33 Marde Greeff wrote: > Hi everyone, > > What is the best way of writing a unit test for testing my dynamic moo > functions? > > In the function's evaluate method, I require access to the higher-level > algorithm's number of iterations: tau = Algorithm.get().getIterations() > > This is then used to calculate the time t that causes the function to > change over time. > > Marde |