From: Hwankyu Jhun Date: Wed, 22 Feb 2023 00:55:08 +0000 (+0000) Subject: Fix build tests X-Git-Tag: accepted/tizen/unified/20230420.153149~14 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=refs%2Fchanges%2F02%2F288702%2F1;p=platform%2Fcore%2Fappfw%2Ftidl.git Fix build tests To test generated codes, the codes should be set in the CMakeLists.txt file. This patch fixes the build failure issues. Change-Id: I7c77c4d457e2307bfc6ff10f113ee9dc3850c51b Signed-off-by: Hwankyu Jhun --- diff --git a/idlc/gen/version2/c_body_generator_base.cc b/idlc/gen/version2/c_body_generator_base.cc index 115baf17..26c2d87e 100644 --- a/idlc/gen/version2/c_body_generator_base.cc +++ b/idlc/gen/version2/c_body_generator_base.cc @@ -1148,14 +1148,13 @@ void CBodyGeneratorBase::AddParameterType(const Interface& iface, void CBodyGeneratorBase::AddParameterType( std::shared_ptr param_type) { - if (param_type->GetBaseType().GetUserDefinedType() == BaseType::UserType::ENUM) + auto& type = param_type->GetBaseType(); + if (type.GetUserDefinedType() == BaseType::UserType::ENUM) return; std::string key = param_type->GetBaseType().GetFullName(true) + std::to_string(static_cast(param_type->GetDirection())); - key = GetEnumTypeString(key); - if (param_types_.find(key) != param_types_.end()) return; @@ -1212,8 +1211,16 @@ void CBodyGeneratorBase::GenParameterMap() { if (decl->GetMethodType() == Declaration::MethodType::DELEGATE) { AddParameterType(iface, type, ParameterType::Direction::OUT); } else { - AddParameterType(iface, type, - param->GetParameterType().GetDirection()); + auto direction = param->GetParameterType().GetDirection(); + if (direction == ParameterType::Direction::REF) { + AddParameterType(iface, type, + ParameterType::Direction::IN); + AddParameterType(iface, type, + ParameterType::Direction::OUT); + } else { + AddParameterType(iface, type, + param->GetParameterType().GetDirection()); + } } } diff --git a/idlc/gen/version2/c_proxy_body_generator_cb.hh b/idlc/gen/version2/c_proxy_body_generator_cb.hh index 38cbe095..ec64a436 100644 --- a/idlc/gen/version2/c_proxy_body_generator_cb.hh +++ b/idlc/gen/version2/c_proxy_body_generator_cb.hh @@ -399,7 +399,7 @@ static void _____delegate_handler(GList **delegates ___h handle; GList *iter; bool once; - int ret; + int ret_; @@ -437,9 +437,9 @@ out: */ constexpr const char CB_INTERFACE_DELEGATE_USER_DEFINED_UNIT_MAP_READ[] = R"__c_cb( -ret = rpc_port_unit_map_read_(map, "", &); -if (ret != RPC_PORT_ERROR_NONE) { - _E("Failed to read . error(%d)", ret); +ret_ = rpc_port_unit_map_read_(map, "", &); +if (ret_ != RPC_PORT_ERROR_NONE) { + _E("Failed to read . error(%d)", ret_); goto out; } )__c_cb"; @@ -449,9 +449,9 @@ if (ret != RPC_PORT_ERROR_NONE) { */ constexpr const char CB_INTERFACE_DELEGATE_BUNDLE_UNIT_MAP_READ[] = R"__c_cb( -ret = rpc_port_unit_map_read_bundle(map, "", &); -if (ret != RPC_PORT_ERROR_NONE) { - _E("Failed to read bundle. error(%d)", ret); +ret_ = rpc_port_unit_map_read_bundle(map, "", &); +if (ret_ != RPC_PORT_ERROR_NONE) { + _E("Failed to read bundle. error(%d)", ret_); goto out; } )__c_cb"; @@ -461,9 +461,9 @@ if (ret != RPC_PORT_ERROR_NONE) { */ constexpr const char CB_INTERFACE_DELEGATE_STRING_UNIT_MAP_READ[] = R"__c_cb( -ret = rpc_port_unit_map_read_string(map, "", &); -if (ret != RPC_PORT_ERROR_NONE) { - _E("Failed to read string. error(%d)", ret); +ret_ = rpc_port_unit_map_read_string(map, "", &); +if (ret_ != RPC_PORT_ERROR_NONE) { + _E("Failed to read string. error(%d)", ret_); goto out; } )__c_cb"; @@ -474,9 +474,9 @@ if (ret != RPC_PORT_ERROR_NONE) { */ constexpr const char CB_INTERFACE_DELEGATE_ENUM_UNIT_MAP_READ[] = R"__c_cb( -ret = rpc_port_unit_map_read_int(map, "", (int *)&); -if (ret != RPC_PORT_ERROR_NONE) { - _E("Failed to read . error(%d)", ret); +ret_ = rpc_port_unit_map_read_int(map, "", (int *)&); +if (ret_ != RPC_PORT_ERROR_NONE) { + _E("Failed to read . error(%d)", ret_); goto out; } )__c_cb"; @@ -488,9 +488,9 @@ if (ret != RPC_PORT_ERROR_NONE) { */ constexpr const char CB_INTERFACE_DELEGATE_BASE_UNIT_MAP_READ[] = R"__c_cb( -ret = rpc_port_unit_map_read_(map, "", &); -if (ret != RPC_PORT_ERROR_NONE) { - _E("Failed to read . error(%d)", ret); +ret_ = rpc_port_unit_map_read_(map, "", &); +if (ret_ != RPC_PORT_ERROR_NONE) { + _E("Failed to read . error(%d)", ret_); goto out; } )__c_cb"; diff --git a/tests/build_tests/CMakeLists.txt b/tests/build_tests/CMakeLists.txt index 913fee4c..e60f5511 100644 --- a/tests/build_tests/CMakeLists.txt +++ b/tests/build_tests/CMakeLists.txt @@ -95,6 +95,16 @@ SET(TIDL_GEN_SRCS FooPubsubGroupC.c FooPubsubCionGroup.cc FooPubsubCionGroupC.c + Message_v2ProxyC.c + Message_v2StubC.c + Buffer_v2ProxyC.c + Buffer_v2StubC.c + Ex_v2ProxyC.c + Ex_v2StubC.c + DataPort_v2ProxyC.c + DataPort_v2StubC.c + Foo_v2ProxyC.c + Foo_v2StubC.c ) ADD_CUSTOM_COMMAND(OUTPUT ${TIDL_GEN_SRCS} PRE_BUILD diff --git a/tests/build_tests/tidl/DataPort_v2.tidl b/tests/build_tests/tidl/DataPort_v2.tidl index 76df6e81..7d711629 100644 --- a/tests/build_tests/tidl/DataPort_v2.tidl +++ b/tests/build_tests/tidl/DataPort_v2.tidl @@ -1,7 +1,6 @@ protocol 2 struct CursorContext { - int Handle; enum position { LEFT, RIGHT, @@ -9,6 +8,7 @@ struct CursorContext { TOP, BOTTOM, } + int Handle; } struct Pair {