[Box Backup-commit] COMMIT r3353 - in box/trunk: lib/server test/backupstore test/bbackupd

subversion at boxbackup.org subversion at boxbackup.org
Fri Aug 15 23:47:17 BST 2014


Author: chris
Date: 2014-08-15 23:47:17 +0100 (Fri, 15 Aug 2014)
New Revision: 3353

Removed:
   box/trunk/lib/server/ServerException.h
Modified:
   box/trunk/lib/server/Daemon.cpp
   box/trunk/lib/server/Protocol.cpp
   box/trunk/lib/server/ProtocolUncertainStream.cpp
   box/trunk/lib/server/SSLLib.cpp
   box/trunk/lib/server/Socket.cpp
   box/trunk/lib/server/SocketListen.h
   box/trunk/lib/server/SocketStream.cpp
   box/trunk/lib/server/SocketStreamTLS.cpp
   box/trunk/lib/server/TLSContext.cpp
   box/trunk/lib/server/WinNamedPipeListener.h
   box/trunk/lib/server/WinNamedPipeStream.cpp
   box/trunk/lib/server/makeprotocol.pl.in
   box/trunk/test/backupstore/testbackupstore.cpp
   box/trunk/test/bbackupd/testbbackupd.cpp
Log:
Remove ServerException.h and the exception code aliases that it defines.

We don't really need these, so clean up by removing them.

Modified: box/trunk/lib/server/Daemon.cpp
===================================================================
--- box/trunk/lib/server/Daemon.cpp	2014-08-15 22:47:14 UTC (rev 3352)
+++ box/trunk/lib/server/Daemon.cpp	2014-08-15 22:47:17 UTC (rev 3353)
@@ -36,12 +36,13 @@
 #	include "BoxVersion.h"
 #endif
 
+#include "autogen_ConnectionException.h"
+#include "autogen_ServerException.h"
 #include "Configuration.h"
 #include "Daemon.h"
 #include "FileModificationTime.h"
 #include "Guards.h"
 #include "Logging.h"
-#include "ServerException.h"
 #include "UnixUser.h"
 #include "Utils.h"
 

Modified: box/trunk/lib/server/Protocol.cpp
===================================================================
--- box/trunk/lib/server/Protocol.cpp	2014-08-15 22:47:14 UTC (rev 3352)
+++ box/trunk/lib/server/Protocol.cpp	2014-08-15 22:47:17 UTC (rev 3353)
@@ -17,10 +17,11 @@
 
 #include <new>
 
+#include "autogen_ConnectionException.h"
+#include "autogen_ServerException.h"
 #include "Protocol.h"
 #include "ProtocolWire.h"
 #include "SocketStream.h"
-#include "ServerException.h"
 #include "PartialReadStream.h"
 #include "ProtocolUncertainStream.h"
 #include "Logging.h"
@@ -117,7 +118,7 @@
 		int bytesRead = mapConn->Read(readInto, bytesToRead, mTimeout);
 		if(bytesRead == 0)
 		{
-			THROW_EXCEPTION(ConnectionException, Conn_Protocol_Timeout)
+			THROW_EXCEPTION(ConnectionException, Protocol_Timeout)
 		}
 		readInto += bytesRead;
 		bytesToRead -= bytesRead;
@@ -127,7 +128,7 @@
 	// Are they the same?
 	if(::memcmp(&hsSend, &hsReceive, sizeof(hsSend)) != 0)
 	{
-		THROW_EXCEPTION(ConnectionException, Conn_Protocol_HandshakeFailed)
+		THROW_EXCEPTION(ConnectionException, Protocol_HandshakeFailed)
 	}
 
 	// Mark as done
@@ -161,7 +162,7 @@
 	if(!mapConn->ReadFullBuffer(hdr, sizeof(PW_ObjectHeader),
 		0 /* not interested in bytes read if this fails */, mTimeout))
 	{
-		THROW_EXCEPTION(ConnectionException, Conn_Protocol_Timeout)
+		THROW_EXCEPTION(ConnectionException, Protocol_Timeout)
 	}
 }
 
@@ -184,7 +185,7 @@
 	// Hope it's not a stream
 	if(ntohl(objHeader.mObjType) == SPECIAL_STREAM_OBJECT_TYPE)
 	{
-		THROW_EXCEPTION(ConnectionException, Conn_Protocol_StreamWhenObjExpected)
+		THROW_EXCEPTION(ConnectionException, Protocol_StreamWhenObjExpected)
 	}
 	
 	// Check the object size
@@ -191,7 +192,7 @@
 	u_int32_t objSize = ntohl(objHeader.mObjSize);
 	if(objSize < sizeof(objHeader) || objSize > mMaxObjectSize)
 	{
-		THROW_EXCEPTION(ConnectionException, Conn_Protocol_ObjTooBig)
+		THROW_EXCEPTION(ConnectionException, Protocol_ObjTooBig)
 	}
 
 	// Create a blank object
@@ -204,7 +205,7 @@
 	if(!mapConn->ReadFullBuffer(mpBuffer, objSize - sizeof(objHeader),
 		0 /* not interested in bytes read if this fails */, mTimeout))
 	{
-		THROW_EXCEPTION(ConnectionException, Conn_Protocol_Timeout)
+		THROW_EXCEPTION(ConnectionException, Protocol_Timeout)
 	}
 
 	// Setup ready to read out data from the buffer
@@ -234,7 +235,7 @@
 	// Exception if not all the data was consumed
 	if(dataLeftOver)
 	{
-		THROW_EXCEPTION(ConnectionException, Conn_Protocol_BadCommandRecieved)
+		THROW_EXCEPTION(ConnectionException, Protocol_BadCommandRecieved)
 	}
 
 	return obj;
@@ -349,7 +350,7 @@
 #define READ_CHECK_BYTES_AVAILABLE(bytesRequired)								\
 	if((mReadOffset + (int)(bytesRequired)) > mValidDataSize)					\
 	{																			\
-		THROW_EXCEPTION(ConnectionException, Conn_Protocol_BadCommandRecieved)	\
+		THROW_EXCEPTION(ConnectionException, Protocol_BadCommandRecieved)	\
 	}
 
 // --------------------------------------------------------------------------
@@ -636,7 +637,7 @@
 	// Hope it's not an object
 	if(ntohl(objHeader.mObjType) != SPECIAL_STREAM_OBJECT_TYPE)
 	{
-		THROW_EXCEPTION(ConnectionException, Conn_Protocol_ObjWhenStreamExpected)
+		THROW_EXCEPTION(ConnectionException, Protocol_ObjWhenStreamExpected)
 	}
 	
 	// Get the stream size
@@ -764,7 +765,7 @@
 		// Fixed size stream, send it all in one go
 		if(!rStream.CopyStreamTo(*mapConn, mTimeout, 4096 /* slightly larger buffer */))
 		{
-			THROW_EXCEPTION(ConnectionException, Conn_Protocol_TimeOutWhenSendingStream)
+			THROW_EXCEPTION(ConnectionException, Protocol_TimeOutWhenSendingStream)
 		}
 	}
 	// Make sure everything is written

Modified: box/trunk/lib/server/ProtocolUncertainStream.cpp
===================================================================
--- box/trunk/lib/server/ProtocolUncertainStream.cpp	2014-08-15 22:47:14 UTC (rev 3352)
+++ box/trunk/lib/server/ProtocolUncertainStream.cpp	2014-08-15 22:47:17 UTC (rev 3353)
@@ -8,8 +8,9 @@
 // --------------------------------------------------------------------------
 
 #include "Box.h"
+#include "autogen_ConnectionException.h"
+#include "autogen_ServerException.h"
 #include "ProtocolUncertainStream.h"
-#include "ServerException.h"
 #include "Protocol.h"
 
 #include "MemLeakFindOn.h"

Modified: box/trunk/lib/server/SSLLib.cpp
===================================================================
--- box/trunk/lib/server/SSLLib.cpp	2014-08-15 22:47:14 UTC (rev 3352)
+++ box/trunk/lib/server/SSLLib.cpp	2014-08-15 22:47:17 UTC (rev 3353)
@@ -18,9 +18,10 @@
 	#include <wincrypt.h>
 #endif
 
+#include "autogen_ConnectionException.h"
+#include "autogen_ServerException.h"
 #include "CryptoUtils.h"
 #include "SSLLib.h"
-#include "ServerException.h"
 
 #include "MemLeakFindOn.h"
 

