[other_task #1679246] Fix CLL Variable tests

Change-Id: I7b6fffe67c3a37e3c3175d6f5090c6550cd2011e
Signed-off-by: József Gyürüsi <jozsef.gyurusi@ericsson.com>
diff --git a/test/Variable/EPTF_Variable_Test_Testcases.ttcn b/test/Variable/EPTF_Variable_Test_Testcases.ttcn
index f752af8..6e8438f 100644
--- a/test/Variable/EPTF_Variable_Test_Testcases.ttcn
+++ b/test/Variable/EPTF_Variable_Test_Testcases.ttcn
@@ -4330,11 +4330,32 @@
   f_EPTF_Base_stop(pass);
 }
 
+function f_EPTF_Var_Test_adjustTest_checkExpectedWarning_preamble_FT(in charstring pl_message) runs on VariableTest_CT {
+  if (not match(pl_message,pattern "*Warning*")) {
+    return;
+  }
+  if (match(pl_message,pattern v_charstringVar)) {
+    v_boolVar := true; // verdict is only pass if this warning is logged
+  }
+}
+
+function f_EPTF_Var_Test_adjustTest_checkWarning_cleanup() runs on VariableTest_CT {
+  if (v_boolVar == false) {
+    setverdict(fail, "Expected warning was not logged: ", v_charstringVar)
+  } else {
+    setverdict(pass)
+  }
+}
+
+
 testcase tc_EPTF_Var_SubscribeTest_pull_with_adjustRemoteContent_negative() runs on VariableTest_CT{
   f_EPTF_Var_init_CT("SubscribeTest_pull_with_adjustRemoteContent_negative");
   f_EPTF_Var_setMaxWaitTime(0.2)
-  f_EPTF_Base_setNegativeTestMode();
-  f_EPTF_Base_setExpectedErrorMsg("*Cannot convert direct content { floatVal := 1.000000 } to direct content { direct := { intVal := 0 } }. Types are incompatible*");
+  var charstring vl_expected_warning := "*Cannot convert direct content { floatVal := 1.000000 } to direct content { direct := { intVal := 0 } }. Types are incompatible*";
+  v_charstringVar := vl_expected_warning;
+  f_EPTF_Logging_registerPreambleFn(refers(f_EPTF_Var_Test_adjustTest_checkExpectedWarning_preamble_FT));
+  f_EPTF_Base_registerCleanup(refers(f_EPTF_Var_Test_adjustTest_checkWarning_cleanup));
+  v_boolVar := false;
 
   timer t_wait := 0.2;
 
@@ -4367,8 +4388,11 @@
 testcase tc_EPTF_Var_SubscribeTest_pull_noAlt_with_adjustRemoteContent_negative() runs on VariableTest_CT{
   f_EPTF_Var_init_CT("SubscribeTest_pull_noAlt_with_adjustRemoteContent_negative");
   f_EPTF_Var_setMaxWaitTime(0.2)
-  f_EPTF_Base_setNegativeTestMode();
-  f_EPTF_Base_setExpectedErrorMsg("*Cannot convert direct content { floatVal := 1.000000 } to direct content { direct := { intVal := 0 } }. Types are incompatible*");
+  var charstring vl_expected_warning := "*Cannot convert direct content { floatVal := 1.000000 } to direct content { direct := { intVal := 0 } }. Types are incompatible*";
+  v_charstringVar := vl_expected_warning;
+  f_EPTF_Logging_registerPreambleFn(refers(f_EPTF_Var_Test_adjustTest_checkExpectedWarning_preamble_FT));
+  f_EPTF_Base_registerCleanup(refers(f_EPTF_Var_Test_adjustTest_checkWarning_cleanup));
+  v_boolVar := false;
 
   timer t_wait := 0.2;
 
@@ -4401,8 +4425,11 @@
 testcase tc_EPTF_Var_SubscribeTest_pull_with_adjustContent_negative() runs on VariableTest_CT{
   f_EPTF_Var_init_CT("SubscribeTest_pull_with_adjustContent_negative");
   f_EPTF_Var_setMaxWaitTime(0.2)
-  f_EPTF_Base_setNegativeTestMode();
-  f_EPTF_Base_setExpectedErrorMsg("*Cannot convert direct content { floatVal := 1.000000 } to direct content { direct := { intVal := 0 } }. Types are incompatible*");
+  var charstring vl_expected_warning := "*Cannot convert direct content { floatVal := 1.000000 } to direct content { direct := { intVal := 0 } }. Types are incompatible*";
+  v_charstringVar := vl_expected_warning;
+  f_EPTF_Logging_registerPreambleFn(refers(f_EPTF_Var_Test_adjustTest_checkExpectedWarning_preamble_FT));
+  f_EPTF_Base_registerCleanup(refers(f_EPTF_Var_Test_adjustTest_checkWarning_cleanup));
+  v_boolVar := false;
 
   timer t_wait := 0.2;
 
@@ -4435,8 +4462,11 @@
 testcase tc_EPTF_Var_SubscribeTest_pull_noAlt_with_adjustContent_negative() runs on VariableTest_CT{
   f_EPTF_Var_init_CT("SubscribeTest_pull_noAlt_with_adjustContent_negative");
   f_EPTF_Var_setMaxWaitTime(0.2)
-  f_EPTF_Base_setNegativeTestMode();
-  f_EPTF_Base_setExpectedErrorMsg("*Cannot convert direct content { floatVal := 1.000000 } to direct content { direct := { intVal := 0 } }. Types are incompatible*");
+  var charstring vl_expected_warning := "*Cannot convert direct content { floatVal := 1.000000 } to direct content { direct := { intVal := 0 } }. Types are incompatible*";
+  v_charstringVar := vl_expected_warning;
+  f_EPTF_Logging_registerPreambleFn(refers(f_EPTF_Var_Test_adjustTest_checkExpectedWarning_preamble_FT));
+  f_EPTF_Base_registerCleanup(refers(f_EPTF_Var_Test_adjustTest_checkWarning_cleanup));
+  v_boolVar := false;
 
   timer t_wait := 0.2;