If you don't define test than it would never equal 2, so it's an infinte loop. Why not just have like while(1=1) or something?

I don't know c++ so I can't really help, but...what was the math...