Loading Common/Libraries/IRALibrary/src/Socket.cpp +1 −1 Original line number Diff line number Diff line Loading @@ -339,7 +339,7 @@ int CSocket::Send(CError& Err,const void *Buff,WORD BuffLen,WORD Port,CString *A return FAIL; } if (getType()==STREAM) { // stream sockets Res=send(m_iSocket,Buff,BuffLen,0); Res=send(m_iSocket,Buff,BuffLen,MSG_NOSIGNAL); } else { // datagram sockets if ((Addr==NULL) || (Port==0)) { Loading Common/Libraries/IRALibrary/tests/Socket_test.i 0 → 100644 +41 −0 Original line number Diff line number Diff line #include <IRA> #include <stdlib.h> namespace IRALibraryTest { class IRALibrary_Socket : public ::testing::Test { public: ::testing::AssertionResult sendWithoutConnection() { const BYTE *msg = (const BYTE *)("enniomorricone"); size_t len = strlen((const char *)(msg)); IRA::CError error; IRA::CSocket socket; socket.Create(error); socket.setSockMode(error, IRA::CSocket::BLOCKINGTIMEO, 3000000, 3000000); // Note: there is no call to socket.Connect() if(socket.Send(error, (const void *)(msg), len) == IRA::CSocket::FAIL) return ::testing::AssertionSuccess(); else return ::testing::AssertionFailure(); } protected: static void TearDownTestCase() { } static void SetUpTestCase() { } virtual void SetUp() { } virtual void TearDown() { } }; } Common/Libraries/IRALibrary/tests/unittest.cpp +4 −3 Original line number Diff line number Diff line Loading @@ -2,6 +2,7 @@ #include "IRATools_test.i" #include "FastQueue_test.i" #include "Socket_test.i" using namespace IRALibraryTest; Loading Loading @@ -58,6 +59,6 @@ TEST_F(IRALibrary_FastQueue,FastQueue_checkConsistency){ EXPECT_TRUE(FastQueue_checkConsistency()); } TEST_F(IRALibrary_Socket, sendWithoutConnection){ EXPECT_TRUE(sendWithoutConnection()); } Loading
Common/Libraries/IRALibrary/src/Socket.cpp +1 −1 Original line number Diff line number Diff line Loading @@ -339,7 +339,7 @@ int CSocket::Send(CError& Err,const void *Buff,WORD BuffLen,WORD Port,CString *A return FAIL; } if (getType()==STREAM) { // stream sockets Res=send(m_iSocket,Buff,BuffLen,0); Res=send(m_iSocket,Buff,BuffLen,MSG_NOSIGNAL); } else { // datagram sockets if ((Addr==NULL) || (Port==0)) { Loading
Common/Libraries/IRALibrary/tests/Socket_test.i 0 → 100644 +41 −0 Original line number Diff line number Diff line #include <IRA> #include <stdlib.h> namespace IRALibraryTest { class IRALibrary_Socket : public ::testing::Test { public: ::testing::AssertionResult sendWithoutConnection() { const BYTE *msg = (const BYTE *)("enniomorricone"); size_t len = strlen((const char *)(msg)); IRA::CError error; IRA::CSocket socket; socket.Create(error); socket.setSockMode(error, IRA::CSocket::BLOCKINGTIMEO, 3000000, 3000000); // Note: there is no call to socket.Connect() if(socket.Send(error, (const void *)(msg), len) == IRA::CSocket::FAIL) return ::testing::AssertionSuccess(); else return ::testing::AssertionFailure(); } protected: static void TearDownTestCase() { } static void SetUpTestCase() { } virtual void SetUp() { } virtual void TearDown() { } }; }
Common/Libraries/IRALibrary/tests/unittest.cpp +4 −3 Original line number Diff line number Diff line Loading @@ -2,6 +2,7 @@ #include "IRATools_test.i" #include "FastQueue_test.i" #include "Socket_test.i" using namespace IRALibraryTest; Loading Loading @@ -58,6 +59,6 @@ TEST_F(IRALibrary_FastQueue,FastQueue_checkConsistency){ EXPECT_TRUE(FastQueue_checkConsistency()); } TEST_F(IRALibrary_Socket, sendWithoutConnection){ EXPECT_TRUE(sendWithoutConnection()); }