[Scummvm-git-logs] scummvm master -> ec1ebfa248f24683c29d5008b839f1655284891a

sev- sev at scummvm.org
Sat Sep 12 10:02:18 UTC 2020


This automated email contains information about 1 new commit which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .

Summary:
ec1ebfa248 TESTBED: Test isConnectionLimited


Commit: ec1ebfa248f24683c29d5008b839f1655284891a
    https://github.com/scummvm/scummvm/commit/ec1ebfa248f24683c29d5008b839f1655284891a
Author: Henrik "Henke37" Andersson (henke at henke37.cjb.net)
Date: 2020-09-12T12:02:13+02:00

Commit Message:
TESTBED: Test isConnectionLimited

Changed paths:
  A engines/testbed/networking.cpp
  A engines/testbed/networking.h
    engines/testbed/module.mk
    engines/testbed/testbed.cpp


diff --git a/engines/testbed/module.mk b/engines/testbed/module.mk
index 4142b613c2..c1a13086d2 100644
--- a/engines/testbed/module.mk
+++ b/engines/testbed/module.mk
@@ -9,6 +9,7 @@ MODULE_OBJS := \
 	graphics.o \
 	midi.o \
 	misc.o \
+	networking.o \
 	savegame.o \
 	sound.o \
 	encoding.o \
diff --git a/engines/testbed/networking.cpp b/engines/testbed/networking.cpp
new file mode 100644
index 0000000000..86a0011836
--- /dev/null
+++ b/engines/testbed/networking.cpp
@@ -0,0 +1,56 @@
+/* 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.
+ *
+ */
+
+#include "testbed/networking.h"
+
+namespace Testbed {
+
+NetworkingTestSuite::NetworkingTestSuite() {
+	addTest("IsConnectionLimited", Networkingtests::testConnectionLimit, true);
+}
+
+TestExitStatus Networkingtests::testConnectionLimit() {
+	if (ConfParams.isSessionInteractive()) {
+		if (Testsuite::handleInteractiveInput("Testing the IsConnectionLimited API implementation", "Continue", "Skip", kOptionRight)) {
+			Testsuite::logPrintf("Info! IsConnectionLimited test skipped by the user.\n");
+			return kTestSkipped;
+		}
+
+		bool isLimited = g_system->isConnectionLimited();
+
+		if (ConfParams.isSessionInteractive()) {
+			// Directly verify date
+			Common::String status = "We expect the internet connection to be ";
+			status += (isLimited ? "limited." : "unlimited.");
+			if (Testsuite::handleInteractiveInput(status, "Correct!", "Wrong", kOptionRight)) {
+				Testsuite::logDetailedPrintf("Error! isConnectionLimited failed\n");
+				return kTestFailed;
+			}
+		}
+
+		Testsuite::logDetailedPrintf("isConnectionLimited worked\n");
+		return kTestPassed;
+	}
+	return TestExitStatus();
+}
+
+} // namespace Testbed
diff --git a/engines/testbed/networking.h b/engines/testbed/networking.h
new file mode 100644
index 0000000000..a2d21d010b
--- /dev/null
+++ b/engines/testbed/networking.h
@@ -0,0 +1,57 @@
+/* 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.
+ *
+ */
+
+#ifndef TESTBED_NETWORKING_H
+#define TESTBED_NETWORKING_H
+
+#include "testbed/testsuite.h"
+
+// This file can be used as template for header files of other newer testsuites.
+
+namespace Testbed {
+
+namespace Networkingtests {
+
+// Helper functions for Networking tests
+
+TestExitStatus testConnectionLimit();
+
+} // End of namespace Networkingtests
+
+class NetworkingTestSuite : public Testsuite {
+public:
+	NetworkingTestSuite();
+	~NetworkingTestSuite() {}
+
+	const char *getName() const {
+		return "Networking";
+	}
+
+	const char *getDescription() const {
+		return "Network and internet subsystems";
+	}
+
+};
+
+} // End of namespace Testbed
+
+#endif // TESTBED_NETWORKING_H
diff --git a/engines/testbed/testbed.cpp b/engines/testbed/testbed.cpp
index a68909b264..a8ed5e8fbd 100644
--- a/engines/testbed/testbed.cpp
+++ b/engines/testbed/testbed.cpp
@@ -37,6 +37,7 @@
 #include "testbed/graphics.h"
 #include "testbed/midi.h"
 #include "testbed/misc.h"
+#include "testbed/networking.h"
 #include "testbed/savegame.h"
 #include "testbed/sound.h"
 #include "testbed/encoding.h"
@@ -150,6 +151,9 @@ void TestbedEngine::pushTestsuites(Common::Array<Testsuite *> &testsuiteList) {
 	// Midi
 	ts = new MidiTestSuite();
 	testsuiteList.push_back(ts);
+	// Networking
+	ts = new NetworkingTestSuite();
+	testsuiteList.push_back(ts);
 #ifdef USE_TTS
 	 // TextToSpeech
 	 ts = new SpeechTestSuite();




More information about the Scummvm-git-logs mailing list