-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
13fe813
commit e8459e5
Showing
7 changed files
with
146 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
[submodule "cxxtest"] | ||
path = cxxtest | ||
url = https://github.com/CxxTest/cxxtest |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
#include <string> | ||
#include <Osmosis/TCPConnection.h> | ||
#include <Osmosis/Stream/AckOps.h> | ||
|
||
namespace Osmosis | ||
{ | ||
TCPConnection::TCPConnection( const std::string & hostname, unsigned short port ): | ||
_socket( _ioService ), | ||
_endpoint(), | ||
_tcpSocket( _socket ) | ||
{ | ||
std::cout << "Nothing happens here"; | ||
} | ||
|
||
TCPSocket & TCPConnection::socket() | ||
{ | ||
return _tcpSocket; | ||
} | ||
|
||
void TCPConnection::connect() | ||
{ | ||
} | ||
|
||
void TCPConnection::sendHandshake() | ||
{ | ||
Stream::AckOps( _tcpSocket ).wait( "Handshake" ); | ||
} | ||
|
||
void TCPConnection::setTCPNoDelay() | ||
{ | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
#include <iostream> | ||
#include <boost/asio.hpp> | ||
#include <Osmosis/Tongue.h> | ||
#include <cxxtest/TestSuite.h> | ||
#include <Osmosis/TCPConnection.h> | ||
#include <Osmosis/Stream/AckOps.h> | ||
#include <Osmosis/Chain/Remote/ProtocolVersionNegotiator.h> | ||
|
||
std::mutex globalTraceLock; | ||
|
||
namespace Osmosis { | ||
namespace Stream | ||
{ | ||
|
||
AckOps::AckOps( TCPSocket & socket ): | ||
_socket( socket ) | ||
{} | ||
|
||
void AckOps::wait( const char * waitReason ) | ||
{ | ||
} | ||
|
||
void AckOps::sendAck() | ||
{ | ||
} | ||
|
||
} | ||
} | ||
|
||
class ProtocolVersionNegotiatorTest : public CxxTest::TestSuite | ||
{ | ||
public: | ||
void test_ProtocolNegotiation(void) | ||
{ | ||
boost::asio::io_service ioService; | ||
boost::asio::ip::tcp::socket boostSocket(ioService); | ||
} | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
#include <mutex> | ||
#include <cxxtest/TestSuite.h> | ||
#include <Osmosis/Chain/Remote/ProtocolVersionNegotiator.h> | ||
|
||
std::mutex globalTraceLock; | ||
|
||
namespace Osmosis | ||
{ | ||
class TCPConnection | ||
{ | ||
public: | ||
TCPConnection( const std::string & hostname, unsigned short port ) | ||
{ | ||
std::cout << "TCPConnection mock constructor"; | ||
} | ||
|
||
TCPSocket & socket() { | ||
|
||
} | ||
|
||
void connect(); | ||
|
||
private: | ||
|
||
void sendHandshake(); | ||
|
||
void setTCPNoDelay(); | ||
|
||
TCPConnection( const TCPConnection & rhs ) = delete; | ||
TCPConnection & operator= ( const TCPConnection & rhs ) = delete; | ||
}; | ||
} // namespace Osmosis | ||
|
||
class ProtocolVersionNegotiatorTest : public CxxTest::TestSuite | ||
{ | ||
public: | ||
void test_ProtocolNegotiation(void) | ||
{ | ||
} | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters