fixing test-fc16.cc windows test function.

master
Steffen Pohle 3 years ago
parent e734a7b905
commit 493fa1c508

@ -55,7 +55,7 @@ TCP::~TCP() {
TCP::TCP() { TCP::TCP() {
if (tcpinit == 0) { if (tcpinit == 0) {
#ifdef BUILD_WINDOWS #if defined(_WIN32) || defined(_WIN64) || defined(__CYGWIN__) || defined(BUILD_WINDOWS)
WORD wVersionRequested; WORD wVersionRequested;
WSADATA wsaData; WSADATA wsaData;

@ -116,7 +116,7 @@ int main (int argc, char **argv) {
for (i = 0; i < regcnt; i++) { for (i = 0; i < regcnt; i++) {
f = (float) atof(argv[i+5]); f = (float) atof(argv[i+5]);
printf ("i: %d string:%s f:%f\n", i, argv[i+4], f); printf ("i: %d string:%s f:%f\n", i, argv[i+5], f);
memcpy (&ui16, &f, sizeof(ui16)); memcpy (&ui16, &f, sizeof(ui16));
ui16 = htons(ui16); ui16 = htons(ui16);
@ -135,8 +135,12 @@ int main (int argc, char **argv) {
} }
} }
tcp.Write((char*)buffer, pos); printf ("Wrote %d (out of %d) bytes\n", tcp.Write((char*)buffer, pos), pos);
} }
pos = tcp.ReadTimeout(buffer, SIZE_BUFFER, 1000);
printf ("Got %d bytes.\n", pos);
tcp.Close(); tcp.Close();
return 0; return 0;

Loading…
Cancel
Save