]> git.stg.codes - stg.git/blobdiff - tests/test_raw_ip.cpp
Update Travis config.
[stg.git] / tests / test_raw_ip.cpp
index be20ed0158a9f2517999bda9cf6c0863e8e6f21b..637c1b67032e7a23e08e27a1b66d5192b8299d15 100644 (file)
@@ -3,6 +3,7 @@
 #include <arpa/inet.h>
 
 #include <cstdlib>
 #include <arpa/inet.h>
 
 #include <cstdlib>
+#include <cstdint>
 #include <ctime>
 #include <iostream>
 
 #include <ctime>
 #include <iostream>
 
@@ -46,11 +47,11 @@ namespace tut
         rp.rawPacket.header.sPort = htons(80);
         rp.rawPacket.header.dPort = htons(38546);
 
         rp.rawPacket.header.sPort = htons(80);
         rp.rawPacket.header.dPort = htons(38546);
 
-        ensure_equals("IP header size (explicitly)", sizeof(rp.rawPacket.header.ipHeader), 20);
+        ensure_equals("IP header size (explicitly)", sizeof(rp.rawPacket.header.ipHeader), static_cast<size_t>(20));
         ensure_equals("IP version", rp.GetIPVersion(), 4);
         ensure_equals("IP header size (with options)", rp.GetHeaderLen(), 20);
         ensure_equals("Underlying protocol version", rp.GetProto(), 6);
         ensure_equals("IP version", rp.GetIPVersion(), 4);
         ensure_equals("IP header size (with options)", rp.GetHeaderLen(), 20);
         ensure_equals("Underlying protocol version", rp.GetProto(), 6);
-        ensure_equals("Packet length", rp.GetLen(), 40);
+        ensure_equals("Packet length", rp.GetLen(), static_cast<uint32_t>(40));
         ensure_equals("Source IP address", rp.GetSrcIP(), inet_addr("192.168.0.1"));
         ensure_equals("Destination IP address", rp.GetDstIP(), inet_addr("192.168.0.101"));
         ensure_equals("Source port number", rp.GetSrcPort(), 80);
         ensure_equals("Source IP address", rp.GetSrcIP(), inet_addr("192.168.0.1"));
         ensure_equals("Destination IP address", rp.GetDstIP(), inet_addr("192.168.0.101"));
         ensure_equals("Source port number", rp.GetSrcPort(), 80);