[master] 728fa08 Assume >, >=, <, <= only apply to numbers
Federico G. Schwindt
fgsch at lodoss.net
Tue Jan 27 14:57:02 CET 2015
commit 728fa08e882c5ec057a20044f4a531989d15a2ff
Author: Federico G. Schwindt <fgsch at lodoss.net>
Date: Tue Jan 27 13:39:20 2015 +0000
Assume >, >=, <, <= only apply to numbers
Partially reverts dc1059da.
diff --git a/bin/varnishtest/tests/r00956.vtc b/bin/varnishtest/tests/r00956.vtc
index d656b84..a00f001 100644
--- a/bin/varnishtest/tests/r00956.vtc
+++ b/bin/varnishtest/tests/r00956.vtc
@@ -36,9 +36,9 @@ client c1 {
expect resp.bodylen == 40
expect resp.http.fooA == 19.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.ageB .GE. 6.000
+ expect resp.http.ageB >= 6.000
delay 2
txreq
@@ -46,7 +46,7 @@ client c1 {
expect resp.bodylen == 40
expect resp.http.fooA == 19.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.ageB .GE. 8.000
+ expect resp.http.ageB >= 8.000
} -run
diff --git a/bin/varnishtest/vtc_http.c b/bin/varnishtest/vtc_http.c
index 0612397..85c3854 100644
--- a/bin/varnishtest/vtc_http.c
+++ b/bin/varnishtest/vtc_http.c
@@ -272,20 +272,12 @@ cmd_http_expect(CMD_ARGS)
// fail inequality comparisons if either side is undef'ed
retval = 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, ">")) {
- retval = strcmp(lhs, rhs) > 0;
- } else if (!strcmp(cmp, ".LT.")) {
retval = strtod(lhs, NULL) < strtod(rhs, NULL);
- } else if (!strcmp(cmp, ".GT.")) {
+ } else if (!strcmp(cmp, ">")) {
retval = strtod(lhs, NULL) > strtod(rhs, NULL);
- } else if (!strcmp(cmp, ".LE.")) {
+ } else if (!strcmp(cmp, "<=")) {
retval = strtod(lhs, NULL) <= strtod(rhs, NULL);
- } else if (!strcmp(cmp, ".GE.")) {
+ } else if (!strcmp(cmp, ">=")) {
retval = strtod(lhs, NULL) >= strtod(rhs, NULL);
}
More information about the varnish-commit
mailing list