| 810 | } |
| 811 | |
| 812 | void TestValidateErrors() { |
| 813 | { |
| 814 | // Inconsistent is_valid / value |
| 815 | ScalarType scalar(Buffer::FromString("xxx")); |
| 816 | scalar.is_valid = false; |
| 817 | AssertValidationFails(scalar); |
| 818 | } |
| 819 | |
| 820 | { |
| 821 | auto null_scalar = MakeNullScalar(type_); |
| 822 | null_scalar->is_valid = true; |
| 823 | AssertValidationFails(*null_scalar); |
| 824 | } |
| 825 | |
| 826 | { |
| 827 | // Invalid UTF8 |
| 828 | ScalarType scalar(Buffer::FromString("\xff")); |
| 829 | ASSERT_OK(scalar.Validate()); |
| 830 | ASSERT_RAISES(Invalid, scalar.ValidateFull()); |
| 831 | } |
| 832 | } |
| 833 | |
| 834 | protected: |
| 835 | std::shared_ptr<DataType> type_; |
nothing calls this directly
no test coverage detected