Commit 728fa08e authored by Federico G. Schwindt's avatar Federico G. Schwindt

Assume >, >=, <, <= only apply to numbers

Partially reverts dc1059da.
parent 0a1606e6
...@@ -36,9 +36,9 @@ client c1 { ...@@ -36,9 +36,9 @@ client c1 {
expect resp.bodylen == 40 expect resp.bodylen == 40
expect resp.http.fooA == 19.000 expect resp.http.fooA == 19.000
expect resp.http.fooB == 10.000 expect resp.http.fooB == 10.000
expect resp.http.foo .LE. 8.000 expect resp.http.foo <= 8.000
expect resp.http.ageA == 4.000 expect resp.http.ageA == 4.000
expect resp.http.ageB .GE. 6.000 expect resp.http.ageB >= 6.000
delay 2 delay 2
txreq txreq
...@@ -46,7 +46,7 @@ client c1 { ...@@ -46,7 +46,7 @@ client c1 {
expect resp.bodylen == 40 expect resp.bodylen == 40
expect resp.http.fooA == 19.000 expect resp.http.fooA == 19.000
expect resp.http.fooB == 10.000 expect resp.http.fooB == 10.000
expect resp.http.foo .LE. 6.000 expect resp.http.foo <= 6.000
expect resp.http.ageA == 4.000 expect resp.http.ageA == 4.000
expect resp.http.ageB .GE. 8.000 expect resp.http.ageB >= 8.000
} -run } -run
...@@ -272,20 +272,12 @@ cmd_http_expect(CMD_ARGS) ...@@ -272,20 +272,12 @@ cmd_http_expect(CMD_ARGS)
// fail inequality comparisons if either side is undef'ed // fail inequality comparisons if either side is undef'ed
retval = 0; retval = 0;
} else if (!strcmp(cmp, "<")) { } else if (!strcmp(cmp, "<")) {
retval = strcmp(lhs, rhs) < 0;
} else if (!strcmp(cmp, "<=")) {
retval = strcmp(lhs, rhs) <= 0;
} else if (!strcmp(cmp, ">=")) {
retval = strcmp(lhs, rhs) >= 0;
} else if (!strcmp(cmp, ">")) {
retval = strcmp(lhs, rhs) > 0;
} else if (!strcmp(cmp, ".LT.")) {
retval = strtod(lhs, NULL) < strtod(rhs, NULL); retval = strtod(lhs, NULL) < strtod(rhs, NULL);
} else if (!strcmp(cmp, ".GT.")) { } else if (!strcmp(cmp, ">")) {
retval = strtod(lhs, NULL) > strtod(rhs, NULL); retval = strtod(lhs, NULL) > strtod(rhs, NULL);
} else if (!strcmp(cmp, ".LE.")) { } else if (!strcmp(cmp, "<=")) {
retval = strtod(lhs, NULL) <= strtod(rhs, NULL); retval = strtod(lhs, NULL) <= strtod(rhs, NULL);
} else if (!strcmp(cmp, ".GE.")) { } else if (!strcmp(cmp, ">=")) {
retval = strtod(lhs, NULL) >= strtod(rhs, NULL); retval = strtod(lhs, NULL) >= strtod(rhs, NULL);
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment