2 * Copyright (c) 2023 Samsung Electronics Co., Ltd. All Rights Reserved
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
8 * http://www.apache.org/licenses/LICENSE-2.0
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
17 #include "mio_circle/Reader.h"
19 #include <flatbuffers/flatbuffers.h>
20 #include <gtest/gtest.h>
22 class mio_circle06_reader_test : public ::testing::Test
25 void initialization_emty(void)
27 _model = circle::CreateModelDirect(_fbb, 0, &_opcodes_vec);
28 circle::FinishModelBuffer(_fbb, _model);
31 const circle::Model *circleModel(void)
33 auto ptr = _fbb.GetBufferPointer();
34 return circle::GetModel(ptr);
38 flatbuffers::FlatBufferBuilder _fbb;
39 flatbuffers::Offset<circle::Model> _model;
40 std::vector<flatbuffers::Offset<circle::OperatorCode>> _opcodes_vec;
43 TEST_F(mio_circle06_reader_test, null_Model_NEG)
45 EXPECT_THROW(mio::circle::Reader reader(nullptr), std::runtime_error);
48 TEST_F(mio_circle06_reader_test, empty_Model)
50 initialization_emty();
52 const circle::Model *model = circleModel();
53 EXPECT_NE(nullptr, model);
55 mio::circle::Reader reader(model);
60 // TODO add more tests