From 34089ca96bca2f5b68e9bf437ec7b69baa80df50 Mon Sep 17 00:00:00 2001 From: Matthias Koefferlein Date: Sun, 27 Aug 2017 00:59:08 +0200 Subject: [PATCH] Turned laySnap unit tests into a pure test for laybasic. --- src/unit_tests/laySnap.cc | 4 +--- src/ut/utTestBase.h | 17 +++++++++++++++++ 2 files changed, 18 insertions(+), 3 deletions(-) diff --git a/src/unit_tests/laySnap.cc b/src/unit_tests/laySnap.cc index ed3a45a3e..757eb5287 100644 --- a/src/unit_tests/laySnap.cc +++ b/src/unit_tests/laySnap.cc @@ -22,15 +22,13 @@ #include "laySnap.h" #include "layLayoutView.h" -#include "layApplication.h" -#include "layMainWindow.h" #include "utHead.h" TEST(1) { db::Manager mgr; - lay::LayoutView view (&mgr, lay::Application::instance ()->is_editable (), lay::MainWindow::instance ()); + lay::LayoutView view (&mgr, is_editable (), 0); int cv1 = view.create_layout ("", true, false); db::Layout &ly1 = view.cellview (cv1)->layout (); diff --git a/src/ut/utTestBase.h b/src/ut/utTestBase.h index 796475661..2ef7433ea 100644 --- a/src/ut/utTestBase.h +++ b/src/ut/utTestBase.h @@ -446,6 +446,23 @@ struct UT_PUBLIC TestBase } } +protected: + /** + * @brief Returns a value indicating whether the test runs in editable mode + */ + bool is_editable () const + { + return m_editable; + } + + /** + * @brief Returns a value indicating whether the test runs in slow mode + */ + bool is_slow () const + { + return m_slow; + } + private: virtual void execute (ut::TestBase *_this) throw (tl::Exception) = 0;