Use smart pointer instead of manual delete in wxConfig tests

No real changes.
This commit is contained in:
Vadim Zeitlin
2021-03-09 17:00:23 +01:00
parent f5f2db8b44
commit 2e6bb341b7
2 changed files with 25 additions and 26 deletions

View File

@@ -20,6 +20,8 @@
#include "wx/msw/regconf.h"
#include "wx/scopedptr.h"
// ----------------------------------------------------------------------------
// test class
// ----------------------------------------------------------------------------
@@ -31,8 +33,8 @@ TEST_CASE("wxRegConfig::ReadWrite", "[regconfig][config][registry]")
// NOTE: we use wxCONFIG_USE_LOCAL_FILE explicitly to test wxRegConfig
// with something different from the default value wxCONFIG_USE_GLOBAL_FILE
wxConfigBase *config = new wxRegConfig(app, vendor, wxT(""), wxT(""),
wxCONFIG_USE_LOCAL_FILE);
wxScopedPtr<wxConfigBase> config(new wxRegConfig(app, vendor, wxT(""), wxT(""),
wxCONFIG_USE_LOCAL_FILE));
// test writing
config->SetPath(wxT("/group1"));
@@ -53,7 +55,6 @@ TEST_CASE("wxRegConfig::ReadWrite", "[regconfig][config][registry]")
CHECK( config->Read(wxT("group2/entry1"), wxT("INVALID DEFAULT")) == "bar" );
config->DeleteAll();
delete config;
}
TEST_CASE("wxRegKey::DeleteFromRedirectedView", "[registry][64bits]")