Tests for compare_and_mask