Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code

Unified Diff: test/WebRequest.cpp

Issue 29391770: Noissue - Fix sign comparison warnings in tests. (Closed) Base URL: https://hg.adblockplus.org/libadblockplus/
Patch Set: Created March 22, 2017, 3:32 p.m.
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « test/ReferrerMapping.cpp ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/WebRequest.cpp
===================================================================
--- a/test/WebRequest.cpp
+++ b/test/WebRequest.cpp
@@ -119,17 +119,17 @@ TEST_F(MockWebRequestTest, ConnectionIsA
jsEngine->SetIsConnectionAllowedCallback([&isConnectionAllowedCalledTimes]()->bool
{
++isConnectionAllowedCalledTimes;
return true;
});
jsEngine->Evaluate("_webRequest.GET('http://example.com/', {X: 'Y'}, function(result) {foo = result;} )");
ASSERT_TRUE(jsEngine->Evaluate("this.foo")->IsUndefined());
AdblockPlus::Sleep(200);
- EXPECT_EQ(1u, isConnectionAllowedCalledTimes);
+ EXPECT_EQ(1, isConnectionAllowedCalledTimes);
EXPECT_EQ(AdblockPlus::WebRequest::NS_OK, jsEngine->Evaluate("foo.status")->AsInt());
EXPECT_EQ(123, jsEngine->Evaluate("foo.responseStatus")->AsInt());
EXPECT_EQ("http://example.com/\nX\nY", jsEngine->Evaluate("foo.responseText")->AsString());
EXPECT_EQ("{\"Foo\":\"Bar\"}", jsEngine->Evaluate("JSON.stringify(foo.responseHeaders)")->AsString());
}
TEST_F(MockWebRequestTest, ConnectionIsNotAllowedOnJsEngine)
{
@@ -137,17 +137,17 @@ TEST_F(MockWebRequestTest, ConnectionIsN
jsEngine->SetIsConnectionAllowedCallback([&isConnectionAllowedCalledTimes]()->bool
{
++isConnectionAllowedCalledTimes;
return false;
});
jsEngine->Evaluate("_webRequest.GET('http://example.com/', {X: 'Y'}, function(result) {foo = result;} )");
ASSERT_TRUE(jsEngine->Evaluate("this.foo")->IsUndefined());
AdblockPlus::Sleep(200);
- EXPECT_EQ(1u, isConnectionAllowedCalledTimes);
+ EXPECT_EQ(1, isConnectionAllowedCalledTimes);
EXPECT_EQ(AdblockPlus::WebRequest::NS_ERROR_CONNECTION_REFUSED, jsEngine->Evaluate("foo.status")->AsInt());
EXPECT_EQ(0, jsEngine->Evaluate("foo.responseStatus")->AsInt());
EXPECT_EQ("", jsEngine->Evaluate("foo.responseText")->AsString());
EXPECT_EQ("{}", jsEngine->Evaluate("JSON.stringify(foo.responseHeaders)")->AsString());
}
namespace
{
« no previous file with comments | « test/ReferrerMapping.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld