| 46 | void TearDown() { writer_ = StreamWriter{}; } |
| 47 | |
| 48 | std::shared_ptr<schema::GroupNode> GetSchema() { |
| 49 | schema::NodeVector fields; |
| 50 | |
| 51 | fields.push_back(schema::PrimitiveNode::Make("bool_field", Repetition::REQUIRED, |
| 52 | Type::BOOLEAN, ConvertedType::NONE)); |
| 53 | |
| 54 | fields.push_back(schema::PrimitiveNode::Make("string_field", Repetition::REQUIRED, |
| 55 | Type::BYTE_ARRAY, ConvertedType::UTF8)); |
| 56 | |
| 57 | fields.push_back(schema::PrimitiveNode::Make("char_field", Repetition::REQUIRED, |
| 58 | Type::FIXED_LEN_BYTE_ARRAY, |
| 59 | ConvertedType::NONE, 1)); |
| 60 | |
| 61 | fields.push_back(schema::PrimitiveNode::Make("char[4]_field", Repetition::REQUIRED, |
| 62 | Type::FIXED_LEN_BYTE_ARRAY, |
| 63 | ConvertedType::NONE, 4)); |
| 64 | |
| 65 | fields.push_back(schema::PrimitiveNode::Make("int8_field", Repetition::REQUIRED, |
| 66 | Type::INT32, ConvertedType::INT_8)); |
| 67 | |
| 68 | fields.push_back(schema::PrimitiveNode::Make("uint16_field", Repetition::REQUIRED, |
| 69 | Type::INT32, ConvertedType::UINT_16)); |
| 70 | |
| 71 | fields.push_back(schema::PrimitiveNode::Make("int32_field", Repetition::REQUIRED, |
| 72 | Type::INT32, ConvertedType::INT_32)); |
| 73 | |
| 74 | fields.push_back(schema::PrimitiveNode::Make("uint64_field", Repetition::REQUIRED, |
| 75 | Type::INT64, ConvertedType::UINT_64)); |
| 76 | |
| 77 | fields.push_back(schema::PrimitiveNode::Make("float_field", Repetition::REQUIRED, |
| 78 | Type::FLOAT, ConvertedType::NONE)); |
| 79 | |
| 80 | fields.push_back(schema::PrimitiveNode::Make("double_field", Repetition::REQUIRED, |
| 81 | Type::DOUBLE, ConvertedType::NONE)); |
| 82 | |
| 83 | fields.push_back(schema::PrimitiveNode::Make("bytes_field", Repetition::REQUIRED, |
| 84 | Type::BYTE_ARRAY, ConvertedType::NONE)); |
| 85 | |
| 86 | return std::static_pointer_cast<schema::GroupNode>( |
| 87 | schema::GroupNode::Make("schema", Repetition::REQUIRED, fields)); |
| 88 | } |
| 89 | |
| 90 | StreamWriter writer_; |
| 91 | }; |