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