Replace wxScopedPtr with std::unique_ptr in the tests

Just use the standard class instead of the wx one, as they can be used
in exactly the same way.
This commit is contained in:
Vadim Zeitlin
2023-03-06 23:34:44 +01:00
parent 29a97bb52d
commit 363f0988cf
34 changed files with 185 additions and 152 deletions
+6 -5
View File
@@ -19,11 +19,12 @@
#include "wx/checkbox.h"
#include "wx/control.h"
#include "wx/scopedptr.h"
#include "wx/stattext.h"
#include "wx/generic/stattextg.h"
#include <memory>
namespace
{
@@ -90,14 +91,14 @@ TEST_CASE("wxControl::Label", "[wxControl][label]")
{
SECTION("wxStaticText")
{
const wxScopedPtr<wxStaticText>
const std::unique_ptr<wxStaticText>
st(new wxStaticText(wxTheApp->GetTopWindow(), wxID_ANY, ORIGINAL_LABEL));
DoTestLabel(st.get());
}
SECTION("wxStaticText/ellipsized")
{
const wxScopedPtr<wxStaticText>
const std::unique_ptr<wxStaticText>
st(new wxStaticText(wxTheApp->GetTopWindow(), wxID_ANY, ORIGINAL_LABEL,
wxDefaultPosition, wxDefaultSize,
wxST_ELLIPSIZE_START));
@@ -106,14 +107,14 @@ TEST_CASE("wxControl::Label", "[wxControl][label]")
SECTION("wxGenericStaticText")
{
const wxScopedPtr<wxGenericStaticText>
const std::unique_ptr<wxGenericStaticText>
gst(new wxGenericStaticText(wxTheApp->GetTopWindow(), wxID_ANY, ORIGINAL_LABEL));
DoTestLabel(gst.get());
}
SECTION("wxCheckBox")
{
const wxScopedPtr<wxCheckBox>
const std::unique_ptr<wxCheckBox>
cb(new wxCheckBox(wxTheApp->GetTopWindow(), wxID_ANY, ORIGINAL_LABEL));
DoTestLabel(cb.get());
}