From e04f313474f89045ca6a95a3d703e8f5eb124f20 Mon Sep 17 00:00:00 2001 From: fgerlits Date: Fri, 31 Mar 2006 19:39:09 +0000 Subject: [PATCH] updated the keyboard shortcut test to reflect the new config file format --- .../gLiveSupport/etc/keyboardShortcut.xml | 26 +++++++------------ .../gLiveSupport/src/KeyboardShortcutTest.cxx | 22 ++++++++-------- .../gLiveSupport/src/KeyboardShortcutTest.h | 2 +- .../products/gLiveSupport/src/TestRunner.cxx | 9 +++---- .../src/products/gLiveSupport/src/main.cxx | 8 +++--- 5 files changed, 29 insertions(+), 38 deletions(-) diff --git a/livesupport/src/products/gLiveSupport/etc/keyboardShortcut.xml b/livesupport/src/products/gLiveSupport/etc/keyboardShortcut.xml index d8365ed7d..c00d346ee 100644 --- a/livesupport/src/products/gLiveSupport/etc/keyboardShortcut.xml +++ b/livesupport/src/products/gLiveSupport/etc/keyboardShortcut.xml @@ -1,23 +1,17 @@ - - - - + + + + + + ]> - - hiMyNameIsWindow - - playAudio - P - - - pauseAudio - Ctrl-P - Space - + + + + diff --git a/livesupport/src/products/gLiveSupport/src/KeyboardShortcutTest.cxx b/livesupport/src/products/gLiveSupport/src/KeyboardShortcutTest.cxx index a54a020b6..e36cf2190 100644 --- a/livesupport/src/products/gLiveSupport/src/KeyboardShortcutTest.cxx +++ b/livesupport/src/products/gLiveSupport/src/KeyboardShortcutTest.cxx @@ -73,7 +73,7 @@ const std::string configFileName = "etc/keyboardShortcut.xml"; * Set up the test environment *----------------------------------------------------------------------------*/ void -KeyboardShortcutTest :: setUp(void) throw () +KeyboardShortcutTest :: setUp(void) throw (CPPUNIT_NS::Exception) { std::ifstream ifs; ifs.open(configFileName.c_str()); @@ -97,11 +97,11 @@ KeyboardShortcutTest :: setUp(void) throw () } catch (std::invalid_argument &e) { ifs.close(); - CPPUNIT_FAIL("semantic error in audio player configuration file: " + CPPUNIT_FAIL("semantic error in keyboard shortcuts configuration file: " + std::string(e.what())); } catch (xmlpp::exception &e) { ifs.close(); - CPPUNIT_FAIL("syntax error in audio player configuration file: " + CPPUNIT_FAIL("syntax error in keyboard shortcuts configuration file: " + std::string(e.what())); } ifs.close(); @@ -124,25 +124,25 @@ void KeyboardShortcutTest :: firstTest(void) throw (CPPUNIT_NS::Exception) { - CPPUNIT_ASSERT(ksc->findAction(0, GDK_P) + CPPUNIT_ASSERT(ksc->findAction(Gdk::ModifierType(0), GDK_p) == KeyboardShortcut::playAudio); - CPPUNIT_ASSERT(ksc->findAction(GDK_MOD2_MASK|GDK_LOCK_MASK, GDK_P) + CPPUNIT_ASSERT(ksc->findAction(Gdk::MOD2_MASK | Gdk::LOCK_MASK, GDK_p) == KeyboardShortcut::playAudio); - CPPUNIT_ASSERT(ksc->findAction(GDK_CONTROL_MASK, GDK_P) + CPPUNIT_ASSERT(ksc->findAction(Gdk::CONTROL_MASK, GDK_p) == KeyboardShortcut::pauseAudio); - CPPUNIT_ASSERT(ksc->findAction(0, GDK_space) - == KeyboardShortcut::pauseAudio); + CPPUNIT_ASSERT(ksc->findAction(Gdk::ModifierType(0), GDK_space) + == KeyboardShortcut::stopAudio); - CPPUNIT_ASSERT(ksc->findAction(0, GDK_Q) + CPPUNIT_ASSERT(ksc->findAction(Gdk::ModifierType(0), GDK_q) == KeyboardShortcut::noAction); - CPPUNIT_ASSERT(ksc->findAction(GDK_CONTROL_MASK, GDK_W) + CPPUNIT_ASSERT(ksc->findAction(Gdk::CONTROL_MASK, GDK_w) == KeyboardShortcut::noAction); - CPPUNIT_ASSERT(ksc->findAction(0xffffff, 0xffffff) + CPPUNIT_ASSERT(ksc->findAction(Gdk::ModifierType(0xffffff), 0xffffff) == KeyboardShortcut::noAction); } diff --git a/livesupport/src/products/gLiveSupport/src/KeyboardShortcutTest.h b/livesupport/src/products/gLiveSupport/src/KeyboardShortcutTest.h index f125d93e7..ffbd2e9bc 100644 --- a/livesupport/src/products/gLiveSupport/src/KeyboardShortcutTest.h +++ b/livesupport/src/products/gLiveSupport/src/KeyboardShortcutTest.h @@ -96,7 +96,7 @@ class KeyboardShortcutTest : public BaseTestMethod * Set up the environment for the test case. */ void - setUp(void) throw (); + setUp(void) throw (CPPUNIT_NS::Exception); /** * Clean up the environment after the test case. diff --git a/livesupport/src/products/gLiveSupport/src/TestRunner.cxx b/livesupport/src/products/gLiveSupport/src/TestRunner.cxx index 73dc13f6f..8d8ed014a 100644 --- a/livesupport/src/products/gLiveSupport/src/TestRunner.cxx +++ b/livesupport/src/products/gLiveSupport/src/TestRunner.cxx @@ -109,8 +109,6 @@ Ptr::Ref xsltFileName; /* =============================================== local function prototypes */ -namespace { - /** * Print program version. * @@ -140,7 +138,6 @@ printUsage ( const char invocation[], bool processArguments(int argc, char *argv[]); -} /* ============================================================= module code */ @@ -194,7 +191,7 @@ main( int argc, /*------------------------------------------------------------------------------ * Process command line arguments. *----------------------------------------------------------------------------*/ -static bool +bool processArguments(int argc, char *argv[]) { int i; @@ -248,7 +245,7 @@ processArguments(int argc, char *argv[]) /*------------------------------------------------------------------------------ * Print program version. *----------------------------------------------------------------------------*/ -static void +void printVersion ( std::ostream & os ) { os << PACKAGE_NAME << ' ' << PACKAGE_VERSION << std::endl @@ -260,7 +257,7 @@ printVersion ( std::ostream & os ) /*------------------------------------------------------------------------------ * Print program usage. *----------------------------------------------------------------------------*/ -static void +void printUsage ( const char invocation[], std::ostream & os ) { diff --git a/livesupport/src/products/gLiveSupport/src/main.cxx b/livesupport/src/products/gLiveSupport/src/main.cxx index e6622df6b..005b7ff0a 100644 --- a/livesupport/src/products/gLiveSupport/src/main.cxx +++ b/livesupport/src/products/gLiveSupport/src/main.cxx @@ -96,7 +96,7 @@ const struct option longOptions[] = * * @param os the std::ostream to print to. */ -static void +void printVersion ( std::ostream & os ); /** @@ -105,7 +105,7 @@ printVersion ( std::ostream & os ); * @param invocation the command line command used to invoke this program. * @param os the std::ostream to print to. */ -static void +void printUsage ( const char invocation[], std::ostream & os ); @@ -191,7 +191,7 @@ int main ( int argc, /*------------------------------------------------------------------------------ * Print program version. *----------------------------------------------------------------------------*/ -static void +void printVersion ( std::ostream & os ) { os << PACKAGE_NAME << ' ' << PACKAGE_VERSION << std::endl @@ -202,7 +202,7 @@ printVersion ( std::ostream & os ) /*------------------------------------------------------------------------------ * Print program usage. *----------------------------------------------------------------------------*/ -static void +void printUsage ( const char invocation[], std::ostream & os ) {