Skip to content

Commit d26114a

Browse files
committed
Test relative_path_include.idl
Signed-off-by: Yangbo Long <[email protected]>
1 parent 54f1849 commit d26114a

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed

test/feature/idl_parser/IdlParserTests.cpp

+19
Original file line numberDiff line numberDiff line change
@@ -1060,6 +1060,25 @@ TEST_F(IdlParserTests, arrays)
10601060
ASSERT_TRUE(type105);
10611061
}
10621062

1063+
TEST_F(IdlParserTests, relative_path_include)
1064+
{
1065+
DynamicTypeBuilderFactory::_ref_type factory {DynamicTypeBuilderFactory::get_instance()};
1066+
std::vector<std::string> include_paths;
1067+
include_paths.push_back("IDL/helpers/basic_inner_types.idl");
1068+
1069+
DynamicTypeBuilder::_ref_type builder1 = factory->create_type_w_document("IDL/relative_path_include.idl", "RelativePathIncludeStruct", include_paths);
1070+
EXPECT_TRUE(builder1);
1071+
DynamicType::_ref_type type1 = builder1->build();
1072+
ASSERT_TRUE(type1);
1073+
DynamicData::_ref_type data1 {DynamicDataFactory::get_instance()->create_data(type1)};
1074+
ASSERT_TRUE(data1);
1075+
int32_t test1 {0};
1076+
EXPECT_EQ(data1->set_int32_value(0, 2), RETCODE_OK);
1077+
EXPECT_EQ(data1->get_int32_value(test1, 0), RETCODE_OK);
1078+
EXPECT_EQ(test1, 2);
1079+
EXPECT_EQ(data1->set_string_value(0, ""), RETCODE_BAD_PARAMETER);
1080+
}
1081+
10631082
int main(
10641083
int argc,
10651084
char** argv)

0 commit comments

Comments
 (0)