Update test.cpp

Refactoring =)
Merge pull request #2 from demon1234432/patch-2

That was predictable.