Fix const cast in reader test

It's a bit problematic, casting away const and type, but at least it works.