| 137 | }; |
| 138 | |
| 139 | TEST_F(TestPrimitiveNode, Attrs) { |
| 140 | PrimitiveNode node1("foo", Repetition::REPEATED, Type::INT32); |
| 141 | |
| 142 | PrimitiveNode node2("bar", Repetition::OPTIONAL, Type::BYTE_ARRAY, ConvertedType::UTF8); |
| 143 | |
| 144 | ASSERT_EQ("foo", node1.name()); |
| 145 | |
| 146 | ASSERT_TRUE(node1.is_primitive()); |
| 147 | ASSERT_FALSE(node1.is_group()); |
| 148 | |
| 149 | ASSERT_EQ(Repetition::REPEATED, node1.repetition()); |
| 150 | ASSERT_EQ(Repetition::OPTIONAL, node2.repetition()); |
| 151 | |
| 152 | ASSERT_EQ(Node::PRIMITIVE, node1.node_type()); |
| 153 | |
| 154 | ASSERT_EQ(Type::INT32, node1.physical_type()); |
| 155 | ASSERT_EQ(Type::BYTE_ARRAY, node2.physical_type()); |
| 156 | |
| 157 | // logical types |
| 158 | ASSERT_EQ(ConvertedType::NONE, node1.converted_type()); |
| 159 | ASSERT_EQ(ConvertedType::UTF8, node2.converted_type()); |
| 160 | |
| 161 | // repetition |
| 162 | PrimitiveNode node3("foo", Repetition::REPEATED, Type::INT32); |
| 163 | PrimitiveNode node4("foo", Repetition::REQUIRED, Type::INT32); |
| 164 | PrimitiveNode node5("foo", Repetition::OPTIONAL, Type::INT32); |
| 165 | |
| 166 | ASSERT_TRUE(node3.is_repeated()); |
| 167 | ASSERT_FALSE(node3.is_optional()); |
| 168 | |
| 169 | ASSERT_TRUE(node4.is_required()); |
| 170 | |
| 171 | ASSERT_TRUE(node5.is_optional()); |
| 172 | ASSERT_FALSE(node5.is_required()); |
| 173 | } |
| 174 | |
| 175 | TEST_F(TestPrimitiveNode, FromParquet) { |
| 176 | SchemaElement elt = |
nothing calls this directly
no test coverage detected