You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

2242 lines
51 KiB

1 year ago
---
test case: Expression '1 + 2 * 3'
in:
rules: [ZBX_EVAL_PARSE_VAR,ZBX_EVAL_PARSE_MATH]
expression: '1 + 2 * 3'
out:
result: SUCCEED
value: 7
---
test case: Expression '1'
in:
rules: [ZBX_EVAL_PARSE_VAR,ZBX_EVAL_PARSE_MATH]
expression: '1'
out:
result: SUCCEED
value: 1
---
test case: Expression '"x\"y\"z"'
in:
rules: [ZBX_EVAL_PARSE_VAR,ZBX_EVAL_PARSE_MATH]
expression: '"x\"y\"z"'
out:
result: SUCCEED
value: 'x"y"z'
---
test case: Expression '{$M}'
in:
rules: [ZBX_EVAL_PARSE_USERMACRO]
expression: '{$M}'
replace:
- {token: '{$M}', value: '2'}
out:
result: SUCCEED
value: 2
---
test case: Expression '{$M}'
in:
rules: []
expression: '{$M}'
replace:
- {token: '{$M}', value: '2'}
out:
result: FAIL
---
test case: Expression '{M}'
in:
rules: [ZBX_EVAL_PARSE_MACRO]
expression: '{M}'
replace:
- {token: '{M}', value: '3'}
out:
result: SUCCEED
value: 3
---
test case: Expression '{M}'
in:
rules: []
expression: '{M}'
replace:
- {token: '{M}', value: '2'}
out:
result: FAIL
---
test case: Expression '{123}'
in:
rules: [ZBX_EVAL_PARSE_FUNCTIONID]
expression: '{123}'
replace:
- {token: '{123}', value: '4'}
out:
result: SUCCEED
value: 4
---
test case: Expression '{123}'
in:
rules: [ZBX_EVAL_PARSE_FUNCTIONID]
expression: '{123}'
out:
result: FAIL
---
test case: Expression '-1'
in:
rules: [ZBX_EVAL_PARSE_VAR,ZBX_EVAL_PARSE_MATH]
expression: '-1'
out:
result: SUCCEED
value: '-1'
---
test case: Expression '--1'
in:
rules: [ZBX_EVAL_PARSE_VAR,ZBX_EVAL_PARSE_MATH]
expression: '--1'
out:
result: SUCCEED
value: '1'
---
test case: Expression '- "2"'
in:
rules: [ZBX_EVAL_PARSE_VAR,ZBX_EVAL_PARSE_MATH]
expression: '- "2"'
out:
result: SUCCEED
value: '-2'
---
test case: Expression '1+2'
in:
rules: [ZBX_EVAL_PARSE_VAR,ZBX_EVAL_PARSE_MATH]
expression: '1+2'
out:
result: SUCCEED
value: '3'
---
test case: Expression '1-2'
in:
rules: [ZBX_EVAL_PARSE_VAR,ZBX_EVAL_PARSE_MATH]
expression: '1-2'
out:
result: SUCCEED
value: '-1'
---
test case: Expression '3*2'
in:
rules: [ZBX_EVAL_PARSE_VAR,ZBX_EVAL_PARSE_MATH]
expression: '3*2'
out:
result: SUCCEED
value: '6'
---
test case: Expression '1/2'
in:
rules: [ZBX_EVAL_PARSE_VAR,ZBX_EVAL_PARSE_MATH]
expression: '1/2'
out:
result: SUCCEED
value: '0.5'
---
test case: Expression '1=1'
in:
rules: [ZBX_EVAL_PARSE_VAR,ZBX_EVAL_PARSE_MATH,ZBX_EVAL_PARSE_COMPARE]
expression: '1=1'
out:
result: SUCCEED
value: '1'
---
test case: Expression '1=2'
in:
rules: [ZBX_EVAL_PARSE_VAR,ZBX_EVAL_PARSE_MATH,ZBX_EVAL_PARSE_COMPARE]
expression: '1=2'
out:
result: SUCCEED
value: '0'
---
test case: Expression '"xyz"="xyz"'
in:
rules: [ZBX_EVAL_PARSE_VAR,ZBX_EVAL_PARSE_MATH,ZBX_EVAL_PARSE_COMPARE]
expression: '"xyz"="xyz"'
out:
result: SUCCEED
value: '1'
---
test case: Expression '"xyz"="abc"'
in:
rules: [ZBX_EVAL_PARSE_VAR,ZBX_EVAL_PARSE_MATH,ZBX_EVAL_PARSE_COMPARE]
expression: '"xyz"="abc"'
out:
result: SUCCEED
value: '0'
---
test case: Expression '1<>1'
in:
rules: [ZBX_EVAL_PARSE_VAR,ZBX_EVAL_PARSE_MATH,ZBX_EVAL_PARSE_COMPARE]
expression: '1<>1'
out:
result: SUCCEED
value: '0'
---
test case: Expression '1<>2'
in:
rules: [ZBX_EVAL_PARSE_VAR,ZBX_EVAL_PARSE_MATH,ZBX_EVAL_PARSE_COMPARE]
expression: '1<>2'
out:
result: SUCCEED
value: '1'
---
test case: Expression '"xyz"<>"xyz"'
in:
rules: [ZBX_EVAL_PARSE_VAR,ZBX_EVAL_PARSE_MATH,ZBX_EVAL_PARSE_COMPARE]
expression: '"xyz"<>"xyz"'
out:
result: SUCCEED
value: '0'
---
test case: Expression '"xyz"<>"abc"'
in:
rules: [ZBX_EVAL_PARSE_VAR,ZBX_EVAL_PARSE_MATH,ZBX_EVAL_PARSE_COMPARE]
expression: '"xyz"<>"abc"'
out:
result: SUCCEED
value: '1'
---
test case: Expression '1<2'
in:
rules: [ZBX_EVAL_PARSE_VAR,ZBX_EVAL_PARSE_MATH,ZBX_EVAL_PARSE_COMPARE]
expression: '1<2'
out:
result: SUCCEED
value: '1'
---
test case: Expression '3<2'
in:
rules: [ZBX_EVAL_PARSE_VAR,ZBX_EVAL_PARSE_MATH,ZBX_EVAL_PARSE_COMPARE]
expression: '3<2'
out:
result: SUCCEED
value: '0'
---
test case: Expression '1<1'
in:
rules: [ZBX_EVAL_PARSE_VAR,ZBX_EVAL_PARSE_MATH,ZBX_EVAL_PARSE_COMPARE]
expression: '1<1'
out:
result: SUCCEED
value: '0'
---
test case: Expression '2>2'
in:
rules: [ZBX_EVAL_PARSE_VAR,ZBX_EVAL_PARSE_MATH,ZBX_EVAL_PARSE_COMPARE]
expression: '2>2'
out:
result: SUCCEED
value: '0'
---
test case: Expression '2>1'
in:
rules: [ZBX_EVAL_PARSE_VAR,ZBX_EVAL_PARSE_MATH,ZBX_EVAL_PARSE_COMPARE]
expression: '2>1'
out:
result: SUCCEED
value: '1'
---
test case: Expression '1<=2'
in:
rules: [ZBX_EVAL_PARSE_VAR,ZBX_EVAL_PARSE_MATH,ZBX_EVAL_PARSE_COMPARE]
expression: '1<=2'
out:
result: SUCCEED
value: '1'
---
test case: Expression '2<=2'
in:
rules: [ZBX_EVAL_PARSE_VAR,ZBX_EVAL_PARSE_MATH,ZBX_EVAL_PARSE_COMPARE]
expression: '2<=2'
out:
result: SUCCEED
value: '1'
---
test case: Expression '1<=3'
in:
rules: [ZBX_EVAL_PARSE_VAR,ZBX_EVAL_PARSE_MATH,ZBX_EVAL_PARSE_COMPARE]
expression: '3<=2'
out:
result: SUCCEED
value: '0'
---
test case: Expression '2>=1'
in:
rules: [ZBX_EVAL_PARSE_VAR,ZBX_EVAL_PARSE_MATH,ZBX_EVAL_PARSE_COMPARE]
expression: '2>=1'
out:
result: SUCCEED
value: '1'
---
test case: Expression '2>=2'
in:
rules: [ZBX_EVAL_PARSE_VAR,ZBX_EVAL_PARSE_MATH,ZBX_EVAL_PARSE_COMPARE]
expression: '2>=2'
out:
result: SUCCEED
value: '1'
---
test case: Expression '2>=3'
in:
rules: [ZBX_EVAL_PARSE_VAR,ZBX_EVAL_PARSE_MATH,ZBX_EVAL_PARSE_COMPARE]
expression: '2>=3'
out:
result: SUCCEED
value: '0'
---
test case: Expression '0 or 0'
in:
rules: [ZBX_EVAL_PARSE_VAR,ZBX_EVAL_PARSE_MATH,ZBX_EVAL_PARSE_COMPARE,ZBX_EVAL_PARSE_LOGIC]
expression: '0 or 0'
out:
result: SUCCEED
value: '0'
---
test case: Expression '0 or 1'
in:
rules: [ZBX_EVAL_PARSE_VAR,ZBX_EVAL_PARSE_MATH,ZBX_EVAL_PARSE_COMPARE,ZBX_EVAL_PARSE_LOGIC]
expression: '0 or 1'
out:
result: SUCCEED
value: '1'
---
test case: Expression '1 or 0'
in:
rules: [ZBX_EVAL_PARSE_VAR,ZBX_EVAL_PARSE_MATH,ZBX_EVAL_PARSE_COMPARE,ZBX_EVAL_PARSE_LOGIC]
expression: '1 or 0'
out:
result: SUCCEED
value: '1'
---
test case: Expression '1 or 1'
in:
rules: [ZBX_EVAL_PARSE_VAR,ZBX_EVAL_PARSE_MATH,ZBX_EVAL_PARSE_COMPARE,ZBX_EVAL_PARSE_LOGIC]
expression: '1 or 1'
out:
result: SUCCEED
value: '1'
---
test case: Expression '0 and 0'
in:
rules: [ZBX_EVAL_PARSE_VAR,ZBX_EVAL_PARSE_MATH,ZBX_EVAL_PARSE_COMPARE,ZBX_EVAL_PARSE_LOGIC]
expression: '0 and 0'
out:
result: SUCCEED
value: '0'
---
test case: Expression '0 and 1'
in:
rules: [ZBX_EVAL_PARSE_VAR,ZBX_EVAL_PARSE_MATH,ZBX_EVAL_PARSE_COMPARE,ZBX_EVAL_PARSE_LOGIC]
expression: '0 and 1'
out:
result: SUCCEED
value: '0'
---
test case: Expression '1 and 0'
in:
rules: [ZBX_EVAL_PARSE_VAR,ZBX_EVAL_PARSE_MATH,ZBX_EVAL_PARSE_COMPARE,ZBX_EVAL_PARSE_LOGIC]
expression: '1 and 0'
out:
result: SUCCEED
value: '0'
---
test case: Expression '1 and 1'
in:
rules: [ZBX_EVAL_PARSE_VAR,ZBX_EVAL_PARSE_MATH,ZBX_EVAL_PARSE_COMPARE,ZBX_EVAL_PARSE_LOGIC]
expression: '1 and 1'
out:
result: SUCCEED
value: '1'
---
test case: Expression 'not 1'
in:
rules: [ZBX_EVAL_PARSE_VAR,ZBX_EVAL_PARSE_MATH,ZBX_EVAL_PARSE_COMPARE,ZBX_EVAL_PARSE_LOGIC]
expression: 'not 1'
out:
result: SUCCEED
value: '0'
---
test case: Expression 'not not 1'
in:
rules: [ZBX_EVAL_PARSE_VAR,ZBX_EVAL_PARSE_MATH,ZBX_EVAL_PARSE_COMPARE,ZBX_EVAL_PARSE_LOGIC]
expression: 'not not 1'
out:
result: SUCCEED
value: '1'
---
test case: Expression 'not "a"'
in:
rules: [ZBX_EVAL_PARSE_VAR,ZBX_EVAL_PARSE_MATH,ZBX_EVAL_PARSE_COMPARE,ZBX_EVAL_PARSE_LOGIC]
expression: 'not "a"'
out:
result: FAIL
---
test case: Expression 'min(2, 1)'
in:
rules: [ZBX_EVAL_PARSE_FUNCTION,ZBX_EVAL_PARSE_GROUP,ZBX_EVAL_PARSE_VAR]
expression: 'min(2, 1)'
out:
result: SUCCEED
value: '1'
---
test case: Expression 'min(2, 3)'
in:
rules: [ZBX_EVAL_PARSE_FUNCTION,ZBX_EVAL_PARSE_GROUP,ZBX_EVAL_PARSE_VAR]
expression: 'min(2, 3)'
out:
result: SUCCEED
value: '2'
---
test case: Expression 'max(2, 1)'
in:
rules: [ZBX_EVAL_PARSE_FUNCTION,ZBX_EVAL_PARSE_GROUP,ZBX_EVAL_PARSE_VAR]
expression: 'max(2, 1)'
out:
result: SUCCEED
value: '2'
---
test case: Expression 'max(2, 3)'
in:
rules: [ZBX_EVAL_PARSE_FUNCTION,ZBX_EVAL_PARSE_GROUP,ZBX_EVAL_PARSE_VAR]
expression: 'max(2, 3)'
out:
result: SUCCEED
value: '3'
---
test case: Expression 'sum(1, 2, 3)'
in:
rules: [ZBX_EVAL_PARSE_FUNCTION,ZBX_EVAL_PARSE_GROUP,ZBX_EVAL_PARSE_VAR]
expression: 'sum(1, 2, 3)'
out:
result: SUCCEED
value: '6'
---
test case: Expression 'avg(1, 2, 9)'
in:
rules: [ZBX_EVAL_PARSE_FUNCTION,ZBX_EVAL_PARSE_GROUP,ZBX_EVAL_PARSE_VAR]
expression: 'avg(1, 2, 9)'
out:
result: SUCCEED
value: '4'
---
test case: Expression 'min(max(1, 3), max(2, 4))'
in:
rules: [ZBX_EVAL_PARSE_FUNCTION,ZBX_EVAL_PARSE_GROUP,ZBX_EVAL_PARSE_VAR]
expression: 'min(max(1, 3), max(2, 4))'
out:
result: SUCCEED
value: '3'
---
test case: Expression 'max("2", "1")'
in:
rules: [ZBX_EVAL_PARSE_FUNCTION,ZBX_EVAL_PARSE_GROUP,ZBX_EVAL_PARSE_VAR]
expression: 'max("2", "1")'
out:
result: SUCCEED
value: '2'
---
test case: Expression 'max("2", "a")'
in:
rules: [ZBX_EVAL_PARSE_FUNCTION,ZBX_EVAL_PARSE_GROUP,ZBX_EVAL_PARSE_VAR]
expression: 'max("2", "a")'
out:
result: FAIL
---
test case: Expression 'min(1 + 2, 0.5 + 1.5)'
in:
rules: [ZBX_EVAL_PARSE_FUNCTION,ZBX_EVAL_PARSE_GROUP,ZBX_EVAL_PARSE_VAR,ZBX_EVAL_PARSE_MATH]
expression: 'min(1 + 2, 0.5 + 1.5)'
out:
result: SUCCEED
value: '2'
---
test case: Expression '{$M} or 1'
in:
rules: [ZBX_EVAL_PARSE_USERMACRO,ZBX_EVAL_PARSE_VAR,ZBX_EVAL_PARSE_LOGIC]
expression: '{$M} or 1'
replace:
- {token: '{$M}', error: 'forced operand error'}
out:
result: FAIL
---
test case: Expression '{$M} or 0'
in:
rules: [ZBX_EVAL_PARSE_USERMACRO,ZBX_EVAL_PARSE_VAR,ZBX_EVAL_PARSE_LOGIC]
expression: '{$M} or 0'
replace:
- {token: '{$M}', error: 'forced operand error'}
out:
result: FAIL
---
test case: Expression '{$M} or 1'
in:
rules: [ZBX_EVAL_PARSE_USERMACRO,ZBX_EVAL_PROCESS_ERROR,ZBX_EVAL_PARSE_VAR,ZBX_EVAL_PARSE_LOGIC]
expression: '{$M} or 1'
replace:
- {token: '{$M}', error: 'forced operand error'}
out:
result: SUCCEED
value: 1
---
test case: Expression '{$M} or "a"'
in:
rules: [ZBX_EVAL_PARSE_USERMACRO,ZBX_EVAL_PROCESS_ERROR,ZBX_EVAL_PARSE_VAR,ZBX_EVAL_PARSE_LOGIC]
expression: '{$M} or "a"'
replace:
- {token: '{$M}', error: 'forced operand error'}
out:
result: FAIL
---
test case: Expression '{$M} or 0'
in:
rules: [ZBX_EVAL_PARSE_USERMACRO,ZBX_EVAL_PROCESS_ERROR,ZBX_EVAL_PARSE_VAR,ZBX_EVAL_PARSE_LOGIC]
expression: '{$M} or 0'
replace:
- {token: '{$M}', error: 'forced operand error'}
out:
result: FAIL
---
test case: Expression '{$M} and 1'
in:
rules: [ZBX_EVAL_PARSE_USERMACRO,ZBX_EVAL_PARSE_VAR,ZBX_EVAL_PARSE_LOGIC]
expression: '{$M} and 1'
replace:
- {token: '{$M}', error: 'forced operand error'}
out:
result: FAIL
---
test case: Expression '{$M} and 0'
in:
rules: [ZBX_EVAL_PARSE_USERMACRO,ZBX_EVAL_PARSE_VAR,ZBX_EVAL_PARSE_LOGIC]
expression: '{$M} and 0'
replace:
- {token: '{$M}', error: 'forced operand error'}
out:
result: FAIL
---
test case: Expression '{$M} and 1'
in:
rules: [ZBX_EVAL_PARSE_USERMACRO,ZBX_EVAL_PROCESS_ERROR,ZBX_EVAL_PARSE_VAR,ZBX_EVAL_PARSE_LOGIC]
expression: '{$M} and 1'
replace:
- {token: '{$M}', error: 'forced operand error'}
out:
result: FAIL
---
test case: Expression '{$M} and 0'
in:
rules: [ZBX_EVAL_PARSE_USERMACRO,ZBX_EVAL_PROCESS_ERROR,ZBX_EVAL_PARSE_VAR,ZBX_EVAL_PARSE_LOGIC]
expression: '{$M} and 0'
replace:
- {token: '{$M}', error: 'forced operand error'}
out:
result: SUCCEED
value: 0
---
test case: Expression '{$M} and "a"'
in:
rules: [ZBX_EVAL_PARSE_USERMACRO,ZBX_EVAL_PROCESS_ERROR,ZBX_EVAL_PARSE_VAR,ZBX_EVAL_PARSE_LOGIC]
expression: '{$M} and "a"'
replace:
- {token: '{$M}', error: 'forced operand error'}
out:
result: FAIL
---
test case: Expression '{$M} + 2 or 1'
in:
rules: [ZBX_EVAL_PARSE_USERMACRO,ZBX_EVAL_PROCESS_ERROR,ZBX_EVAL_PARSE_VAR,ZBX_EVAL_PARSE_LOGIC,ZBX_EVAL_PARSE_MATH]
expression: '{$M} + 2 or 1'
replace:
- {token: '{$M}', error: 'forced operand error'}
out:
result: SUCCEED
value: 1
---
test case: Expression '{$M} + 2 and 0'
in:
rules: [ZBX_EVAL_PARSE_USERMACRO,ZBX_EVAL_PROCESS_ERROR,ZBX_EVAL_PARSE_VAR,ZBX_EVAL_PARSE_LOGIC,ZBX_EVAL_PARSE_MATH]
expression: '{$M} + 2 and 0'
replace:
- {token: '{$M}', error: 'forced operand error'}
out:
result: SUCCEED
value: 0
---
test case: Expression 'length("")'
in:
rules: [ZBX_EVAL_PARSE_FUNCTION,ZBX_EVAL_PARSE_GROUP,ZBX_EVAL_PARSE_VAR]
expression: 'length("")'
out:
result: SUCCEED
value: '0'
---
test case: Expression 'length("abc")'
in:
rules: [ZBX_EVAL_PARSE_FUNCTION,ZBX_EVAL_PARSE_GROUP,ZBX_EVAL_PARSE_VAR]
expression: 'length("abc")'
out:
result: SUCCEED
value: '3'
---
test case: Expression 'length(4)'
in:
rules: [ZBX_EVAL_PARSE_FUNCTION,ZBX_EVAL_PARSE_GROUP,ZBX_EVAL_PARSE_VAR]
expression: 'length(4)'
out:
result: SUCCEED
value: '1'
---
test case: Expression 'length("ы")'
in:
rules: [ZBX_EVAL_PARSE_FUNCTION,ZBX_EVAL_PARSE_GROUP,ZBX_EVAL_PARSE_VAR]
expression: 'length("ы")'
out:
result: SUCCEED
value: '1'
---
test case: Expression 'length()'
in:
rules: [ZBX_EVAL_PARSE_FUNCTION,ZBX_EVAL_PARSE_GROUP,ZBX_EVAL_PARSE_VAR]
expression: 'length()'
out:
result: FAIL
---
test case: Expression 'length(1, 2)'
in:
rules: [ZBX_EVAL_PARSE_FUNCTION,ZBX_EVAL_PARSE_GROUP,ZBX_EVAL_PARSE_VAR]
expression: 'length(1, 2)'
out:
result: FAIL
---
test case: Expression 'abs(5)'
in:
rules: [ZBX_EVAL_PARSE_FUNCTION,ZBX_EVAL_PARSE_GROUP,ZBX_EVAL_PARSE_VAR]
expression: 'abs(5)'
out:
result: SUCCEED
value: '5'
---
test case: Expression 'abs(-10)'
in:
rules: [ZBX_EVAL_PARSE_FUNCTION,ZBX_EVAL_PARSE_GROUP,ZBX_EVAL_PARSE_VAR]
expression: 'abs(-10)'
out:
result: SUCCEED
value: '10'
---
test case: Expression 'abs()'
in:
rules: [ZBX_EVAL_PARSE_FUNCTION,ZBX_EVAL_PARSE_GROUP,ZBX_EVAL_PARSE_VAR]
expression: 'abs()'
out:
result: FAIL
---
test case: Expression 'abs("xyz")'
in:
rules: [ZBX_EVAL_PARSE_FUNCTION,ZBX_EVAL_PARSE_GROUP,ZBX_EVAL_PARSE_VAR]
expression: 'abs("xyz")'
out:
result: FAIL
---
test case: Expression 'date(1)'
in:
rules: [ZBX_EVAL_PARSE_FUNCTION,ZBX_EVAL_PARSE_GROUP,ZBX_EVAL_PARSE_VAR]
expression: 'date(1)'
timezone: :Europe/Riga
time: 2020-09-01 01:02:03 +03:00
out:
result: FAIL
---
test case: Expression 'date()'
in:
rules: [ZBX_EVAL_PARSE_FUNCTION,ZBX_EVAL_PARSE_GROUP,ZBX_EVAL_PARSE_VAR]
expression: 'date()'
timezone: :Europe/Riga
time: 2020-09-01 01:02:03 +03:00
out:
result: SUCCEED
value: '20200901'
---
test case: Expression 'time(1)'
in:
rules: [ZBX_EVAL_PARSE_FUNCTION,ZBX_EVAL_PARSE_GROUP,ZBX_EVAL_PARSE_VAR]
expression: 'time(1)'
timezone: :Europe/Riga
time: 2020-09-01 01:02:03 +03:00
out:
result: FAIL
---
test case: Expression 'time()'
in:
rules: [ZBX_EVAL_PARSE_FUNCTION,ZBX_EVAL_PARSE_GROUP,ZBX_EVAL_PARSE_VAR]
expression: 'time()'
timezone: :Europe/Riga
time: 2020-09-01 01:02:03 +03:00
out:
result: SUCCEED
value: '010203'
---
test case: Expression 'now(1)'
in:
rules: [ZBX_EVAL_PARSE_FUNCTION,ZBX_EVAL_PARSE_GROUP,ZBX_EVAL_PARSE_VAR]
expression: 'now(1)'
timezone: :Europe/Riga
time: 2020-09-01 01:02:03 +03:00
out:
result: FAIL
---
test case: Expression 'now()'
in:
rules: [ZBX_EVAL_PARSE_FUNCTION,ZBX_EVAL_PARSE_GROUP,ZBX_EVAL_PARSE_VAR]
expression: 'now()'
timezone: :Europe/Riga
time: 2020-09-01 01:02:03 +03:00
out:
result: SUCCEED
value: '1598911323'
---
test case: Expression 'dayofmonth(1)'
in:
rules: [ZBX_EVAL_PARSE_FUNCTION,ZBX_EVAL_PARSE_GROUP,ZBX_EVAL_PARSE_VAR]
expression: 'dayofmonth(1)'
timezone: :Europe/Riga
time: 2020-09-01 01:02:03 +03:00
out:
result: FAIL
---
test case: Expression 'dayofmonth()'
in:
rules: [ZBX_EVAL_PARSE_FUNCTION,ZBX_EVAL_PARSE_GROUP,ZBX_EVAL_PARSE_VAR]
expression: 'dayofmonth()'
timezone: :Europe/Riga
time: 2020-09-01 01:02:03 +03:00
out:
result: SUCCEED
value: '1'
---
test case: Expression 'dayofweek(1)'
in:
rules: [ZBX_EVAL_PARSE_FUNCTION,ZBX_EVAL_PARSE_GROUP,ZBX_EVAL_PARSE_VAR]
expression: 'dayofweek(1)'
timezone: :Europe/Riga
time: 2020-09-01 01:02:03 +03:00
out:
result: FAIL
---
test case: Expression 'dayofweek()'
in:
rules: [ZBX_EVAL_PARSE_FUNCTION,ZBX_EVAL_PARSE_GROUP,ZBX_EVAL_PARSE_VAR]
expression: 'dayofweek()'
timezone: :Europe/Riga
time: 2020-09-01 01:02:03 +03:00
out:
result: SUCCEED
value: '2'
---
test case: Expression '1K'
in:
rules: [ZBX_EVAL_PARSE_FUNCTION,ZBX_EVAL_PARSE_GROUP,ZBX_EVAL_PARSE_VAR]
expression: '1K'
timezone: :Europe/Riga
time: 2020-09-01 01:02:03 +03:00
out:
result: SUCCEED
value: '1024'
---
test case: Expression '3 + 4 * 2 / ( 1 - 5 )'
in:
rules: [ZBX_EVAL_PARSE_VAR,ZBX_EVAL_PARSE_MATH,ZBX_EVAL_PARSE_GROUP]
expression: '3 + 4 * 2 / ( 1 - 5 )'
out:
result: SUCCEED
value: 1
---
test case: Expression '1 + 3*4 = 13'
in:
rules: [ZBX_EVAL_PARSE_VAR,ZBX_EVAL_PARSE_MATH,ZBX_EVAL_PARSE_GROUP,ZBX_EVAL_PARSE_COMPARE]
expression: '1 + 3*4 = 13'
out:
result: SUCCEED
value: 1
---
test case: Expression '1 + 2*4 = 13'
in:
rules: [ZBX_EVAL_PARSE_VAR,ZBX_EVAL_PARSE_MATH,ZBX_EVAL_PARSE_GROUP,ZBX_EVAL_PARSE_COMPARE]
expression: '1 + 2*4 = 13'
out:
result: SUCCEED
value: 0
---
test case: Expression '0.1+0.1 > 0.1'
in:
rules: [ZBX_EVAL_PARSE_VAR,ZBX_EVAL_PARSE_MATH,ZBX_EVAL_PARSE_GROUP,ZBX_EVAL_PARSE_COMPARE]
expression: '0.1+0.1 > 0.1'
out:
result: SUCCEED
value: 1
---
test case: Expression '.1+.1 > 0.1'
in:
rules: [ZBX_EVAL_PARSE_VAR,ZBX_EVAL_PARSE_MATH,ZBX_EVAL_PARSE_GROUP,ZBX_EVAL_PARSE_COMPARE]
expression: '.1+.1 > .1'
out:
result: SUCCEED
value: 1
---
test case: Expression '1m=60s'
in:
rules: [ZBX_EVAL_PARSE_VAR,ZBX_EVAL_PARSE_MATH,ZBX_EVAL_PARSE_GROUP,ZBX_EVAL_PARSE_COMPARE]
expression: '1m=60s'
out:
result: SUCCEED
value: 1
---
test case: Expression '1e+309<>0'
in:
rules: [ZBX_EVAL_PARSE_VAR,ZBX_EVAL_PARSE_MATH,ZBX_EVAL_PARSE_GROUP,ZBX_EVAL_PARSE_COMPARE]
expression: '1e+309<>0'
out:
result: FAIL
value: 1
---
test case: Expression '1e+309s<>0'
in:
rules: [ZBX_EVAL_PARSE_VAR,ZBX_EVAL_PARSE_MATH,ZBX_EVAL_PARSE_GROUP,ZBX_EVAL_PARSE_COMPARE]
expression: '1e+309s<>0'
out:
result: FAIL
value: 1
---
test case: Expression '1e+308<>0'
in:
rules: [ZBX_EVAL_PARSE_VAR,ZBX_EVAL_PARSE_MATH,ZBX_EVAL_PARSE_GROUP,ZBX_EVAL_PARSE_COMPARE]
expression: '1e+308<>0'
out:
result: SUCCEED
value: 1
---
test case: Expression '"a" and "b"'
in:
rules: [ZBX_EVAL_PARSE_VAR,ZBX_EVAL_PARSE_MATH,ZBX_EVAL_PARSE_GROUP,ZBX_EVAL_PARSE_LOGIC]
expression: '"a" and "b"'
out:
result: FAIL
value: 1
---
test case: Expression '1e+308K<>0'
in:
rules: [ZBX_EVAL_PARSE_VAR,ZBX_EVAL_PARSE_MATH,ZBX_EVAL_PARSE_GROUP,ZBX_EVAL_PARSE_COMPARE]
expression: '1e+308K<>0'
out:
result: FAIL
value: 1
---
test case: Expression '1e+308K<>0'
in:
rules: [ZBX_EVAL_PARSE_VAR,ZBX_EVAL_PARSE_MATH,ZBX_EVAL_PARSE_GROUP,ZBX_EVAL_PARSE_COMPARE]
expression: '1e+304K<>0'
out:
result: SUCCEED
value: 1
---
test case: Expression '{$M}=60'
in:
rules: [ZBX_EVAL_PARSE_USERMACRO,ZBX_EVAL_PARSE_VAR,ZBX_EVAL_PARSE_MATH,ZBX_EVAL_PARSE_GROUP,ZBX_EVAL_PARSE_COMPARE]
expression: '{$M}=60'
replace:
- {token: '{$M}', value: '1m'}
out:
result: SUCCEED
value: 1
---
test case: Expression '{$M}'
in:
rules: [ZBX_EVAL_PARSE_USERMACRO,ZBX_EVAL_PARSE_VAR,ZBX_EVAL_PARSE_MATH,ZBX_EVAL_PARSE_GROUP,ZBX_EVAL_PARSE_LOGIC]
expression: '{$M}'
replace:
- {token: '{$M}', value: '1m'}
out:
result: SUCCEED
value: 60
---
test case: Expression '"1" < "g"'
in:
rules: [ZBX_EVAL_PARSE_VAR,ZBX_EVAL_PARSE_MATH,ZBX_EVAL_PARSE_GROUP,ZBX_EVAL_PARSE_COMPARE]
expression: '"1" < "g"'
out:
result: FAIL
---
test case: Expression '"1" = "1.0"'
in:
rules: [ZBX_EVAL_PARSE_VAR,ZBX_EVAL_PARSE_MATH,ZBX_EVAL_PARSE_GROUP,ZBX_EVAL_PARSE_COMPARE]
expression: '"1" = "1.0"'
out:
result: SUCCEED
value: 1
---
test case: Expression 'min(2s, 1m)'
in:
rules: [ZBX_EVAL_PARSE_FUNCTION,ZBX_EVAL_PARSE_GROUP,ZBX_EVAL_PARSE_VAR]
expression: 'min(2s, 1m)'
out:
result: SUCCEED
value: '2'
---
test case: Expression 'min(2s, 1m),'
in:
rules: [ZBX_EVAL_PARSE_FUNCTION,ZBX_EVAL_PARSE_GROUP,ZBX_EVAL_PARSE_VAR]
expression: 'min(2s, 1m),'
out:
result: FAIL
value: '2'
---
test case: Expression '-60={$M}'
in:
rules: [ZBX_EVAL_PARSE_USERMACRO,ZBX_EVAL_PARSE_VAR,ZBX_EVAL_PARSE_COMPARE]
expression: '-60={$M}'
replace:
- {token: '{$M}', value: '-1m'}
out:
result: SUCCEED
value: 1
---
test case: Expression '"1m"=60s'
in:
rules: [ZBX_EVAL_PARSE_VAR,ZBX_EVAL_PARSE_COMPARE]
expression: '"1m"=60s'
out:
result: SUCCEED
value: 1
---
test case: Expression 'min("1m", 30s)'
in:
rules: [ZBX_EVAL_PARSE_FUNCTION,ZBX_EVAL_PARSE_GROUP,ZBX_EVAL_PARSE_VAR]
expression: 'min("1m", 30s)'
out:
result: SUCCEED
value: '30'
---
test case: Expression 'in(1, 2, 1)'
in:
rules: [ZBX_EVAL_PARSE_FUNCTION,ZBX_EVAL_PARSE_VAR]
expression: 'in(1,2,1)'
out:
result: SUCCEED
value: '1'
---
test case: Expression 'in(3, 2, 1)'
in:
rules: [ZBX_EVAL_PARSE_FUNCTION,ZBX_EVAL_PARSE_VAR]
expression: 'in(3, 2, 1)'
out:
result: SUCCEED
value: '0'
---
test case: Expression 'in(3, 2, 1)'
in:
rules: [ZBX_EVAL_PARSE_FUNCTION,ZBX_EVAL_PARSE_VAR]
expression: 'in(3, 2, 1)'
out:
result: SUCCEED
value: '0'
---
test case: Expression 'in("a", 3, "a", 1)'
in:
rules: [ZBX_EVAL_PARSE_FUNCTION,ZBX_EVAL_PARSE_VAR]
expression: 'in("a", 3, "a", 1)'
out:
result: SUCCEED
value: '1'
---
test case: Expression 'in("a", 3, "b", 1)'
in:
rules: [ZBX_EVAL_PARSE_FUNCTION,ZBX_EVAL_PARSE_VAR]
expression: 'in("a", 3, "b", 1)'
out:
result: SUCCEED
value: '0'
---
test case: Expression 'between(1, 1, 2)'
in:
rules: [ZBX_EVAL_PARSE_FUNCTION,ZBX_EVAL_PARSE_VAR]
expression: 'between(1, 1, 2)'
out:
result: SUCCEED
value: '1'
---
test case: Expression 'between("1", "1", "2")'
in:
rules: [ZBX_EVAL_PARSE_FUNCTION,ZBX_EVAL_PARSE_VAR]
expression: 'between("1", "1", "2")'
out:
result: SUCCEED
value: '1'
---
test case: Expression 'between("1", "a", "2")'
in:
rules: [ZBX_EVAL_PARSE_FUNCTION,ZBX_EVAL_PARSE_VAR]
expression: 'between("1", "a", "2")'
out:
result: FAIL
---
test case: Expression 'between(3, 1, 2)'
in:
rules: [ZBX_EVAL_PARSE_FUNCTION,ZBX_EVAL_PARSE_VAR]
expression: 'between(3, 1, 2)'
out:
result: SUCCEED
value: '0'
---
test case: Expression 'between(1, 1, 2, 4)'
in:
rules: [ZBX_EVAL_PARSE_FUNCTION,ZBX_EVAL_PARSE_VAR]
expression: 'between(1, 1, 2, 4)'
out:
result: FAIL
---
test case: Expression 'bitand(14, 3)'
in:
rules: [ZBX_EVAL_PARSE_FUNCTION,ZBX_EVAL_PARSE_VAR]
expression: 'bitand(14, 3)'
out:
result: SUCCEED
value: '2'
---
test case: Expression 'bitor(3, 10)'
in:
rules: [ZBX_EVAL_PARSE_FUNCTION,ZBX_EVAL_PARSE_VAR]
expression: 'bitor(3, 10)'
out:
result: SUCCEED
value: '11'
---
test case: Expression 'bitxor(14, 3)'
in:
rules: [ZBX_EVAL_PARSE_FUNCTION,ZBX_EVAL_PARSE_VAR]
expression: 'bitxor(14, 3)'
out:
result: SUCCEED
value: '13'
---
test case: Expression 'bitlshift(3, 2)'
in:
rules: [ZBX_EVAL_PARSE_FUNCTION,ZBX_EVAL_PARSE_VAR]
expression: 'bitlshift(3, 2)'
out:
result: SUCCEED
value: '12'
---
test case: Expression 'bitrshift(12, 2)'
in:
rules: [ZBX_EVAL_PARSE_FUNCTION,ZBX_EVAL_PARSE_VAR]
expression: 'bitrshift(12, 2)'
out:
result: SUCCEED
value: '3'
---
test case: Expression 'bitnot(18446744073709551602)'
in:
rules: [ZBX_EVAL_PARSE_FUNCTION,ZBX_EVAL_PARSE_VAR]
expression: 'bitnot(18446744073709551602)'
out:
result: SUCCEED
value: '13'
---
test case: Expression 'left("Zabbix", 2)'
in:
rules: [ZBX_EVAL_PARSE_FUNCTION,ZBX_EVAL_PARSE_VAR]
expression: 'left("Zabbix", 2)'
out:
result: SUCCEED
value: 'Za'
---
test case: Expression 'left("Заббикс", 2)'
in:
rules: [ZBX_EVAL_PARSE_FUNCTION,ZBX_EVAL_PARSE_VAR]
expression: 'left("Заббикс", 2)'
out:
result: SUCCEED
value: 'За'
---
test case: Expression 'left("Zabbix", 10)'
in:
rules: [ZBX_EVAL_PARSE_FUNCTION,ZBX_EVAL_PARSE_VAR]
expression: 'left("Zabbix", 10)'
out:
result: SUCCEED
value: 'Zabbix'
---
test case: Expression 'left("Zabbix", 0)'
in:
rules: [ZBX_EVAL_PARSE_FUNCTION,ZBX_EVAL_PARSE_VAR]
expression: 'left("Zabbix", 0)'
out:
result: SUCCEED
value: ''
---
test case: Expression 'left("Zabbix", -1)'
in:
rules: [ZBX_EVAL_PARSE_FUNCTION,ZBX_EVAL_PARSE_VAR]
expression: 'left("Zabbix", -1)'
out:
result: FAIL
---
test case: Expression 'left("Zabbix", 2.999999999)'
in:
rules: [ZBX_EVAL_PARSE_FUNCTION,ZBX_EVAL_PARSE_VAR]
expression: 'left("Zabbix", 2.999999999)'
out:
result: SUCCEED
value: 'Za'
---
test case: Expression 'left("Zabbix", "")'
in:
rules: [ZBX_EVAL_PARSE_FUNCTION,ZBX_EVAL_PARSE_VAR]
expression: 'left("Zabbix", "")'
out:
result: FAIL
---
test case: Expression 'left("", 1)'
in:
rules: [ZBX_EVAL_PARSE_FUNCTION,ZBX_EVAL_PARSE_VAR]
expression: 'left("", 1)'
out:
result: SUCCEED
value: ''
---
test case: Expression 'left("Zabbix", 7)'
in:
rules: [ZBX_EVAL_PARSE_FUNCTION,ZBX_EVAL_PARSE_VAR]
expression: 'left("Zabbix", 7)'
out:
result: SUCCEED
value: 'Zabbix'
---
test case: Expression 'left("Zabbix", 6)'
in:
rules: [ZBX_EVAL_PARSE_FUNCTION,ZBX_EVAL_PARSE_VAR]
expression: 'left("Zabbix", 6)'
out:
result: SUCCEED
value: 'Zabbix'
---
test case: Expression 'left("Zabbix", 5)'
in:
rules: [ZBX_EVAL_PARSE_FUNCTION,ZBX_EVAL_PARSE_VAR]
expression: 'left("Zabbix", 5)'
out:
result: SUCCEED
value: 'Zabbi'
---
test case: Expression 'left("Zabbix", 1)'
in:
rules: [ZBX_EVAL_PARSE_FUNCTION,ZBX_EVAL_PARSE_VAR]
expression: 'left("Zabbix", 1)'
out:
result: SUCCEED
value: 'Z'
---
test case: Expression 'mid("Zabbix", 3, 2)'
in:
rules: [ZBX_EVAL_PARSE_FUNCTION,ZBX_EVAL_PARSE_VAR]
expression: 'mid("Zabbix", 3, 2)'
out:
result: SUCCEED
value: 'bb'
---
test case: Expression 'mid("Zabbix", 3, 10)'
in:
rules: [ZBX_EVAL_PARSE_FUNCTION,ZBX_EVAL_PARSE_VAR]
expression: 'mid("Zabbix", 3, 10)'
out:
result: SUCCEED
value: 'bbix'
---
test case: Expression 'mid("Заббикс", 3, 10)'
in:
rules: [ZBX_EVAL_PARSE_FUNCTION,ZBX_EVAL_PARSE_VAR]
expression: 'mid("Заббикс", 3, 10)'
out:
result: SUCCEED
value: 'ббикс'
---
test case: Expression 'mid("Заббикс", 3, 2)'
in:
rules: [ZBX_EVAL_PARSE_FUNCTION,ZBX_EVAL_PARSE_VAR]
expression: 'mid("Заббикс", 3, 2)'
out:
result: SUCCEED
value: 'бб'
---
test case: Expression 'mid("Zabbix", 3, 0)'
in:
rules: [ZBX_EVAL_PARSE_FUNCTION,ZBX_EVAL_PARSE_VAR]
expression: 'mid("Zabbix", 3, 0)'
out:
result: SUCCEED
value: ''
---
test case: Expression 'mid("Zabbix", 0, 0)'
in:
rules: [ZBX_EVAL_PARSE_FUNCTION,ZBX_EVAL_PARSE_VAR]
expression: 'mid("Zabbix", 0, 0)'
out:
result: FAIL
---
test case: Expression 'mid("Zabbix", 33, 1)'
in:
rules: [ZBX_EVAL_PARSE_FUNCTION,ZBX_EVAL_PARSE_VAR]
expression: 'mid("Zabbix", 33, 1)'
out:
result: FAIL
---
test case: Expression 'mid("Zabbix", 2, 3)'
in:
rules: [ZBX_EVAL_PARSE_FUNCTION,ZBX_EVAL_PARSE_VAR]
expression: 'mid("Zabbix", 2, 3)'
out:
result: SUCCEED
value: 'abb'
---
test case: Expression 'mid("Zabbix", 2, 4)'
in:
rules: [ZBX_EVAL_PARSE_FUNCTION,ZBX_EVAL_PARSE_VAR]
expression: 'mid("Zabbix", 2, 4)'
out:
result: SUCCEED
value: 'abbi'
---
test case: Expression 'mid("Zabbix", 2, 5)'
in:
rules: [ZBX_EVAL_PARSE_FUNCTION,ZBX_EVAL_PARSE_VAR]
expression: 'mid("Zabbix", 2, 5)'
out:
result: SUCCEED
value: 'abbix'
---
test case: Expression 'mid("Zabbix", 2, 6)'
in:
rules: [ZBX_EVAL_PARSE_FUNCTION,ZBX_EVAL_PARSE_VAR]
expression: 'mid("Zabbix", 2, 6)'
out:
result: SUCCEED
value: 'abbix'
---
test case: Expression 'right("Zabbix", 2)'
in:
rules: [ZBX_EVAL_PARSE_FUNCTION,ZBX_EVAL_PARSE_VAR]
expression: 'right("Zabbix", 2)'
out:
result: SUCCEED
value: 'ix'
---
test case: Expression 'right("Zabbix", 10)'
in:
rules: [ZBX_EVAL_PARSE_FUNCTION,ZBX_EVAL_PARSE_VAR]
expression: 'right("Zabbix", 10)'
out:
result: SUCCEED
value: 'Zabbix'
---
test case: Expression 'right("Заббикс", 2)'
in:
rules: [ZBX_EVAL_PARSE_FUNCTION,ZBX_EVAL_PARSE_VAR]
expression: 'right("Заббикс", 2)'
out:
result: SUCCEED
value: 'кс'
---
test case: Expression 'right("Заббикс", 10)'
in:
rules: [ZBX_EVAL_PARSE_FUNCTION,ZBX_EVAL_PARSE_VAR]
expression: 'right("Заббикс", 10)'
out:
result: SUCCEED
value: 'Заббикс'
---
test case: Expression 'right("Zabbix", 0)'
in:
rules: [ZBX_EVAL_PARSE_FUNCTION,ZBX_EVAL_PARSE_VAR]
expression: 'right("Zabbix", 0)'
out:
result: SUCCEED
value: ''
---
test case: Expression 'right("Заббикс", 0)'
in:
rules: [ZBX_EVAL_PARSE_FUNCTION,ZBX_EVAL_PARSE_VAR]
expression: 'right("Заббикс", 0)'
out:
result: SUCCEED
value: ''
---
test case: Expression 'right("Zabbix", 7)'
in:
rules: [ZBX_EVAL_PARSE_FUNCTION,ZBX_EVAL_PARSE_VAR]
expression: 'right("Zabbix", 7)'
out:
result: SUCCEED
value: 'Zabbix'
---
test case: Expression 'right("Zabbix", 6)'
in:
rules: [ZBX_EVAL_PARSE_FUNCTION,ZBX_EVAL_PARSE_VAR]
expression: 'right("Zabbix", 6)'
out:
result: SUCCEED
value: 'Zabbix'
---
test case: Expression 'right("Zabbix", 5)'
in:
rules: [ZBX_EVAL_PARSE_FUNCTION,ZBX_EVAL_PARSE_VAR]
expression: 'right("Zabbix", 5)'
out:
result: SUCCEED
value: 'abbix'
---
test case: Expression 'right("Zabbix", 1)'
in:
rules: [ZBX_EVAL_PARSE_FUNCTION,ZBX_EVAL_PARSE_VAR]
expression: 'right("Zabbix", 1)'
out:
result: SUCCEED
value: 'x'
---
test case: Expression 'trim("zZabbixz", "z")'
in:
rules: [ZBX_EVAL_PARSE_FUNCTION,ZBX_EVAL_PARSE_VAR]
expression: 'trim("zZabbixz", "z")'
out:
result: SUCCEED
value: 'Zabbix'
---
test case: Expression 'trim("Zabbixz", "z")'
in:
rules: [ZBX_EVAL_PARSE_FUNCTION,ZBX_EVAL_PARSE_VAR]
expression: 'trim("Zabbixz", "z")'
out:
result: SUCCEED
value: 'Zabbix'
---
test case: Expression 'trim(" Zabbix ", " ")'
in:
rules: [ZBX_EVAL_PARSE_FUNCTION,ZBX_EVAL_PARSE_VAR]
expression: 'trim(" Zabbix ", " ")'
out:
result: SUCCEED
value: 'Zabbix'
---
test case: Expression 'trim(" Zabbix", " ")'
in:
rules: [ZBX_EVAL_PARSE_FUNCTION,ZBX_EVAL_PARSE_VAR]
expression: 'trim(" Zabbix", " ")'
out:
result: SUCCEED
value: 'Zabbix'
---
test case: Expression 'trim(" Zabbix ")'
in:
rules: [ZBX_EVAL_PARSE_FUNCTION,ZBX_EVAL_PARSE_VAR]
expression: 'trim(" Zabbix ")'
out:
result: SUCCEED
value: 'Zabbix'
---
test case: Expression 'trim("")'
in:
rules: [ZBX_EVAL_PARSE_FUNCTION,ZBX_EVAL_PARSE_VAR]
expression: 'trim("")'
out:
result: SUCCEED
value: ''
---
test case: Expression 'ltrim(" Zabbix ", " ")'
in:
rules: [ZBX_EVAL_PARSE_FUNCTION,ZBX_EVAL_PARSE_VAR]
expression: 'ltrim(" Zabbix ", " ")'
out:
result: SUCCEED
value: 'Zabbix '
---
test case: Expression 'rtrim(" Zabbix ", " ")'
in:
rules: [ZBX_EVAL_PARSE_FUNCTION,ZBX_EVAL_PARSE_VAR]
expression: 'rtrim(" Zabbix ", " ")'
out:
result: SUCCEED
value: ' Zabbix'
---
test case: Expression 'concat("Zabbix ", "server")'
in:
rules: [ZBX_EVAL_PARSE_FUNCTION,ZBX_EVAL_PARSE_VAR]
expression: 'concat("Zabbix ", "server")'
out:
result: SUCCEED
value: 'Zabbix server'
---
test case: Expression 'concat("", "")'
in:
rules: [ZBX_EVAL_PARSE_FUNCTION,ZBX_EVAL_PARSE_VAR]
expression: 'concat("", "")'
out:
result: SUCCEED
value: ''
---
test case: Expression 'repeat("Zabbix", 3)'
in:
rules: [ZBX_EVAL_PARSE_FUNCTION,ZBX_EVAL_PARSE_VAR]
expression: 'repeat("Zabbix", 3)'
out:
result: SUCCEED
value: 'ZabbixZabbixZabbix'
---
test case: Expression 'repeat("ZabbixЗаббикс", 2)'
in:
rules: [ZBX_EVAL_PARSE_FUNCTION,ZBX_EVAL_PARSE_VAR]
expression: 'repeat("ZabbixЗаббикс", 2)'
out:
result: SUCCEED
value: 'ZabbixЗаббиксZabbixЗаббикс'
---
test case: Expression 'repeat("Zabbix", 0)'
in:
rules: [ZBX_EVAL_PARSE_FUNCTION,ZBX_EVAL_PARSE_VAR]
expression: 'repeat("Zabbix", 0)'
out:
result: SUCCEED
value: ''
---
test case: Expression 'repeat("Zabbix", 999999)'
in:
rules: [ZBX_EVAL_PARSE_FUNCTION,ZBX_EVAL_PARSE_VAR]
expression: 'repeat("Zabbix", 999999)'
out:
result: FAIL
---
test case: Expression 'char(65)'
in:
rules: [ZBX_EVAL_PARSE_FUNCTION,ZBX_EVAL_PARSE_VAR]
expression: 'char(65)'
out:
result: SUCCEED
value: 'A'
---
test case: Expression 'char(256)'
in:
rules: [ZBX_EVAL_PARSE_FUNCTION,ZBX_EVAL_PARSE_VAR]
expression: 'char(256)'
out:
result: FAIL
---
test case: Expression 'ascii("A")'
in:
rules: [ZBX_EVAL_PARSE_FUNCTION,ZBX_EVAL_PARSE_VAR]
expression: 'ascii("A")'
out:
result: SUCCEED
value: '65'
---
test case: Expression 'ascii("Ф")'
in:
rules: [ZBX_EVAL_PARSE_FUNCTION,ZBX_EVAL_PARSE_VAR]
expression: 'ascii("Ф")'
out:
result: FAIL
---
test case: Expression 'bytelength(256)'
in:
rules: [ZBX_EVAL_PARSE_FUNCTION,ZBX_EVAL_PARSE_VAR]
expression: 'bytelength(256)'
out:
result: SUCCEED
value: '2'
---
test case: Expression 'bytelength(123123123123)'
in:
rules: [ZBX_EVAL_PARSE_FUNCTION,ZBX_EVAL_PARSE_VAR]
expression: 'bytelength(123123123123)'
out:
result: SUCCEED
value: '5'
---
test case: Expression 'bytelength("word")'
in:
rules: [ZBX_EVAL_PARSE_FUNCTION,ZBX_EVAL_PARSE_VAR]
expression: 'bytelength("word")'
out:
result: SUCCEED
value: '4'
---
test case: Expression 'bitlength(256)'
in:
rules: [ZBX_EVAL_PARSE_FUNCTION,ZBX_EVAL_PARSE_VAR]
expression: 'bitlength(256)'
out:
result: SUCCEED
value: '9'
---
test case: Expression 'bitlength(0)'
in:
rules: [ZBX_EVAL_PARSE_FUNCTION,ZBX_EVAL_PARSE_VAR]
expression: 'bitlength(0)'
out:
result: SUCCEED
value: '0'
---
test case: Expression 'bitlength("word")'
in:
rules: [ZBX_EVAL_PARSE_FUNCTION,ZBX_EVAL_PARSE_VAR]
expression: 'bitlength("word")'
out:
result: SUCCEED
value: '32'
---
test case: Expression 'insert("Zibix", 2, 2, "abb")'
in:
rules: [ZBX_EVAL_PARSE_FUNCTION,ZBX_EVAL_PARSE_VAR]
expression: 'insert("Zibix", 2, 2, "abb")'
out:
result: SUCCEED
value: 'Zabbix'
---
test case: Expression 'insert("Зибикс", 2, 2, "абб")'
in:
rules: [ZBX_EVAL_PARSE_FUNCTION,ZBX_EVAL_PARSE_VAR]
expression: 'insert("Зибикс", 2, 2, "абб")'
out:
result: SUCCEED
value: 'Заббикс'
---
test case: Expression 'insert("zabbix", 2, 2, "")'
in:
rules: [ZBX_EVAL_PARSE_FUNCTION,ZBX_EVAL_PARSE_VAR]
expression: 'insert("zabbix", 2, 2, "")'
out:
result: SUCCEED
value: 'zbix'
---
test case: Expression 'insert("", 1, 1, "zabbix")'
in:
rules: [ZBX_EVAL_PARSE_FUNCTION,ZBX_EVAL_PARSE_VAR]
expression: 'insert("", 1, 1, "zabbix")'
out:
result: FAIL
---
test case: Expression 'insert("", 0, 0, "")'
in:
rules: [ZBX_EVAL_PARSE_FUNCTION,ZBX_EVAL_PARSE_VAR]
expression: 'insert("", 0, 0, "")'
out:
result: FAIL
---
test case: Expression 'insert("Zabbix",2,33,"aaa")'
in:
rules: [ZBX_EVAL_PARSE_FUNCTION,ZBX_EVAL_PARSE_VAR]
expression: 'insert("Zabbix",2,33,"aaa")'
out:
result: FAIL
---
test case: Expression 'insert("Zbx", 3, 1, "i")'
in:
rules: [ZBX_EVAL_PARSE_FUNCTION,ZBX_EVAL_PARSE_VAR]
expression: 'insert("Zbx", 3, 1, "i")'
out:
result: SUCCEED
value: 'Zbi'
---
test case: Expression 'insert("Zbx", 2, 2, "i")'
in:
rules: [ZBX_EVAL_PARSE_FUNCTION,ZBX_EVAL_PARSE_VAR]
expression: 'insert("Zbx", 2, 2, "i")'
out:
result: SUCCEED
value: 'Zi'
---
test case: Expression 'insert("Zbx", 2, 3, "i")'
in:
rules: [ZBX_EVAL_PARSE_FUNCTION,ZBX_EVAL_PARSE_VAR]
expression: 'insert("Zbx", 2, 3, "i")'
out:
result: FAIL
---
test case: Expression 'replace("Zibix", "ibi", "abbi")'
in:
rules: [ZBX_EVAL_PARSE_FUNCTION,ZBX_EVAL_PARSE_VAR]
expression: 'replace("Zibix", "ibi", "abbi")'
out:
result: SUCCEED
value: 'Zabbix'
---
test case: Expression 'replace("Зибикс", "иби", "абби")'
in:
rules: [ZBX_EVAL_PARSE_FUNCTION,ZBX_EVAL_PARSE_VAR]
expression: 'replace("Зибикс", "иби", "абби")'
out:
result: SUCCEED
value: 'Заббикс'
---
test case: Expression 'replace("Zibix", "", "abbi")'
in:
rules: [ZBX_EVAL_PARSE_FUNCTION,ZBX_EVAL_PARSE_VAR]
expression: 'replace("Zibix", "", "abbi")'
out:
result: SUCCEED
value: 'Zibix'
---
test case: Expression 'replace("Zibix", "ibi", "")'
in:
rules: [ZBX_EVAL_PARSE_FUNCTION,ZBX_EVAL_PARSE_VAR]
expression: 'replace("Zibix", "ibi", "")'
out:
result: SUCCEED
value: 'Zx'
---
test case: Expression 'replace("", "ibi", "abbi")'
in:
rules: [ZBX_EVAL_PARSE_FUNCTION,ZBX_EVAL_PARSE_VAR]
expression: 'replace("", "ibi", "abbi")'
out:
result: SUCCEED
value: ''
---
test case: Expression 'replace("Hello Hello", "ll", "y")'
in:
rules: [ZBX_EVAL_PARSE_FUNCTION,ZBX_EVAL_PARSE_VAR]
expression: 'replace("Hello Hello", "ll", "y")'
out:
result: SUCCEED
value: 'Heyo Heyo'
---
test case: Expression 'sqrt(64)'
in:
rules: [ZBX_EVAL_PARSE_FUNCTION,ZBX_EVAL_PARSE_GROUP,ZBX_EVAL_PARSE_VAR]
expression: 'sqrt(64)'
out:
result: SUCCEED
value: 8
---
test case: Expression 'sqrt(2.5)'
in:
rules: [ZBX_EVAL_PARSE_FUNCTION,ZBX_EVAL_PARSE_GROUP,ZBX_EVAL_PARSE_VAR]
expression: 'sqrt(2.5)'
out:
result: SUCCEED
value: 1.5811388300841898
---
test case: Expression 'sqrt(0)'
in:
rules: [ZBX_EVAL_PARSE_FUNCTION,ZBX_EVAL_PARSE_GROUP,ZBX_EVAL_PARSE_VAR]
expression: 'sqrt(0)'
out:
result: SUCCEED
value: 0
---
test case: Expression 'sqrt(-1)'
in:
rules: [ZBX_EVAL_PARSE_FUNCTION,ZBX_EVAL_PARSE_GROUP,ZBX_EVAL_PARSE_VAR]
expression: 'sqrt(-1)'
out:
result: FAIL
---
test case: Expression 'abs(3.5)'
in:
rules: [ZBX_EVAL_PARSE_FUNCTION,ZBX_EVAL_PARSE_GROUP,ZBX_EVAL_PARSE_VAR]
expression: 'abs(3.5)'
out:
result: SUCCEED
value: 3.5
---
test case: Expression 'abs(-3.5)'
in:
rules: [ZBX_EVAL_PARSE_FUNCTION,ZBX_EVAL_PARSE_GROUP,ZBX_EVAL_PARSE_VAR]
expression: 'abs(-3.5)'
out:
result: SUCCEED
value: 3.5
---
test case: Expression 'cbrt(64)'
in:
rules: [ZBX_EVAL_PARSE_FUNCTION,ZBX_EVAL_PARSE_GROUP,ZBX_EVAL_PARSE_VAR]
expression: 'cbrt(64)'
out:
result: SUCCEED
value: 4
---
test case: Expression 'cbrt(63)'
in:
rules: [ZBX_EVAL_PARSE_FUNCTION,ZBX_EVAL_PARSE_GROUP,ZBX_EVAL_PARSE_VAR]
expression: 'cbrt(63)'
out:
result: SUCCEED
value: 3.9790572078963922
---
test case: Expression 'cbrt(2.5)'
in:
rules: [ZBX_EVAL_PARSE_FUNCTION,ZBX_EVAL_PARSE_GROUP,ZBX_EVAL_PARSE_VAR]
expression: 'cbrt(2.5)'
out:
result: SUCCEED
value: 1.3572088082974532
---
test case: Expression 'ceil(2)'
in:
rules: [ZBX_EVAL_PARSE_FUNCTION,ZBX_EVAL_PARSE_GROUP,ZBX_EVAL_PARSE_VAR]
expression: 'ceil(2)'
out:
result: SUCCEED
value: 2
---
test case: Expression 'ceil(2.5)'
in:
rules: [ZBX_EVAL_PARSE_FUNCTION,ZBX_EVAL_PARSE_GROUP,ZBX_EVAL_PARSE_VAR]
expression: 'ceil(2.5)'
out:
result: SUCCEED
value: 3
---
test case: Expression 'ceil(-2.5)'
in:
rules: [ZBX_EVAL_PARSE_FUNCTION,ZBX_EVAL_PARSE_GROUP,ZBX_EVAL_PARSE_VAR]
expression: 'ceil(-2.5)'
out:
result: SUCCEED
value: -2
---
test case: Expression 'e()'
in:
rules: [ZBX_EVAL_PARSE_FUNCTION,ZBX_EVAL_PARSE_GROUP,ZBX_EVAL_PARSE_VAR]
expression: 'e()'
out:
result: SUCCEED
value: 2.7182818284590451
---
test case: Expression 'e(1)'
in:
rules: [ZBX_EVAL_PARSE_FUNCTION,ZBX_EVAL_PARSE_GROUP,ZBX_EVAL_PARSE_VAR]
expression: 'e(1)'
out:
result: FAIL
---
test case: Expression 'exp(2)'
in:
rules: [ZBX_EVAL_PARSE_FUNCTION,ZBX_EVAL_PARSE_GROUP,ZBX_EVAL_PARSE_VAR]
expression: 'exp(2)'
out:
result: SUCCEED
value: 7.38905609893065
---
test case: Expression 'exp(2.5)'
in:
rules: [ZBX_EVAL_PARSE_FUNCTION,ZBX_EVAL_PARSE_GROUP,ZBX_EVAL_PARSE_VAR]
expression: 'exp(2.5)'
out:
result: SUCCEED
value: 12.182493960703473
---
test case: Expression 'expm1(2)'
in:
rules: [ZBX_EVAL_PARSE_FUNCTION,ZBX_EVAL_PARSE_GROUP,ZBX_EVAL_PARSE_VAR]
expression: 'expm1(2)'
out:
result: SUCCEED
value: 6.38905609893065
---
test case: Expression 'expm1(2.5)'
in:
rules: [ZBX_EVAL_PARSE_FUNCTION,ZBX_EVAL_PARSE_GROUP,ZBX_EVAL_PARSE_VAR]
expression: 'expm1(2.5)'
out:
result: SUCCEED
value: 11.182493960703473
---
test case: Expression 'expm1(expm1(2))'
in:
rules: [ZBX_EVAL_PARSE_FUNCTION,ZBX_EVAL_PARSE_GROUP,ZBX_EVAL_PARSE_VAR]
expression: 'expm1(expm1(2))'
out:
result: SUCCEED
value: 594.29441538075378
---
test case: Expression 'floor(2.6)'
in:
rules: [ZBX_EVAL_PARSE_FUNCTION,ZBX_EVAL_PARSE_GROUP,ZBX_EVAL_PARSE_VAR]
expression: 'floor(2.6)'
out:
result: SUCCEED
value: 2
---
test case: Expression 'floor(2)'
in:
rules: [ZBX_EVAL_PARSE_FUNCTION,ZBX_EVAL_PARSE_GROUP,ZBX_EVAL_PARSE_VAR]
expression: 'floor(2)'
out:
result: SUCCEED
value: 2
---
test case: Expression 'floor(-2.8)'
in:
rules: [ZBX_EVAL_PARSE_FUNCTION,ZBX_EVAL_PARSE_GROUP,ZBX_EVAL_PARSE_VAR]
expression: 'floor(-2.8)'
out:
result: SUCCEED
value: -3
---
test case: Expression 'log(2)'
in:
rules: [ZBX_EVAL_PARSE_FUNCTION,ZBX_EVAL_PARSE_GROUP,ZBX_EVAL_PARSE_VAR]
expression: 'log(2)'
out:
result: SUCCEED
value: 0.69314718055994529
---
test case: Expression 'log(2.5)'
in:
rules: [ZBX_EVAL_PARSE_FUNCTION,ZBX_EVAL_PARSE_GROUP,ZBX_EVAL_PARSE_VAR]
expression: 'log(2.5)'
out:
result: SUCCEED
value: 0.91629073187415511
---
test case: Expression 'log(0)'
in:
rules: [ZBX_EVAL_PARSE_FUNCTION,ZBX_EVAL_PARSE_GROUP,ZBX_EVAL_PARSE_VAR]
expression: 'log(0)'
out:
result: FAIL
value: 0
---
test case: Expression 'log10(5)'
in:
rules: [ZBX_EVAL_PARSE_FUNCTION,ZBX_EVAL_PARSE_GROUP,ZBX_EVAL_PARSE_VAR]
expression: 'log10(5)'
out:
result: SUCCEED
value: 0.69897000433601886
---
test case: Expression 'log10(0)'
in:
rules: [ZBX_EVAL_PARSE_FUNCTION,ZBX_EVAL_PARSE_GROUP,ZBX_EVAL_PARSE_VAR]
expression: 'log10(0)'
out:
result: FAIL
value: 0
---
test case: Expression 'log10(2.5)'
in:
rules: [ZBX_EVAL_PARSE_FUNCTION,ZBX_EVAL_PARSE_GROUP,ZBX_EVAL_PARSE_VAR]
expression: 'log10(2.5)'
out:
result: SUCCEED
value: 0.3979400086720376
---
test case: Expression 'pi()'
in:
rules: [ZBX_EVAL_PARSE_FUNCTION,ZBX_EVAL_PARSE_GROUP,ZBX_EVAL_PARSE_VAR]
expression: 'pi()'
out:
result: SUCCEED
value: 3.1415926535897931
---
test case: Expression 'pi(1)'
in:
rules: [ZBX_EVAL_PARSE_FUNCTION,ZBX_EVAL_PARSE_GROUP,ZBX_EVAL_PARSE_VAR]
expression: 'pi(1)'
out:
result: FAIL
---
test case: Expression 'power(2,3)'
in:
rules: [ZBX_EVAL_PARSE_FUNCTION,ZBX_EVAL_PARSE_GROUP,ZBX_EVAL_PARSE_VAR]
expression: 'power(2,3)'
out:
result: SUCCEED
value: 8
---
test case: Expression 'power(2,2.5)'
in:
rules: [ZBX_EVAL_PARSE_FUNCTION,ZBX_EVAL_PARSE_GROUP,ZBX_EVAL_PARSE_VAR]
expression: 'power(2,2.5)'
out:
result: SUCCEED
value: 5.6568542494923806
---
test case: Expression 'power(2.5,2.5)'
in:
rules: [ZBX_EVAL_PARSE_FUNCTION,ZBX_EVAL_PARSE_GROUP,ZBX_EVAL_PARSE_VAR]
expression: 'power(2.5,2.5)'
out:
result: SUCCEED
value: 9.8821176880261863
---
test case: Expression 'round(2.5482,2)'
in:
rules: [ZBX_EVAL_PARSE_FUNCTION,ZBX_EVAL_PARSE_GROUP,ZBX_EVAL_PARSE_VAR]
expression: 'round(2.5482,2)'
out:
result: SUCCEED
value: 2.55
---
test case: Expression 'round(2.5482,0)'
in:
rules: [ZBX_EVAL_PARSE_FUNCTION,ZBX_EVAL_PARSE_GROUP,ZBX_EVAL_PARSE_VAR]
expression: 'round(2.5482,0)'
out:
result: SUCCEED
value: 3
---
test case: Expression 'round(2.5482,-1)'
in:
rules: [ZBX_EVAL_PARSE_FUNCTION,ZBX_EVAL_PARSE_GROUP,ZBX_EVAL_PARSE_VAR]
expression: 'round(2.5482,-1)'
out:
result: FAIL
---
test case: Expression 'round(2.5482,1.5)'
in:
rules: [ZBX_EVAL_PARSE_FUNCTION,ZBX_EVAL_PARSE_GROUP,ZBX_EVAL_PARSE_VAR]
expression: 'round(2.5482,1.5)'
out:
result: FAIL
---
test case: Expression 'signum(-2)'
in:
rules: [ZBX_EVAL_PARSE_FUNCTION,ZBX_EVAL_PARSE_GROUP,ZBX_EVAL_PARSE_VAR]
expression: 'signum(-2)'
out:
result: SUCCEED
value: -1
---
test case: Expression 'signum(2)'
in:
rules: [ZBX_EVAL_PARSE_FUNCTION,ZBX_EVAL_PARSE_GROUP,ZBX_EVAL_PARSE_VAR]
expression: 'signum(2)'
out:
result: SUCCEED
value: 1
---
test case: Expression 'signum(2.5)'
in:
rules: [ZBX_EVAL_PARSE_FUNCTION,ZBX_EVAL_PARSE_GROUP,ZBX_EVAL_PARSE_VAR]
expression: 'signum(2.5)'
out:
result: SUCCEED
value: 1
---
test case: Expression 'signum(0)'
in:
rules: [ZBX_EVAL_PARSE_FUNCTION,ZBX_EVAL_PARSE_GROUP,ZBX_EVAL_PARSE_VAR]
expression: 'signum(0)'
out:
result: SUCCEED
value: 0
---
test case: Expression 'truncate(2.5482,2)'
in:
rules: [ZBX_EVAL_PARSE_FUNCTION,ZBX_EVAL_PARSE_GROUP,ZBX_EVAL_PARSE_VAR]
expression: 'truncate(2.5482,2)'
out:
result: SUCCEED
value: 2.54
---
test case: Expression 'truncate(2.5482,0)'
in:
rules: [ZBX_EVAL_PARSE_FUNCTION,ZBX_EVAL_PARSE_GROUP,ZBX_EVAL_PARSE_VAR]
expression: 'truncate(2.5482,0)'
out:
result: SUCCEED
value: 2
---
test case: Expression 'truncate(2.5482,-1)'
in:
rules: [ZBX_EVAL_PARSE_FUNCTION,ZBX_EVAL_PARSE_GROUP,ZBX_EVAL_PARSE_VAR]
expression: 'truncate(2.5482,-1)'
out:
result: FAIL
---
test case: Expression 'truncate(2.5482,1.5)'
in:
rules: [ZBX_EVAL_PARSE_FUNCTION,ZBX_EVAL_PARSE_GROUP,ZBX_EVAL_PARSE_VAR]
expression: 'truncate(2.5482,1.5)'
out:
result: FAIL
---
test case: Expression 'acos(0.5)'
in:
rules: [ZBX_EVAL_PARSE_FUNCTION,ZBX_EVAL_PARSE_GROUP,ZBX_EVAL_PARSE_VAR]
expression: 'acos(0.5)'
out:
result: SUCCEED
value: 1.0471975511965979
---
test case: Expression 'asin(0.5)'
in:
rules: [ZBX_EVAL_PARSE_FUNCTION,ZBX_EVAL_PARSE_GROUP,ZBX_EVAL_PARSE_VAR]
expression: 'asin(0.5)'
out:
result: SUCCEED
value: 0.52359877559829893
---
test case: Expression 'atan(1)'
in:
rules: [ZBX_EVAL_PARSE_FUNCTION,ZBX_EVAL_PARSE_GROUP,ZBX_EVAL_PARSE_VAR]
expression: 'atan(1)'
out:
result: SUCCEED
value: 0.78539816339744828
---
test case: Expression 'atan2(3,2)'
in:
rules: [ZBX_EVAL_PARSE_FUNCTION,ZBX_EVAL_PARSE_GROUP,ZBX_EVAL_PARSE_VAR]
expression: 'atan2(3,2)'
out:
result: SUCCEED
value: 0.982793723247329
---
test case: Expression 'atan2(3,2.5)'
in:
rules: [ZBX_EVAL_PARSE_FUNCTION,ZBX_EVAL_PARSE_GROUP,ZBX_EVAL_PARSE_VAR]
expression: 'atan2(3,2.5)'
out:
result: SUCCEED
value: 0.87605805059819342
---
test case: Expression 'atan2(0,0)'
in:
rules: [ZBX_EVAL_PARSE_FUNCTION,ZBX_EVAL_PARSE_GROUP,ZBX_EVAL_PARSE_VAR]
expression: 'atan2(0,0)'
out:
result: FAIL
---
test case: Expression 'cos(1)'
in:
rules: [ZBX_EVAL_PARSE_FUNCTION,ZBX_EVAL_PARSE_GROUP,ZBX_EVAL_PARSE_VAR]
expression: 'cos(1)'
out:
result: SUCCEED
value: 0.54030230586813977
---
test case: Expression 'cosh(1)'
in:
rules: [ZBX_EVAL_PARSE_FUNCTION,ZBX_EVAL_PARSE_GROUP,ZBX_EVAL_PARSE_VAR]
expression: 'cosh(1)'
out:
result: SUCCEED
value: 1.5430806348152437
---
test case: Expression 'cot(1)'
in:
rules: [ZBX_EVAL_PARSE_FUNCTION,ZBX_EVAL_PARSE_GROUP,ZBX_EVAL_PARSE_VAR]
expression: 'cot(1)'
out:
result: SUCCEED
value: 0.64209261593433076
---
test case: Expression 'cot(0)'
in:
rules: [ZBX_EVAL_PARSE_FUNCTION,ZBX_EVAL_PARSE_GROUP,ZBX_EVAL_PARSE_VAR]
expression: 'cot(0)'
out:
result: FAIL
---
test case: Expression 'degrees(1)'
in:
rules: [ZBX_EVAL_PARSE_FUNCTION,ZBX_EVAL_PARSE_GROUP,ZBX_EVAL_PARSE_VAR]
expression: 'degrees(1)'
out:
result: SUCCEED
value: 57.295779513082323
---
test case: Expression 'radians(1)'
in:
rules: [ZBX_EVAL_PARSE_FUNCTION,ZBX_EVAL_PARSE_GROUP,ZBX_EVAL_PARSE_VAR]
expression: 'radians(1)'
out:
result: SUCCEED
value: 0.017453292519943295
---
test case: Expression 'sin(1)'
in:
rules: [ZBX_EVAL_PARSE_FUNCTION,ZBX_EVAL_PARSE_GROUP,ZBX_EVAL_PARSE_VAR]
expression: 'sin(1)'
out:
result: SUCCEED
value: 0.8414709848078965
---
test case: Expression 'sinh(1)'
in:
rules: [ZBX_EVAL_PARSE_FUNCTION,ZBX_EVAL_PARSE_GROUP,ZBX_EVAL_PARSE_VAR]
expression: 'sinh(1)'
out:
result: SUCCEED
value: 1.1752011936438014
---
test case: Expression 'tan(1)'
in:
rules: [ZBX_EVAL_PARSE_FUNCTION,ZBX_EVAL_PARSE_GROUP,ZBX_EVAL_PARSE_VAR]
expression: 'tan(1)'
out:
result: SUCCEED
value: 1.5574077246549023
---
test case: Expression 'mod(5,2)'
in:
rules: [ZBX_EVAL_PARSE_FUNCTION,ZBX_EVAL_PARSE_GROUP,ZBX_EVAL_PARSE_VAR]
expression: 'mod(5,2)'
out:
result: SUCCEED
value: 1
---
test case: Expression 'mod(5.5,2)'
in:
rules: [ZBX_EVAL_PARSE_FUNCTION,ZBX_EVAL_PARSE_GROUP,ZBX_EVAL_PARSE_VAR]
expression: 'mod(5.5,2)'
out:
result: SUCCEED
value: 1.5
---
test case: Expression 'mod(-5,-2)'
in:
rules: [ZBX_EVAL_PARSE_FUNCTION,ZBX_EVAL_PARSE_GROUP,ZBX_EVAL_PARSE_VAR]
expression: 'mod(-5,-2)'
out:
result: SUCCEED
value: -1
---
test case: Expression 'mod(-5.5,2)'
in:
rules: [ZBX_EVAL_PARSE_FUNCTION,ZBX_EVAL_PARSE_GROUP,ZBX_EVAL_PARSE_VAR]
expression: 'mod(-5.5,2)'
out:
result: SUCCEED
value: -1.5
---
test case: Expression 'mod(-5.5,0)'
in:
rules: [ZBX_EVAL_PARSE_FUNCTION,ZBX_EVAL_PARSE_GROUP,ZBX_EVAL_PARSE_VAR]
expression: 'mod(-5.5,0)'
out:
result: FAIL
---
test case: Expression 'mod(123,6.253)'
in:
rules: [ZBX_EVAL_PARSE_FUNCTION,ZBX_EVAL_PARSE_GROUP,ZBX_EVAL_PARSE_VAR]
expression: 'mod(123,6.253)'
out:
result: SUCCEED
value: 4.1929999999999978
---
test case: Expression 'rand(1)'
in:
rules: [ZBX_EVAL_PARSE_FUNCTION,ZBX_EVAL_PARSE_GROUP,ZBX_EVAL_PARSE_VAR]
expression: 'rand(1)'
out:
result: FAIL
---
test case: Expression 'power(10,400)'
in:
rules: [ZBX_EVAL_PARSE_FUNCTION,ZBX_EVAL_PARSE_GROUP,ZBX_EVAL_PARSE_VAR]
expression: 'power(10,400)'
out:
result: FAIL
---
test case: Expression 'power(10,300)*power(10,300)'
in:
rules: [ZBX_EVAL_PARSE_FUNCTION,ZBX_EVAL_PARSE_GROUP,ZBX_EVAL_PARSE_VAR]
expression: 'power(10,300)*power(10,300)'
out:
result: FAIL
---
test case: Expression 'histogram_quantile(0.8, 0.1, 1, 0.2, 2, +Inf, 3)'
in:
rules: [ZBX_EVAL_PARSE_FUNCTION,ZBX_EVAL_PARSE_VAR]
expression: 'histogram_quantile(0.8, 0.1, 1, 0.2, 2, "+Inf", 3)'
out:
result: SUCCEED
value: '0.2'
---
test case: Expression 'histogram_quantile(0.8, 0.2, 10, 0.4, 20, 1.0, 60, 1.2, 70, +Inf, 80)'
in:
rules: [ZBX_EVAL_PARSE_FUNCTION,ZBX_EVAL_PARSE_VAR]
expression: 'histogram_quantile(0.8, 0.2, 10, 0.4, 20, 1.0, 60, 1.2, 70, "+Inf", 80)'
out:
result: SUCCEED
value: '1.08'
---
test case: Expression 'histogram_quantile(0.8, 0.2, 10, 0.4, 20, 1.0, 25, 1.0, 35, 1.2, 70, +Inf, 80)'
in:
rules: [ZBX_EVAL_PARSE_FUNCTION,ZBX_EVAL_PARSE_VAR]
expression: 'histogram_quantile(0.8, 0.2, 10, 0.4, 20, 1.0, 25, 1.0, 35, 1.2, 70, "+Inf", 80)'
out:
result: SUCCEED
value: '1.08'
---
test case: Expression 'histogram_quantile(0.8, 0.2, 10, 1.0, 60, 0.4, 20, 1.2, 70, +Inf, 80)'
in:
rules: [ZBX_EVAL_PARSE_FUNCTION,ZBX_EVAL_PARSE_VAR]
expression: 'histogram_quantile(0.8, 0.2, 10, 1.0, 60, 0.4, 20, 1.2, 70, "+Inf", 80)'
out:
result: SUCCEED
value: '1.08'
---
test case: Expression 'histogram_quantile(0.8, 0.1, 1)'
in:
rules: [ZBX_EVAL_PARSE_FUNCTION,ZBX_EVAL_PARSE_VAR]
expression: 'histogram_quantile(0.8, 0.1, 1)'
out:
result: FAIL
---
test case: Expression 'histogram_quantile(0.8, 0.1, 1, 0.2, 2, 0.3, 3)'
in:
rules: [ZBX_EVAL_PARSE_FUNCTION,ZBX_EVAL_PARSE_VAR]
expression: 'histogram_quantile(0.8, 0.1, 1, 0.2, 2, 0.3, 3)'
out:
result: FAIL
---
test case: Expression 'histogram_quantile(0.8, 0.2, 2, 0.1, "+Inf", 3)'
in:
rules: [ZBX_EVAL_PARSE_FUNCTION,ZBX_EVAL_PARSE_VAR]
expression: 'histogram_quantile(0.8, 0.2, 2, 0.1, "+Inf", 3)'
out:
result: FAIL
---
test case: Expression 'histogram_quantile(0.8, 0.1, 1, 0.2, 2, +Inf, 0)'
in:
rules: [ZBX_EVAL_PARSE_FUNCTION,ZBX_EVAL_PARSE_VAR]
expression: 'histogram_quantile(0.8, 0.1, 1, 0.2, 2, "+Inf", 0)'
out:
result: SUCCEED
value: '0.16000000000000003'
---
test case: Expression 'histogram_quantile(0.8, 0.1, 0, 0.2, 0, +Inf, 0)'
in:
rules: [ZBX_EVAL_PARSE_FUNCTION,ZBX_EVAL_PARSE_VAR]
expression: 'histogram_quantile(0.8, 0.1, 0, 0.2, 0, "+Inf", 0)'
out:
result: SUCCEED
value: '-1'
---
test case: Expression 'histogram_quantile(-0.1, 0.2, 10, 0.4, 20, 1.0, 60, 1.2, 70, +Inf, 80)'
in:
rules: [ZBX_EVAL_PARSE_FUNCTION,ZBX_EVAL_PARSE_VAR]
expression: 'histogram_quantile(-0.1, 0.2, 10, 0.4, 20, 1.0, 60, 1.2, 70, "+Inf", 80)'
out:
result: FAIL
---
test case: Expression 'histogram_quantile(1.1, 0.2, 10, 0.4, 20, 1.0, 60, 1.2, 70, +Inf, 80)'
in:
rules: [ZBX_EVAL_PARSE_FUNCTION,ZBX_EVAL_PARSE_VAR]
expression: 'histogram_quantile(1.1, 0.2, 10, 0.4, 20, 1.0, 60, 1.2, 70, "+Inf", 80)'
out:
result: FAIL
---
test case: Expression 'replace(0, 0, 0)'
in:
rules: [ZBX_EVAL_PARSE_FUNCTION,ZBX_EVAL_PARSE_GROUP,ZBX_EVAL_PARSE_VAR]
expression: 'replace(0, 0, 0)'
out:
result: SUCCEED
value: '0'
...