Simplify test case.

It is easier (and better) to just compare instances.

We can also do the test in two iterations in a loop: In the first
iteration, we use enterBlock()/leaveBlock() and add the parameter/
variables and check. In the second iteration we just use enterBlock()/
leaveBlock() and check that the values are still there as expected.