make the PORV test work more reliably

this seems to be a compiler bug, but it could be something
else. Anyway, using multiple functions for the tests instead of nested
scopes is probably not the worst idea anyway...

on my machine, this fixes #329 with clang in debug mode. no further testing was done by me so far...