зеркало из https://github.com/mozilla/gecko-dev.git
Backed out changeset 1bf733f7f74d (bug 1893340) for causing build bustages on TestINIParser.cpp CLOSED TREE
This commit is contained in:
Родитель
7cd0bbaa69
Коммит
d928c1c523
|
@ -243,6 +243,7 @@ nsresult nsINIParser::DeleteString(const char* aSection, const char* aKey) {
|
|||
mSections.Remove(aSection);
|
||||
} else {
|
||||
mSections.InsertOrUpdate(aSection, std::move(val->next));
|
||||
delete val;
|
||||
}
|
||||
return NS_OK;
|
||||
}
|
||||
|
|
|
@ -1,48 +0,0 @@
|
|||
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
||||
/* This Source Code Form is subject to the terms of the Mozilla Public
|
||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
||||
|
||||
#include "nsCOMPtr.h"
|
||||
#include "gtest/gtest.h"
|
||||
|
||||
#include "nsINIParser.h"
|
||||
|
||||
TEST(INIParser, DeleteString)
|
||||
{
|
||||
nsINIParser* parser = new nsINIParser();
|
||||
nsresult rv = parser->InitFromString(
|
||||
"[sec1]\r\
|
||||
key1=val1\r\
|
||||
key2=val2\r\
|
||||
key3=val3\r\
|
||||
key4=val4\r\
|
||||
\r\
|
||||
[sec2]\r\
|
||||
key=val\r\
|
||||
[sec3]\r\
|
||||
key=val\r\
|
||||
[sec4]\r\
|
||||
key=val"_ns);
|
||||
EXPECT_NS_SUCCEEDED(rv);
|
||||
|
||||
rv = parser->DeleteString("sec1", "key3");
|
||||
EXPECT_NS_SUCCEEDED(rv);
|
||||
rv = parser->DeleteString("sec1", "key4");
|
||||
EXPECT_NS_SUCCEEDED(rv);
|
||||
rv = parser->DeleteString("sec1", "key1");
|
||||
EXPECT_NS_SUCCEEDED(rv);
|
||||
rv = parser->DeleteString("sec1", "key2");
|
||||
EXPECT_NS_SUCCEEDED(rv);
|
||||
|
||||
rv = parser->DeleteSection("sec3");
|
||||
EXPECT_NS_SUCCEEDED(rv);
|
||||
rv = parser->DeleteSection("sec4");
|
||||
EXPECT_NS_SUCCEEDED(rv);
|
||||
rv = parser->DeleteSection("sec1");
|
||||
EXPECT_NS_SUCCEEDED(rv);
|
||||
rv = parser->DeleteSection("sec2");
|
||||
EXPECT_NS_SUCCEEDED(rv);
|
||||
|
||||
delete parser;
|
||||
}
|
|
@ -26,7 +26,6 @@ UNIFIED_SOURCES += [
|
|||
"TestGCPostBarriers.cpp",
|
||||
"TestID.cpp",
|
||||
"TestIDUtils.cpp",
|
||||
"TestINIParser.cpp",
|
||||
"TestInputStreamLengthHelper.cpp",
|
||||
"TestJSHolderMap.cpp",
|
||||
"TestLogCommandLineHandler.cpp",
|
||||
|
|
Загрузка…
Ссылка в новой задаче