Minor Coverity nit: Unit test leaking data if failure occurs.
BUG=None TEST=Coverity should stop complaining about this leak. Review URL: http://codereview.chromium.org/149153 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@19886 0039d316-1c4b-4281-b951-d872f2087c98
Esse commit está contido em:
@@ -1,4 +1,4 @@
|
||||
// Copyright (c) 2006-2008 The Chromium Authors. All rights reserved.
|
||||
// Copyright (c) 2009 The Chromium Authors. All rights reserved.
|
||||
// Use of this source code is governed by a BSD-style license that can be
|
||||
// found in the LICENSE file.
|
||||
|
||||
@@ -149,7 +149,7 @@ TEST(ValuesTest, StringValue) {
|
||||
// This is a Value object that allows us to tell if it's been
|
||||
// properly deleted by modifying the value of external flag on destruction.
|
||||
class DeletionTestValue : public Value {
|
||||
public:
|
||||
public:
|
||||
DeletionTestValue(bool* deletion_flag) : Value(TYPE_NULL) {
|
||||
Init(deletion_flag); // Separate function so that we can use ASSERT_*
|
||||
}
|
||||
@@ -164,7 +164,7 @@ public:
|
||||
*deletion_flag_ = true;
|
||||
}
|
||||
|
||||
private:
|
||||
private:
|
||||
bool* deletion_flag_;
|
||||
};
|
||||
|
||||
@@ -312,10 +312,10 @@ TEST(ValuesTest, DeepCopy) {
|
||||
original_list->Append(original_list_element_1);
|
||||
original_dict.Set(L"list", original_list);
|
||||
|
||||
DictionaryValue* copy_dict =
|
||||
static_cast<DictionaryValue*>(original_dict.DeepCopy());
|
||||
ASSERT_TRUE(copy_dict);
|
||||
ASSERT_NE(copy_dict, &original_dict);
|
||||
scoped_ptr<DictionaryValue> copy_dict(
|
||||
static_cast<DictionaryValue*>(original_dict.DeepCopy()));
|
||||
ASSERT_TRUE(copy_dict.get());
|
||||
ASSERT_NE(copy_dict.get(), &original_dict);
|
||||
|
||||
Value* copy_null = NULL;
|
||||
ASSERT_TRUE(copy_dict->Get(L"null", ©_null));
|
||||
@@ -408,8 +408,6 @@ TEST(ValuesTest, DeepCopy) {
|
||||
int copy_list_element_1_value;
|
||||
ASSERT_TRUE(copy_list_element_1->GetAsInteger(©_list_element_1_value));
|
||||
ASSERT_EQ(1, copy_list_element_1_value);
|
||||
|
||||
delete copy_dict;
|
||||
}
|
||||
|
||||
TEST(ValuesTest, Equals) {
|
||||
|
||||
Referência em uma Nova Issue
Bloquear um usuário