Use wxScopedPtr instead of manual delete in wxSpinCtrlDouble test

No real changes.
This commit is contained in:
Vadim Zeitlin
2021-04-25 16:45:39 +01:00
parent 5ab5172930
commit c177e006fc

View File

@@ -224,11 +224,18 @@ TEST_CASE_METHOD(SpinCtrlDoubleTestCase,
static inline unsigned int GetInitialDigits(double inc) static inline unsigned int GetInitialDigits(double inc)
{ {
wxSpinCtrlDouble* sc = new wxSpinCtrlDouble(wxTheApp->GetTopWindow(), wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, wxSP_ARROW_KEYS, wxScopedPtr<wxSpinCtrlDouble> sc(new wxSpinCtrlDouble
0, 50, 0, inc); (
unsigned int digits = sc->GetDigits(); wxTheApp->GetTopWindow(),
delete sc; wxID_ANY,
return digits; wxEmptyString,
wxDefaultPosition,
wxDefaultSize,
wxSP_ARROW_KEYS,
0, 50, 0,
inc
));
return sc->GetDigits();
} }
TEST_CASE("SpinCtrlDouble::InitialDigits", "[spinctrldouble][initialdigits]") TEST_CASE("SpinCtrlDouble::InitialDigits", "[spinctrldouble][initialdigits]")