Index: test/JsEngine.cpp |
=================================================================== |
--- a/test/JsEngine.cpp |
+++ b/test/JsEngine.cpp |
@@ -23,19 +23,19 @@ |
class JsEngineTest : public BaseJsTest |
{ |
}; |
} |
TEST_F(JsEngineTest, Evaluate) |
{ |
jsEngine->Evaluate("function hello() { return 'Hello'; }"); |
- AdblockPlus::JsValuePtr result = jsEngine->Evaluate("hello()"); |
- ASSERT_TRUE(result->IsString()); |
- ASSERT_EQ("Hello", result->AsString()); |
+ auto result = jsEngine->Evaluate("hello()"); |
+ ASSERT_TRUE(result.IsString()); |
+ ASSERT_EQ("Hello", result.AsString()); |
} |
TEST_F(JsEngineTest, RuntimeExceptionIsThrown) |
{ |
ASSERT_THROW(jsEngine->Evaluate("doesnotexist()"), std::runtime_error); |
} |
TEST_F(JsEngineTest, CompileTimeExceptionIsThrown) |
@@ -162,13 +162,13 @@ |
jsEngine->SetWebRequest(webRequest); |
ASSERT_EQ(webRequest, jsEngine->GetWebRequest()); |
} |
TEST(NewJsEngineTest, GlobalPropertyTest) |
{ |
AdblockPlus::JsEnginePtr jsEngine(AdblockPlus::JsEngine::New()); |
jsEngine->SetGlobalProperty("foo", jsEngine->NewValue("bar")); |
- AdblockPlus::JsValuePtr foo = jsEngine->Evaluate("foo"); |
- ASSERT_TRUE(foo->IsString()); |
- ASSERT_EQ(foo->AsString(), "bar"); |
+ auto foo = jsEngine->Evaluate("foo"); |
+ ASSERT_TRUE(foo.IsString()); |
+ ASSERT_EQ(foo.AsString(), "bar"); |
} |