[Scummvm-cvs-logs] SF.net SVN: scummvm:[50459] scummvm/branches/gsoc2010-testbed/engines/ testbed

sud03r at users.sourceforge.net sud03r at users.sourceforge.net
Mon Jun 28 22:55:28 CEST 2010


Revision: 50459
          http://scummvm.svn.sourceforge.net/scummvm/?rev=50459&view=rev
Author:   sud03r
Date:     2010-06-28 20:55:28 +0000 (Mon, 28 Jun 2010)

Log Message:
-----------
added template code for testing events

Modified Paths:
--------------
    scummvm/branches/gsoc2010-testbed/engines/testbed/misc.cpp
    scummvm/branches/gsoc2010-testbed/engines/testbed/module.mk

Added Paths:
-----------
    scummvm/branches/gsoc2010-testbed/engines/testbed/events.cpp
    scummvm/branches/gsoc2010-testbed/engines/testbed/events.h

Added: scummvm/branches/gsoc2010-testbed/engines/testbed/events.cpp
===================================================================
--- scummvm/branches/gsoc2010-testbed/engines/testbed/events.cpp	                        (rev 0)
+++ scummvm/branches/gsoc2010-testbed/engines/testbed/events.cpp	2010-06-28 20:55:28 UTC (rev 50459)
@@ -0,0 +1,58 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ * $URL$
+ * $Id$
+ */
+
+#include "common/events.h"
+
+#include "testbed/events.h"
+
+namespace Testbed {
+
+bool EventTests::mouseEvents() {
+	Common::EventManager *eventMan = g_system->getEventManager();
+
+	bool quitLoop = false;
+	Common::Event event;
+	while (!quitLoop) {
+		while (eventMan->pollEvent(event)) {
+			switch (event.type) {
+				// handle all mouse events
+				// TODO: tommorrow
+				default:
+				break;
+			}
+
+		}
+	}
+
+	return true;
+}
+
+EventTestSuite::EventTestSuite() {
+	addTest("Mouse Events", &EventTests::mouseEvents);
+}
+const char *EventTestSuite::getName() const {
+	return "Events";
+}
+
+} // End of namespace Testbed


Property changes on: scummvm/branches/gsoc2010-testbed/engines/testbed/events.cpp
___________________________________________________________________
Added: svn:mime-type
   + text/plain
Added: svn:keywords
   + Date Rev Author URL Id
Added: svn:eol-style
   + native

Added: scummvm/branches/gsoc2010-testbed/engines/testbed/events.h
===================================================================
--- scummvm/branches/gsoc2010-testbed/engines/testbed/events.h	                        (rev 0)
+++ scummvm/branches/gsoc2010-testbed/engines/testbed/events.h	2010-06-28 20:55:28 UTC (rev 50459)
@@ -0,0 +1,61 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ * $URL$
+ * $Id$
+ */
+
+#ifndef TESTBED_EVENTS_H
+#define TESTBED_EVENTS_H
+
+#include "testbed/testsuite.h"
+
+
+namespace Testbed {
+
+namespace EventTests {
+
+// Helper functions for Event tests
+
+// will contain function declarations for Event tests
+bool mouseEvents();
+bool keybdEvents();
+// add more here
+}
+
+class EventTestSuite : public Testsuite {
+public:
+	/**
+	 * The constructor for the EventTestSuite
+	 * For every test to be executed one must:
+	 * 1) Create a function that would invoke the test
+	 * 2) Add that test to list by executing addTest()
+	 *
+	 * @see addTest()
+	 */
+	EventTestSuite();
+	~EventTestSuite(){}
+	const char *getName() const;
+
+};
+
+}	// End of namespace Testbed
+
+#endif


Property changes on: scummvm/branches/gsoc2010-testbed/engines/testbed/events.h
___________________________________________________________________
Added: svn:mime-type
   + text/plain
Added: svn:keywords
   + Date Rev Author URL Id
Added: svn:eol-style
   + native

Modified: scummvm/branches/gsoc2010-testbed/engines/testbed/misc.cpp
===================================================================
--- scummvm/branches/gsoc2010-testbed/engines/testbed/misc.cpp	2010-06-28 20:41:08 UTC (rev 50458)
+++ scummvm/branches/gsoc2010-testbed/engines/testbed/misc.cpp	2010-06-28 20:55:28 UTC (rev 50459)
@@ -39,7 +39,7 @@
 	// Increment arg which actually points to an int
 	// arg must point to a static data, threads otherwise have their own stack
 	int &valToModify = *((int *) arg);
-	valToModify = 999; // some arrbit value
+	valToModify = 999; // some arbitrary value
 }
 
 void MiscTests::criticalSection(void *arg) {

Modified: scummvm/branches/gsoc2010-testbed/engines/testbed/module.mk
===================================================================
--- scummvm/branches/gsoc2010-testbed/engines/testbed/module.mk	2010-06-28 20:41:08 UTC (rev 50458)
+++ scummvm/branches/gsoc2010-testbed/engines/testbed/module.mk	2010-06-28 20:55:28 UTC (rev 50459)
@@ -2,6 +2,7 @@
  
 MODULE_OBJS := \
 	detection.o \
+	events.o \
 	fs.o \
 	graphics.o \
 	misc.o \


This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.




More information about the Scummvm-git-logs mailing list