From a35ea640e5d6ff763e1dcf99f9fdec2d794374fd Mon Sep 17 00:00:00 2001 From: Bogdan Stanca-Kaposta <bogdan.stanca-kaposta@spirent.com> Date: Thu, 8 Mar 2018 17:56:21 +0100 Subject: [PATCH] fix for accessing not present values in f_check_notificationContent --- LibOneM2M/OneM2M_Functions.ttcn | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/LibOneM2M/OneM2M_Functions.ttcn b/LibOneM2M/OneM2M_Functions.ttcn index a07d2c9..7b4c417 100644 --- a/LibOneM2M/OneM2M_Functions.ttcn +++ b/LibOneM2M/OneM2M_Functions.ttcn @@ -1600,23 +1600,23 @@ module OneM2M_Functions { if (ischosen(p_primitiveContent.aE)){ log("Representation contains AE resource representation"); - if(ischosen(p_requestPrimitive.primitiveContent.notification.notificationEvent.representation.resource.aE)) { + if(isvalue(p_requestPrimitive.primitiveContent.notification.notificationEvent.representation.resource.aE)) { v_matchResult := match(p_requestPrimitive.primitiveContent.notification.notificationEvent.representation.resource.aE, p_primitiveContent.aE); log("Expected primitiveContent"); } - else if(ischosen(p_requestPrimitive.primitiveContent.notification.notificationEvent.representation.responsePrimitive)) { + else if(isvalue(p_requestPrimitive.primitiveContent.notification.notificationEvent.representation.responsePrimitive.primitiveContent.aE)) { v_matchResult :=match(p_requestPrimitive.primitiveContent.notification.notificationEvent.representation.responsePrimitive.primitiveContent.aE, p_primitiveContent.aE); } - else if (ischosen(p_requestPrimitive.primitiveContent.aggregatedNotification)) { + else if (isvalue(p_requestPrimitive.primitiveContent.aggregatedNotification.notification_list)) { v_matchResult := true; v_numberOfAggregatedNotification := lengthof(p_requestPrimitive.primitiveContent.aggregatedNotification.notification_list); for(i := 0; i< v_numberOfAggregatedNotification; i := i + 1){ - if(ischosen(p_requestPrimitive.primitiveContent.aggregatedNotification.notification_list[i].notificationEvent.representation.resource)) { + if(isvalue(p_requestPrimitive.primitiveContent.aggregatedNotification.notification_list[i].notificationEvent.representation.resource.aE)) { if(not (match(p_requestPrimitive.primitiveContent.aggregatedNotification.notification_list[i].notificationEvent.representation.resource.aE, p_primitiveContent.aE))){ v_matchResult := false; } } - else if(ischosen(p_requestPrimitive.primitiveContent.aggregatedNotification.notification_list[i].notificationEvent.representation.responsePrimitive)) { + else if(isvalue(p_requestPrimitive.primitiveContent.aggregatedNotification.notification_list[i].notificationEvent.representation.responsePrimitive.primitiveContent.aE)) { if(not (match(p_requestPrimitive.primitiveContent.aggregatedNotification.notification_list[i].notificationEvent.representation.responsePrimitive.primitiveContent.aE, p_primitiveContent.aE))){ v_matchResult := false; } @@ -1630,10 +1630,10 @@ module OneM2M_Functions { } if (ischosen(p_primitiveContent.container)){ - if(ischosen(p_requestPrimitive.primitiveContent.notification.notificationEvent.representation.resource.container)) { + if(isvalue(p_requestPrimitive.primitiveContent.notification.notificationEvent.representation.resource.container)) { v_matchResult := match(p_requestPrimitive.primitiveContent.notification.notificationEvent.representation.resource.container, p_primitiveContent.container) } - else if(ischosen(p_requestPrimitive.primitiveContent.notification.notificationEvent.representation.responsePrimitive)) { + else if(isvalue(p_requestPrimitive.primitiveContent.notification.notificationEvent.representation.responsePrimitive.primitiveContent.container)) { v_matchResult := match(p_requestPrimitive.primitiveContent.notification.notificationEvent.representation.responsePrimitive.primitiveContent.container, p_primitiveContent.container) } } -- GitLab