[Box Backup-commit] COMMIT r3407 - box/trunk/test/bbackupd

subversion at boxbackup.org subversion at boxbackup.org
Thu Sep 18 21:28:43 BST 2014


Author: chris
Date: 2014-09-18 21:28:43 +0100 (Thu, 18 Sep 2014)
New Revision: 3407

Modified:
   box/trunk/test/bbackupd/testbbackupd.cpp
Log:
Move MockClientContext and MockBackupDaemon up in testbbackupd file

Modified: box/trunk/test/bbackupd/testbbackupd.cpp
===================================================================
--- box/trunk/test/bbackupd/testbbackupd.cpp	2014-09-18 20:28:39 UTC (rev 3406)
+++ box/trunk/test/bbackupd/testbbackupd.cpp	2014-09-18 20:28:43 UTC (rev 3407)
@@ -1096,6 +1096,69 @@
 	return (testDirId != 0);
 }
 
+class MockClientContext : public BackupClientContext
+{
+public:
+	BackupProtocolCallable& mrClient;
+	MockClientContext
+	(
+		LocationResolver &rResolver,
+		TLSContext &rTLSContext,
+		const std::string &rHostname,
+		int32_t Port,
+		uint32_t AccountNumber,
+		bool ExtendedLogging,
+		bool ExtendedLogToFile,
+		std::string ExtendedLogFile,
+		ProgressNotifier &rProgressNotifier,
+		bool TcpNiceMode,
+		BackupProtocolCallable& rClient
+	)
+	: BackupClientContext(rResolver, rTLSContext,
+		rHostname, Port, AccountNumber, ExtendedLogging,
+		ExtendedLogToFile, ExtendedLogFile,
+		rProgressNotifier, TcpNiceMode),
+	  mrClient(rClient)
+	{ }
+
+	BackupProtocolCallable &GetConnection()
+	{
+		return mrClient;
+	}
+};
+
+class MockBackupDaemon : public BackupDaemon {
+	BackupProtocolCallable& mrClient;
+
+public:
+	MockBackupDaemon(BackupProtocolCallable &rClient)
+	: mrClient(rClient)
+	{ }
+
+	std::auto_ptr<BackupClientContext> GetNewContext
+	(
+		LocationResolver &rResolver,
+		TLSContext &rTLSContext,
+		const std::string &rHostname,
+		int32_t Port,
+		uint32_t AccountNumber,
+		bool ExtendedLogging,
+		bool ExtendedLogToFile,
+		std::string ExtendedLogFile,
+		ProgressNotifier &rProgressNotifier,
+		bool TcpNiceMode
+	)
+	{
+		std::auto_ptr<BackupClientContext> context(
+			new MockClientContext(rResolver,
+				rTLSContext, rHostname, Port,
+				AccountNumber, ExtendedLogging,
+				ExtendedLogToFile, ExtendedLogFile,
+				rProgressNotifier, TcpNiceMode, mrClient));
+		return context;
+	}
+};
+
 bool test_readdirectory_on_nonexistent_dir()
 {
 	SETUP_WITH_BBSTORED();
@@ -1832,69 +1895,6 @@
 	TEARDOWN();
 }
 
-class MockClientContext : public BackupClientContext
-{
-public:
-	BackupProtocolCallable& mrClient;
-	MockClientContext
-	(
-		LocationResolver &rResolver,
-		TLSContext &rTLSContext,
-		const std::string &rHostname,
-		int32_t Port,
-		uint32_t AccountNumber,
-		bool ExtendedLogging,
-		bool ExtendedLogToFile,
-		std::string ExtendedLogFile,
-		ProgressNotifier &rProgressNotifier,
-		bool TcpNiceMode,
-		BackupProtocolCallable& rClient
-	)
-	: BackupClientContext(rResolver, rTLSContext,
-		rHostname, Port, AccountNumber, ExtendedLogging,
-		ExtendedLogToFile, ExtendedLogFile,
-		rProgressNotifier, TcpNiceMode),
-	  mrClient(rClient)
-	{ }
-
-	BackupProtocolCallable &GetConnection()
-	{
-		return mrClient;
-	}
-};
-
-class MockBackupDaemon : public BackupDaemon {
-	BackupProtocolCallable& mrClient;
-
-public:
-	MockBackupDaemon(BackupProtocolCallable &rClient)
-	: mrClient(rClient)
-	{ }
-
-	std::auto_ptr<BackupClientContext> GetNewContext
-	(
-		LocationResolver &rResolver,
-		TLSContext &rTLSContext,
-		const std::string &rHostname,
-		int32_t Port,
-		uint32_t AccountNumber,
-		bool ExtendedLogging,
-		bool ExtendedLogToFile,
-		std::string ExtendedLogFile,
-		ProgressNotifier &rProgressNotifier,
-		bool TcpNiceMode
-	)
-	{
-		std::auto_ptr<BackupClientContext> context(
-			new MockClientContext(rResolver,
-				rTLSContext, rHostname, Port,
-				AccountNumber, ExtendedLogging,
-				ExtendedLogToFile, ExtendedLogFile,
-				rProgressNotifier, TcpNiceMode, mrClient));
-		return context;
-	}
-};
-
 bool test_bbackupd_responds_to_connection_failure()
 {
 	SETUP();




More information about the Boxbackup-commit mailing list