Deleted: box/trunk/lib/server/ServerException.h
===================================================================
--- box/trunk/lib/server/ServerException.h	2014-08-15 22:47:14 UTC (rev 3352)
+++ box/trunk/lib/server/ServerException.h	2014-08-15 22:47:17 UTC (rev 3353)
@@ -1,46 +0,0 @@
-// --------------------------------------------------------------------------
-//
-// File
-//		Name:    ServerException.h
-//		Purpose: Exception
-//		Created: 2003/07/08
-//
-// --------------------------------------------------------------------------
-
-#ifndef SERVEREXCEPTION__H
-#define SERVEREXCEPTION__H
-
-// Compatibility header
-#include "autogen_ServerException.h"
-#include "autogen_ConnectionException.h"
-
-// Rename old connection exception names to new names without Conn_ prefix
-// This is all because ConnectionException used to be derived from ServerException
-// with some funky magic with subtypes. Perhaps a little unreliable, and the
-// usefulness of it never really was used.
-#define Conn_SocketWriteError			SocketWriteError	
-#define Conn_SocketReadError			SocketReadError	
-#define Conn_SocketNameLookupError		SocketNameLookupError
-#define Conn_SocketShutdownError		SocketShutdownError
-#define Conn_SocketConnectError			SocketConnectError	
-#define Conn_TLSHandshakeFailed			TLSHandshakeFailed	
-#define Conn_TLSShutdownFailed			TLSShutdownFailed	
-#define Conn_TLSWriteFailed				TLSWriteFailed		
-#define Conn_TLSReadFailed				TLSReadFailed		
-#define Conn_TLSNoPeerCertificate		TLSNoPeerCertificate
-#define Conn_TLSPeerCertificateInvalid	TLSPeerCertificateInvalid
-#define Conn_TLSClosedWhenWriting		TLSClosedWhenWriting
-#define Conn_TLSHandshakeTimedOut		TLSHandshakeTimedOut
-#define Conn_Protocol_Timeout			Protocol_Timeout	
-#define Conn_Protocol_ObjTooBig			Protocol_ObjTooBig	
-#define Conn_Protocol_BadCommandRecieved			Protocol_BadCommandRecieved	
-#define Conn_Protocol_UnknownCommandRecieved		Protocol_UnknownCommandRecieved
-#define Conn_Protocol_TriedToExecuteReplyCommand	Protocol_TriedToExecuteReplyCommand
-#define Conn_Protocol_UnexpectedReply				Protocol_UnexpectedReply		
-#define Conn_Protocol_HandshakeFailed				Protocol_HandshakeFailed		
-#define Conn_Protocol_StreamWhenObjExpected			Protocol_StreamWhenObjExpected	
-#define Conn_Protocol_ObjWhenStreamExpected			Protocol_ObjWhenStreamExpected	
-#define Conn_Protocol_TimeOutWhenSendingStream		Protocol_TimeOutWhenSendingStream
-
-#endif // SERVEREXCEPTION__H
-

Modified: box/trunk/lib/server/Socket.cpp
===================================================================
--- box/trunk/lib/server/Socket.cpp	2014-08-15 22:47:14 UTC (rev 3352)
+++ box/trunk/lib/server/Socket.cpp	2014-08-15 22:47:17 UTC (rev 3353)
@@ -24,8 +24,9 @@
 #include <string.h>
 #include <stdio.h>
 
+#include "autogen_ConnectionException.h"
+#include "autogen_ServerException.h"
 #include "Socket.h"
-#include "ServerException.h"
 
 #include "MemLeakFindOn.h"
 
@@ -69,12 +70,12 @@
 				}
 				else
 				{
-					THROW_EXCEPTION(ConnectionException, Conn_SocketNameLookupError);
+					THROW_EXCEPTION(ConnectionException, SocketNameLookupError);
 				}
 			}
 			else
 			{
-				THROW_EXCEPTION(ConnectionException, Conn_SocketNameLookupError);
+				THROW_EXCEPTION(ConnectionException, SocketNameLookupError);
 			}
 		}
 		break;

Modified: box/trunk/lib/server/SocketListen.h
===================================================================
--- box/trunk/lib/server/SocketListen.h	2014-08-15 22:47:14 UTC (rev 3352)
+++ box/trunk/lib/server/SocketListen.h	2014-08-15 22:47:17 UTC (rev 3353)
@@ -29,8 +29,9 @@
 #include <memory>
 #include <string>
 
+#include "autogen_ConnectionException.h"
+#include "autogen_ServerException.h"
 #include "Socket.h"
-#include "ServerException.h"
 
 #include "MemLeakFindOn.h"
 

Modified: box/trunk/lib/server/SocketStream.cpp
===================================================================
--- box/trunk/lib/server/SocketStream.cpp	2014-08-15 22:47:14 UTC (rev 3352)
+++ box/trunk/lib/server/SocketStream.cpp	2014-08-15 22:47:17 UTC (rev 3353)
@@ -29,8 +29,9 @@
 	#include <bsd/unistd.h>
 #endif
 
+#include "autogen_ConnectionException.h"
+#include "autogen_ServerException.h"
 #include "SocketStream.h"
-#include "ServerException.h"
 #include "CommonException.h"
 #include "Socket.h"
 
@@ -184,7 +185,7 @@
 #endif // WIN32
 
 		mSocketHandle = INVALID_SOCKET_VALUE;
-		THROW_EXCEPTION(ConnectionException, Conn_SocketConnectError)
+		THROW_EXCEPTION(ConnectionException, SocketConnectError)
 	}
 
 	ResetCounters();
@@ -260,7 +261,7 @@
 			// Other error
 			BOX_LOG_SYS_ERROR("Failed to read from socket");
 			THROW_EXCEPTION(ConnectionException,
-				Conn_SocketReadError);
+				SocketReadError);
 		}
 	}
 
@@ -310,7 +311,7 @@
 			mWriteClosed = true;	// assume can't write again
 			BOX_LOG_SYS_ERROR("Failed to write to socket");
 			THROW_EXCEPTION(ConnectionException,
-				Conn_SocketWriteError);
+				SocketWriteError);
 		}
 		
 		// Knock off bytes sent
@@ -401,7 +402,7 @@
 	if(::shutdown(mSocketHandle, how) == -1)
 	{
 		BOX_LOG_SYS_ERROR("Failed to shutdown socket");
-		THROW_EXCEPTION(ConnectionException, Conn_SocketShutdownError)
+		THROW_EXCEPTION(ConnectionException, SocketShutdownError)
 	}
 }
 

Modified: box/trunk/lib/server/SocketStreamTLS.cpp
===================================================================
--- box/trunk/lib/server/SocketStreamTLS.cpp	2014-08-15 22:47:14 UTC (rev 3352)
+++ box/trunk/lib/server/SocketStreamTLS.cpp	2014-08-15 22:47:17 UTC (rev 3353)
@@ -19,9 +19,10 @@
 #include <poll.h>
 #endif
 
+#include "autogen_ConnectionException.h"
+#include "autogen_ServerException.h"
 #include "BoxTime.h"
 #include "CryptoUtils.h"
-#include "ServerException.h"
 #include "SocketStreamTLS.h"
 #include "SSLLib.h"
 #include "TLSContext.h"
@@ -196,7 +197,7 @@
 			if(WaitWhenRetryRequired(se, TLS_HANDSHAKE_TIMEOUT) == false)
 			{
 				// timed out
-				THROW_EXCEPTION(ConnectionException, Conn_TLSHandshakeTimedOut)
+				THROW_EXCEPTION(ConnectionException, TLSHandshakeTimedOut)
 			}
 			break;
 			
@@ -205,12 +206,12 @@
 			if(IsServer)
 			{
 				CryptoUtils::LogError("accepting connection");
-				THROW_EXCEPTION(ConnectionException, Conn_TLSHandshakeFailed)
+				THROW_EXCEPTION(ConnectionException, TLSHandshakeFailed)
 			}
 			else
 			{
 				CryptoUtils::LogError("connecting");
-				THROW_EXCEPTION(ConnectionException, Conn_TLSHandshakeFailed)
+				THROW_EXCEPTION(ConnectionException, TLSHandshakeFailed)
 			}
 		}
 	}
@@ -337,7 +338,7 @@
 			
 		default:
 			CryptoUtils::LogError("reading");
-			THROW_EXCEPTION(ConnectionException, Conn_TLSReadFailed)
+			THROW_EXCEPTION(ConnectionException, TLSReadFailed)
 			break;
 		}
 	}
@@ -385,7 +386,7 @@
 		case SSL_ERROR_ZERO_RETURN:
 			// Connection closed
 			MarkAsWriteClosed();
-			THROW_EXCEPTION(ConnectionException, Conn_TLSClosedWhenWriting)
+			THROW_EXCEPTION(ConnectionException, TLSClosedWhenWriting)
 			break;
 
 		case SSL_ERROR_WANT_READ:
@@ -402,7 +403,7 @@
 		
 		default:
 			CryptoUtils::LogError("writing");
-			THROW_EXCEPTION(ConnectionException, Conn_TLSWriteFailed)
+			THROW_EXCEPTION(ConnectionException, TLSWriteFailed)
 			break;
 		}
 	}
@@ -444,7 +445,7 @@
 	if(::SSL_shutdown(mpSSL) < 0)
 	{
 		CryptoUtils::LogError("shutting down");
-		THROW_EXCEPTION(ConnectionException, Conn_TLSShutdownFailed)
+		THROW_EXCEPTION(ConnectionException, TLSShutdownFailed)
 	}
 
 	// Don't ask the base class to shutdown -- BIO does this, apparently.
@@ -467,15 +468,15 @@
 	if(cert == 0)
 	{
 		::X509_free(cert);
-		THROW_EXCEPTION(ConnectionException, Conn_TLSNoPeerCertificate)
+		THROW_EXCEPTION(ConnectionException, TLSNoPeerCertificate)
 	}
 
-	// Subject details	
-	X509_NAME *subject = ::X509_get_subject_name(cert); 
+	// Subject details
+	X509_NAME *subject = ::X509_get_subject_name(cert);
 	if(subject == 0)
 	{
 		::X509_free(cert);
-		THROW_EXCEPTION(ConnectionException, Conn_TLSPeerCertificateInvalid)
+		THROW_EXCEPTION(ConnectionException, TLSPeerCertificateInvalid)
 	}
 	
 	// Common name
@@ -483,7 +484,7 @@
 	if(::X509_NAME_get_text_by_NID(subject, NID_commonName, commonName, sizeof(commonName)) <= 0)
 	{
 		::X509_free(cert);
-		THROW_EXCEPTION(ConnectionException, Conn_TLSPeerCertificateInvalid)
+		THROW_EXCEPTION(ConnectionException, TLSPeerCertificateInvalid)
 	}
 	// Terminate just in case
 	commonName[sizeof(commonName)-1] = '\0';

Modified: box/trunk/lib/server/TLSContext.cpp
===================================================================
--- box/trunk/lib/server/TLSContext.cpp	2014-08-15 22:47:14 UTC (rev 3352)
+++ box/trunk/lib/server/TLSContext.cpp	2014-08-15 22:47:17 UTC (rev 3353)
@@ -12,8 +12,9 @@
 #define TLS_CLASS_IMPLEMENTATION_CPP
 #include <openssl/ssl.h>
 
+#include "autogen_ConnectionException.h"
+#include "autogen_ServerException.h"
 #include "CryptoUtils.h"
-#include "ServerException.h"
 #include "SSLLib.h"
 #include "TLSContext.h"
 

Modified: box/trunk/lib/server/WinNamedPipeListener.h
===================================================================
--- box/trunk/lib/server/WinNamedPipeListener.h	2014-08-15 22:47:14 UTC (rev 3352)
+++ box/trunk/lib/server/WinNamedPipeListener.h	2014-08-15 22:47:17 UTC (rev 3353)
@@ -11,11 +11,11 @@
 #ifndef WINNAMEDPIPELISTENER__H
 #define WINNAMEDPIPELISTENER__H
 
-#include <OverlappedIO.h>
-#include <WinNamedPipeStream.h>
+#include "autogen_ConnectionException.h"
+#include "autogen_ServerException.h"
+#include "OverlappedIO.h"
+#include "WinNamedPipeStream.h"
 
-#include "ServerException.h"
-
 #include "MemLeakFindOn.h"
 
 // --------------------------------------------------------------------------

Modified: box/trunk/lib/server/WinNamedPipeStream.cpp
===================================================================
--- box/trunk/lib/server/WinNamedPipeStream.cpp	2014-08-15 22:47:14 UTC (rev 3352)
+++ box/trunk/lib/server/WinNamedPipeStream.cpp	2014-08-15 22:47:17 UTC (rev 3353)
@@ -19,10 +19,11 @@
 #include <errno.h>
 #include <windows.h>
 
-#include "WinNamedPipeStream.h"
-#include "ServerException.h"
+#include "autogen_ConnectionException.h"
+#include "autogen_ServerException.h"
 #include "CommonException.h"
 #include "Socket.h"
+#include "WinNamedPipeStream.h"
 
 #include "MemLeakFindOn.h"
 

Modified: box/trunk/lib/server/makeprotocol.pl.in
===================================================================
--- box/trunk/lib/server/makeprotocol.pl.in	2014-08-15 22:47:14 UTC (rev 3352)
+++ box/trunk/lib/server/makeprotocol.pl.in	2014-08-15 22:47:17 UTC (rev 3353)
@@ -179,7 +179,7 @@
 
 #include "Protocol.h"
 #include "Message.h"
-#include "ServerException.h"
+#include "autogen_ConnectionException.h"
 
 class IOStream;
 class SocketStream;
@@ -261,13 +261,13 @@
 std::auto_ptr<$message_base_class> $message_base_class\::DoCommand($replyable_base_class &rProtocol,
 	$context_class &rContext) const
 {
-	THROW_EXCEPTION(ConnectionException, Conn_Protocol_TriedToExecuteReplyCommand)
+	THROW_EXCEPTION(ConnectionException, Protocol_TriedToExecuteReplyCommand)
 }
 
 std::auto_ptr<$message_base_class> $message_base_class\::DoCommand($replyable_base_class &rProtocol,
 	$context_class &rContext, IOStream& rDataStream) const
 {
-	THROW_EXCEPTION(ConnectionException, Conn_Protocol_TriedToExecuteReplyCommand)
+	THROW_EXCEPTION(ConnectionException, Protocol_TriedToExecuteReplyCommand)
 }
 __E
 
@@ -640,7 +640,7 @@
 
 print CPP <<__E;
 	default:
-		THROW_EXCEPTION(ConnectionException, Conn_Protocol_UnknownCommandRecieved)
+		THROW_EXCEPTION(ConnectionException, Protocol_UnknownCommandRecieved)
 	}
 }
 
@@ -685,7 +685,7 @@
 		{
 			SetLastError(type, subType);
 			THROW_EXCEPTION_MESSAGE(ConnectionException,
-				Conn_Protocol_UnexpectedReply,
+				Protocol_UnexpectedReply,
 				requestCommandName << " command failed: "
 				"received error " <<
 				(($error_class&)rReply).GetMessage());
@@ -694,7 +694,7 @@
 		{
 			SetLastError(Protocol::UnknownError, Protocol::UnknownError);
 			THROW_EXCEPTION_MESSAGE(ConnectionException,
-				Conn_Protocol_UnexpectedReply,
+				Protocol_UnexpectedReply,
 				requestCommandName << " command failed: "
 				"received unexpected response type " <<
 				rReply.GetType());
@@ -1197,7 +1197,7 @@
 	{
 		return $1 if $_ =~ m/\A$ty\((.+?)\)\Z/;
 	}
-	die "Can't find attribute $ty\n"
+	die "Can't find attribute $ty on command $c\n"
 }
 
 # returns (is basic type, typename)

Modified: box/trunk/test/backupstore/testbackupstore.cpp
===================================================================
--- box/trunk/test/backupstore/testbackupstore.cpp	2014-08-15 22:47:14 UTC (rev 3352)
+++ box/trunk/test/backupstore/testbackupstore.cpp	2014-08-15 22:47:17 UTC (rev 3353)
@@ -1101,7 +1101,7 @@
 	// Try using GetFile on a directory
 	{
 		TEST_CHECK_THROWS(std::auto_ptr<BackupProtocolSuccess> getFile(protocol.QueryGetFile(BackupProtocolListDirectory::RootDirectory, BackupProtocolListDirectory::RootDirectory)),
-			ConnectionException, Conn_Protocol_UnexpectedReply);
+			ConnectionException, Protocol_UnexpectedReply);
 	}
 
 	// Try retrieving an object that doesn't exist. That used to return
