Commit 23dee211 authored by Mart Lubbers's avatar Mart Lubbers

simplify some generation and formatting in the rts

parent b8140ad6
Pipeline #44094 failed with stages
in 10 minutes and 49 seconds
......@@ -101,13 +101,13 @@ int gettimeofday(struct timeval * tp, void *tzp)
FILETIME file_time;
uint64_t time;
GetSystemTime( &system_time );
SystemTimeToFileTime( &system_time, &file_time );
time = ((uint64_t)file_time.dwLowDateTime ) ;
GetSystemTime(&system_time);
SystemTimeToFileTime(&system_time, &file_time);
time = ((uint64_t)file_time.dwLowDateTime);
time += ((uint64_t)file_time.dwHighDateTime) << 32;
tp->tv_sec = (long) ((time - EPOCH) / 10000000L);
tp->tv_usec = (long) (system_time.wMilliseconds * 1000);
tp->tv_sec = (long)((time - EPOCH) / 10000000L);
tp->tv_usec = (long)(system_time.wMilliseconds * 1000);
return 0;
}
#endif
......@@ -426,7 +426,7 @@ void real_setup(void)
}
// Setup the TCP listening socket
if (bind( ListenSocket,
if (bind(ListenSocket,
result->ai_addr,
(int)result->ai_addrlen) == SOCKET_ERROR) {
printf("bind failed with error: %d\n", WSAGetLastError());
......
......@@ -5,8 +5,12 @@ import StdEnv
import Data.GenDefault
import Data.Func
import Data.Functor
import Data.Either
import Data.Maybe
import Data.Tuple
import Data.List
import Control.Applicative
import Control.GenBimap
import mTask.Interpret.Device
......@@ -58,9 +62,9 @@ Start w = flip (exposeProperties [Concise 99999999] [Tests 100000, Bent]) w $
, name "testUInt16" $ cast (UInt16 0) testEncoding
, name "testString" $ (testEncoding For ggenString 256 1.0 0 255 aStream)
, name "testString255" $ cast (String255 "") testEncoding
, name "test2TuplesInt" $ (testEncoding For tl [(0,0):ggen{|*->*->*|} (\_->int16s) (\_->int16s) genState])
, name "test2TuplesInt" $ (testEncoding For tuple <$> int16s <*> int16s)
, name "test2TuplesLng" $ cast (Long 0, Long 0) testEncoding
, name "test3TuplesInt" $ (testEncoding For tl [(0,0,0):ggen{|*->*->*->*|} (\_->int16s) (\_->int16s) (\_->int16s) genState])
, name "test3TuplesInt" $ (testEncoding For tuple3 <$> int16s <*> int16s <*> int16s)
, name "test3TuplesLng" $ cast (Long 0, Long 0, Long 0) testEncoding
, name "testSpec" $ cast {gDefault{|*|} & aPins=UInt8 0} testEncoding
, name "testMessageTo" $ cast MTTShutdown testEncoding
......
......@@ -3,6 +3,8 @@ implementation module TestCommon
import Gast.Testable
import StdEnv
import Data.Either
import Data.List
import Data.Functor
import mTask.Interpret.Message
import mTask.Interpret.UInt
import mTask.Language
......@@ -18,7 +20,7 @@ derive genShow Long, UInt8, UInt16, String255
ggen{|Long|} s = [LONG_MAX, LONG_MIN, zero, one, ~one:[zero..dec LONG_MAX]]
ggen{|UInt8|} s = [UINT8_MAX, UINT8_MIN:[zero..dec UINT8_MAX]]
ggen{|UInt16|} s = [UINT16_MAX, UINT16_MIN:[zero..dec UINT16_MAX]]
ggen{|String255|} s = map fromString (ggenString 255 1.0 0 255 aStream)
ggen{|String255|} s = fromString <$> ggenString 255 1.0 0 255 aStream
int16s :: [Int]
int16s = [-1*0x7fff,0x7fff,0,1,-1:[-1*0x7fff+1..0x7fff-1]]
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment