Skip to content

Commit

Permalink
fix: remove ut to support DTK6.0
Browse files Browse the repository at this point in the history
Log: 移除了部分DTK6.0不支持的ut,以便通过编译,后续需要补充
  • Loading branch information
xzl01 authored and ComixHe committed Jul 7, 2023
1 parent d490659 commit 28fe139
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 4 deletions.
6 changes: 4 additions & 2 deletions tests/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,12 @@ set(WIDGET_TEST
#testcases/widgets/ut_danchors.cpp
testcases/widgets/ut_darrowbutton.cpp
testcases/widgets/ut_darrowlinedrawer.cpp
testcases/widgets/ut_darrowlineexpand.cpp
# TODO: Qt6 no longer support
#testcases/widgets/ut_darrowlineexpand.cpp
testcases/widgets/ut_darrowrectangle.cpp
testcases/widgets/ut_dbackgroundgroup.cpp
testcases/widgets/ut_dbaseexpand.cpp
# TODO: Qt6 no longer support
#testcases/widgets/ut_dbaseexpand.cpp
testcases/widgets/ut_dbaseline.cpp
testcases/widgets/ut_dblureffectwidget.cpp
testcases/widgets/ut_dboxwidget.cpp
Expand Down
3 changes: 2 additions & 1 deletion tests/testcases/widgets/ut_daboutdialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,12 @@ class ut_DAboutDialog : public testing::Test
DAboutDialog *widget = nullptr;
};

#if DTK_VERSION < DTK_VERSION_CHECK(6, 0, 0, 0) // dtk 6.0 no longer support
TEST_F(ut_DAboutDialog, setAcknowledgementLink)
{
widget->setAcknowledgementLink(QString{"setAcknowledgementLink"});
};
#endif

TEST_F(ut_DAboutDialog, setAcknowledgementVisible)
{
Expand Down Expand Up @@ -89,4 +91,3 @@ TEST_F(ut_DAboutDialog, setWindowTitle)
widget->setWindowTitle("setWindowTitle");
ASSERT_EQ(widget->windowTitle(), "setWindowTitle");
};

3 changes: 3 additions & 0 deletions tests/testcases/widgets/ut_darrowlinedrawer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,8 @@ TEST_F(ut_DArrowLineDrawer, testDArrowLineDrawerSetExpand)
// TODO
}


#if DTK_VERSION < DTK_VERSION_CHECK(6, 0, 0, 0) // dtk 6.0 no longer support
TEST_F(ut_DArrowLineDrawer, testHeaderLineAndResizeEvent)
{
DBaseLine *headerLine = drawer->headerLine();
Expand All @@ -76,3 +78,4 @@ TEST_F(ut_DArrowLineDrawer, testHeaderLineAndResizeEvent)

ASSERT_TRUE(QTest::qWaitFor([&] { return (drawer->width() == (originWidth + LoopCount)); }));
}
#endif
3 changes: 2 additions & 1 deletion tests/testcases/widgets/ut_dstyleoption.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
#include <gtest/gtest.h>
#include <DLineEdit>
#include <DApplicationHelper>
#include <DPaletteHelper>

#include "dstyleoption.h"
DWIDGET_USE_NAMESPACE
Expand Down Expand Up @@ -116,7 +117,7 @@ TEST_F(ut_DStyleOptionBackgroundGroup, init)
{
QWidget *widget = new QWidget();
target->init(widget);
ASSERT_EQ(target->palette, DApplicationHelper::instance()->palette(widget));
ASSERT_EQ(target->palette, DPaletteHelper::instance()->palette(widget));
widget->deleteLater();
};

Expand Down

0 comments on commit 28fe139

Please sign in to comment.