Tests for cast_bits