40 uint8_t msgbytes[1500];
47 while (messagesize < 1500)
55 unsigned char ch = (
unsigned char)ret;
56 msgbytes[messagesize] = ch;
60 printf(
"Processing %d bytes\n", (
int)messagesize);
61 reader.
AddBytes(msgbytes, messagesize);
74 std::vector<IUnitTest*> vecTests;
76 boost::shared_ptr<CTestDataStream> spTestDataStream(
new CTestDataStream);
77 boost::shared_ptr<CTestReader> spTestReader(
new CTestReader);
78 boost::shared_ptr<CTestBuilder> spTestBuilder(
new CTestBuilder);
79 boost::shared_ptr<CTestIntegrity> spTestIntegrity(
new CTestIntegrity);
85 boost::shared_ptr<CTestFastHash> spTestFastHash(
new CTestFastHash);
86 boost::shared_ptr<CTestPolling> spTestPolling(
new CTestPolling);
90 vecTests.push_back(spTestDataStream.get());
91 vecTests.push_back(spTestReader.get());
92 vecTests.push_back(spTestBuilder.get());
93 vecTests.push_back(spTestIntegrity.get());
94 vecTests.push_back(spTestMessageHandler.get());
95 vecTests.push_back(spTestCmdLineParser.get());
96 vecTests.push_back(spTestClientLogic.get());
97 vecTests.push_back(spTestRecvFromEx4.get());
98 vecTests.push_back(spTestRecvFromEx6.get());
99 vecTests.push_back(spTestFastHash.get());
100 vecTests.push_back(spTestPolling.get());
101 vecTests.push_back(spTestAtomicHelpers.get());
102 vecTests.push_back(spTestRateLimiter.get());
105 for (
size_t index = 0; index < vecTests.size(); index++)
107 HRESULT hr = vecTests[index]->Run();
108 printf(
"Result of %s: %s\n", vecTests[index]->GetName(),
SUCCEEDED(hr)?
"PASS":
"FAIL");
115 const size_t MAX_TEXT_SIZE = 100000;
116 char* buffer =
new char[MAX_TEXT_SIZE];
118 size_t messagesize = 0;
120 while (messagesize < MAX_TEXT_SIZE)
128 buffer[messagesize] = (
signed char)(ret);
137 int main(
int argc,
char** argv)
142 bool fParseError =
false;
145 cmdline.
AddOption(
"fuzz", no_argument, &strFuzz);
146 cmdline.
AddOption(
"pp", no_argument, &strPP);
150 if (strFuzz.size() > 0)
154 else if (strPP.size() > 0)
uint32_t GetMillisecondCounter()
ReaderParseState AddBytes(const uint8_t *pData, uint32_t size)
HRESULT ParseCommandLine(int argc, char **argv, int startindex, bool *fParseError)
int main(int argc, char **argv)
HRESULT AddOption(const char *pszName, int has_arg, std::string *pStrResult)
void PrettyPrint(const char *pszInput, size_t width)