Commit 538e4617 authored by Jean-Baptiste Mardelle's avatar Jean-Baptiste Mardelle
Browse files

Fix memleak in test

parent a35fec5a
Pipeline #172374 passed with stage
in 6 minutes and 52 seconds
......@@ -4,7 +4,7 @@
TEST_CASE("Title text left alignment", "[Titler]")
{
MyTextItem *txt = new MyTextItem("Hello, world!", nullptr);
QScopedPointer<MyTextItem>txt(new MyTextItem("Hello, world!", nullptr));
txt->setAlignment(Qt::AlignLeft);
QRectF origBB = txt->boundingRect();
qreal origX = txt->x();
......@@ -20,7 +20,7 @@ TEST_CASE("Title text left alignment", "[Titler]")
TEST_CASE("Title text right alignment", "[Titler]")
{
MyTextItem *txt = new MyTextItem("Hello, world!", nullptr);
QScopedPointer<MyTextItem>txt(new MyTextItem("Hello, world!", nullptr));
txt->setAlignment(Qt::AlignRight);
QRectF origBB = txt->boundingRect();
// origX is the left edge of the txt object
......@@ -39,7 +39,7 @@ TEST_CASE("Title text right alignment", "[Titler]")
TEST_CASE("Title text center alignment", "[Titler]")
{
MyTextItem *txt = new MyTextItem("short", nullptr);
QScopedPointer<MyTextItem>txt(new MyTextItem("short", nullptr));
txt->setAlignment(Qt::AlignHCenter);
QRectF origBB = txt->boundingRect();
qreal origX = txt->x();
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment