Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/zabbix/zabbix.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorAndrejs Kozlovs <andrejs.kozlovs@zabbix.com>2021-04-14 08:49:22 +0300
committerAndrejs Kozlovs <andrejs.kozlovs@zabbix.com>2021-04-14 08:49:22 +0300
commite50617ec1b7c42f4c6737880b35440f492ca2f6d (patch)
treef1ca284d3b2218164e308db44b22b182d608b3f9 /tests
parent1108e84dae2334766185eee146cb5bbc877919d3 (diff)
........S. [ZBXNEXT-114] fixes in tests
Diffstat (limited to 'tests')
-rw-r--r--tests/libs/zbxserver/valuemaps.c11
-rw-r--r--tests/libs/zbxserver/valuemaps.yaml23
2 files changed, 23 insertions, 11 deletions
diff --git a/tests/libs/zbxserver/valuemaps.c b/tests/libs/zbxserver/valuemaps.c
index 6aed3757557..a1f4d34cb62 100644
--- a/tests/libs/zbxserver/valuemaps.c
+++ b/tests/libs/zbxserver/valuemaps.c
@@ -83,17 +83,6 @@ void zbx_mock_test_entry(void **state)
newvalue = (char *)zbx_mock_get_parameter_string("out.value");
expected_ret = zbx_mock_str_to_return_code(zbx_mock_get_parameter_string("out.return"));
- /*{
- int i;
- for (i = 0; i < valuemaps.values_num; i++)
- {
- valuemap = (zbx_valuemaps_t *)valuemaps.values[i];
- printf("AKDBG VALUE '%s'value '%s', newvalue '%s', type %d\n",value, valuemap->value, valuemap->newvalue, valuemap->type);
-
- }
-
- }*/
-
ret = evaluate_value_by_map_test(value, sizeof(value), &valuemaps);
zbx_mock_assert_int_eq("valuemaps return value", expected_ret, ret);
diff --git a/tests/libs/zbxserver/valuemaps.yaml b/tests/libs/zbxserver/valuemaps.yaml
index dff97c8ba40..971f3d25d26 100644
--- a/tests/libs/zbxserver/valuemaps.yaml
+++ b/tests/libs/zbxserver/valuemaps.yaml
@@ -118,5 +118,28 @@ in:
out:
return: SUCCEED
value: "Default (4)"
+---
+test case: no mapping
+in:
+ value: 4
+ valuemaps:
+ - type: 0
+ value: 0
+ newvalue: "Value 0"
+ - type: 1
+ value: "^1$"
+ newvalue: "Regex 1"
+ - type: 2
+ value: <3
+ newvalue: "Value < 3"
+ - type: 2
+ value: 5:7
+ newvalue: "Value 5-7"
+ - type: 2
+ value: "> 10"
+ newvalue: "Value > 10"
+out:
+ return: FAIL
+ value: 4
...