| 1881 | using ScalarType = typename TypeTraits<UnionType>::ScalarType; |
| 1882 | |
| 1883 | void SetUp() { |
| 1884 | type_.reset(new UnionType({field("string", utf8()), field("number", uint64()), |
| 1885 | field("other_number", uint64())}, |
| 1886 | /*type_codes=*/{3, 42, 43})); |
| 1887 | union_type_ = static_cast<const Type*>(type_.get()); |
| 1888 | |
| 1889 | alpha_ = MakeScalar("alpha"); |
| 1890 | beta_ = MakeScalar("beta"); |
| 1891 | ASSERT_OK_AND_ASSIGN(two_, MakeScalar(uint64(), 2)); |
| 1892 | ASSERT_OK_AND_ASSIGN(three_, MakeScalar(uint64(), 3)); |
| 1893 | |
| 1894 | union_alpha_ = ScalarFromValue(0, alpha_); |
| 1895 | union_beta_ = ScalarFromValue(0, beta_); |
| 1896 | union_two_ = ScalarFromValue(1, two_); |
| 1897 | union_other_two_ = ScalarFromValue(2, two_); |
| 1898 | union_three_ = ScalarFromValue(1, three_); |
| 1899 | union_string_null_ = SpecificNull(0); |
| 1900 | union_number_null_ = SpecificNull(1); |
| 1901 | } |
| 1902 | |
| 1903 | std::shared_ptr<Scalar> ScalarFromValue(int field_index, |
| 1904 | std::shared_ptr<Scalar> field_value) { |
nothing calls this directly
no test coverage detected