Fixed some unit tests

This commit is contained in:
Matthias Koefferlein 2022-06-12 14:00:06 +02:00
parent 51be84ebc1
commit 5aa9f5ba13
2 changed files with 6 additions and 2 deletions

View File

@ -783,7 +783,7 @@ bool
Action::is_checked () const
{
#if defined(HAVE_QT)
return qaction () && qaction ()->isChecked ();
return qaction () ? qaction ()->isChecked () : m_checked;
#else
return m_checked;
#endif
@ -792,7 +792,11 @@ Action::is_checked () const
bool
Action::is_enabled () const
{
#if defined(HAVE_QT)
return qaction () ? qaction ()->isEnabled () : m_enabled;
#else
return m_enabled;
#endif
}
bool

View File

@ -218,7 +218,7 @@ RESULT
assert_equal( menu.is_separator?( "file_menu.sep" ), true )
assert_equal( menu.action( "file_menu.#0" ).title, "New title" )
assert_equal( menu.action( "file_menu.#0" ).shortcut, "Ctrl+Shift+F7" )
assert_equal( menu.action( "file_menu.#0" ).shortcut, "Shift+Ctrl+F7" )
assert_equal( menu.action( "file_menu.#3" ).icon_text, "X" )
assert_equal( menu.action( "my_menu.new_item" ).is_visible?, true )
assert_equal( menu.action( "file_menu.#3" ).is_checked?, false )