Repository: trafficserver Updated Branches: refs/heads/master 52428d22f -> 5893c89dd
TS-3287: fix broken HdrTest data Coverity CID #1196441 Project: http://git-wip-us.apache.org/repos/asf/trafficserver/repo Commit: http://git-wip-us.apache.org/repos/asf/trafficserver/commit/5893c89d Tree: http://git-wip-us.apache.org/repos/asf/trafficserver/tree/5893c89d Diff: http://git-wip-us.apache.org/repos/asf/trafficserver/diff/5893c89d Branch: refs/heads/master Commit: 5893c89ddc51d07c782253c7802073784a1ce7c9 Parents: 52428d2 Author: James Peach <[email protected]> Authored: Tue Jan 27 14:09:13 2015 -0800 Committer: James Peach <[email protected]> Committed: Tue Jan 27 14:09:13 2015 -0800 ---------------------------------------------------------------------- proxy/hdrs/HdrTest.cc | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/trafficserver/blob/5893c89d/proxy/hdrs/HdrTest.cc ---------------------------------------------------------------------- diff --git a/proxy/hdrs/HdrTest.cc b/proxy/hdrs/HdrTest.cc index eb26455..11d3e69 100644 --- a/proxy/hdrs/HdrTest.cc +++ b/proxy/hdrs/HdrTest.cc @@ -419,20 +419,18 @@ HdrTest::test_url() "/finance/external/cbsm/*http://cbs.marketwatch.com/archive/19990713/news/current/net.htx?source=blq/yhoo&dist=yhoo", "http://a.b.com/xx.jpg?newpath=http://bob.dave.com" }; - static int nstrs = sizeof(strs) / sizeof(strs[0]); static char const* bad[] = { "http://[1:2:3:4:5:6:7:8:9]", "http://1:2:3:4:5:6:7:8:A:B", "http://bob.com[::1]", - "http://[::1].com" + "http://[::1].com", "http://foo:bar:[email protected]/", "http://foo:bar:baz@[::1]:8080/", "http://]", "http://:", "http:/" }; - static int nbad = sizeof(bad) / sizeof(bad[0]); int err, failed; URL url; @@ -443,7 +441,7 @@ HdrTest::test_url() bri_box("test_url"); failed = 0; - for (i = 0; i < nstrs; i++) { + for (i = 0; i < countof(strs); i++) { old_length = (int) strlen(strs[i]); start = strs[i]; end = start + old_length; @@ -489,7 +487,7 @@ HdrTest::test_url() url.destroy(); } - for (i = 0 ; i < nbad ; ++i) { + for (i = 0 ; i < countof(bad) ; ++i) { char const* x = bad[i]; url.create(NULL); err = url.parse(x, strlen(x)); @@ -505,7 +503,7 @@ HdrTest::test_url() if (!failed) { Note("URL performance test start"); for (int j = 0 ; j < 100000 ; ++j) { - for (i = 0 ; i < nstrs ; ++i) { + for (i = 0 ; i < countof(strs) ; ++i) { char const* x = strs[i]; url.create(NULL); err = url.parse(x, strlen(x));