@@ -1173,7 +1173,7 @@
 		(protocol.QueryVersion(BACKUP_STORE_SERVER_VERSION));
 	TEST_THAT(serverVersion->GetVersion() == BACKUP_STORE_SERVER_VERSION);
 	TEST_CHECK_THROWS(protocol.QueryLogin(0x01234567, 0),
-		ConnectionException, Conn_Protocol_UnexpectedReply);
+		ConnectionException, Protocol_UnexpectedReply);
 	protocol.QueryFinished();
 	return true;
 }
@@ -1588,11 +1588,11 @@
 			TEST_CHECK_THROWS(apProtocol->QueryMoveObject(uploads[UPLOAD_FILE_TO_MOVE].allocated_objid,
 					BackupProtocolListDirectory::RootDirectory,
 					subdirid, BackupProtocolMoveObject::Flags_MoveAllWithSameName, newName),
-				ConnectionException, Conn_Protocol_UnexpectedReply);
+				ConnectionException, Protocol_UnexpectedReply);
 			TEST_CHECK_THROWS(apProtocol->QueryMoveObject(uploads[UPLOAD_FILE_TO_MOVE].allocated_objid,
 					subdirid,
 					subdirid, BackupProtocolMoveObject::Flags_MoveAllWithSameName, newName),
-				ConnectionException, Conn_Protocol_UnexpectedReply);
+				ConnectionException, Protocol_UnexpectedReply);
 		}
 
 		// Rename within a directory
@@ -2294,7 +2294,7 @@
 
 		// Login
 		TEST_CHECK_THROWS(std::auto_ptr<BackupProtocolLoginConfirmed> loginConf(protocol.QueryLogin(0x01234567, 0)),
-			ConnectionException, Conn_Protocol_UnexpectedReply);
+			ConnectionException, Protocol_UnexpectedReply);
 		
 		// Finish the connection
 		protocol.QueryFinished();
@@ -2377,7 +2377,7 @@
 		// Login
 		TEST_CHECK_THROWS(std::auto_ptr<BackupProtocolLoginConfirmed>
 			loginConf(protocol.QueryLogin(0x01234567, 0)),
-			ConnectionException, Conn_Protocol_UnexpectedReply);
+			ConnectionException, Protocol_UnexpectedReply);
 		int type, subType;
 		TEST_EQUAL_LINE(true, protocol.GetLastError(type, subType),
 			"expected a protocol error");
@@ -2413,7 +2413,7 @@
 	TEST_EQUAL(0, ::unlink("testfiles/0_0/backup/01234567/refcount.rdb.rfw"));
 
 	TEST_CHECK_THROWS(test_server_login("localhost", context),
-		ConnectionException, Conn_TLSReadFailed);
+		ConnectionException, TLSReadFailed);
 	TEST_THAT(ServerIsAlive(bbstored_pid));
 
 	std::auto_ptr<BackupStoreAccountDatabase> apAccounts(
@@ -2566,7 +2566,7 @@
 				0,							/* diff from ID */
 				fnx,
 				upload),
-			ConnectionException, Conn_Protocol_UnexpectedReply);
+			ConnectionException, Protocol_UnexpectedReply);
 
 		// This currently causes a fatal error on the server, which
 		// kills the connection. TODO FIXME return an error instead.
@@ -2575,7 +2575,7 @@
 		TEST_CHECK_THROWS(protocol.QueryCreateDirectory(
 				BackupProtocolListDirectory::RootDirectory,
 				FAKE_ATTR_MODIFICATION_TIME, fnxd, attr),
-			ConnectionException, Conn_Protocol_UnexpectedReply);
+			ConnectionException, Protocol_UnexpectedReply);
 
 		// Finish the connection. TODO FIXME reinstate this.
 		protocol.QueryFinished();

Modified: box/trunk/test/bbackupd/testbbackupd.cpp
===================================================================
--- box/trunk/test/bbackupd/testbbackupd.cpp	2014-08-15 22:47:14 UTC (rev 3352)
+++ box/trunk/test/bbackupd/testbbackupd.cpp	2014-08-15 22:47:17 UTC (rev 3353)
@@ -882,7 +882,7 @@
 			Logger::LevelGuard(Logging::GetConsole(), Log::ERROR);
 			TEST_CHECK_THROWS(ReadDirectory(*client, 0x12345678),
 				ConnectionException,
-				Conn_Protocol_UnexpectedReply);
+				Protocol_UnexpectedReply);
 		}
 
 		client->QueryFinished();




More information about the Boxbackup-commit mailing list