mirror of
https://github.com/wxWidgets/wxWidgets.git
synced 2026-09-27 10:44:21 +08:00
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:
@@ -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());
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user