Exemplo n.º 1
0
 def test_onefield_struct(self):
     parsed_doc = parser.parse(self.xmlOneFieldSource)
     res = ws.build_struct(parsed_doc["structures"][0], parsed_doc["header"]["name"])
     self.assertEqual(res, norm_multiline_str("""
         struct stdUDPHeader
         {
             byte_order big_endian;
             muhheader header;
             uint16 MessageID;
         }
         """) )
Exemplo n.º 2
0
 def test_onefield_struct(self):
     parsed_doc = parser.parse(self.xmlOneFieldSource)
     res = ws.build_struct(parsed_doc["structures"][0],
                           parsed_doc["header"]["name"])
     self.assertEqual(
         res,
         norm_multiline_str("""
         struct stdUDPHeader
         {
             byte_order big_endian;
             muhheader header;
             uint16 MessageID;
         }
         """))
Exemplo n.º 3
0
 def test_multiplefields_struct(self):
     parsed_doc = parser.parse(self.xmlSource)
     res = ws.build_struct(parsed_doc["structures"][0], parsed_doc["header"]["name"])
     self.assertEqual(res, norm_multiline_str("""
         struct stdUDPHeader
         {
             byte_order big_endian;
             muhheader header;
             uint16 MessageID;
             uint16 MessageLenght;
             uint32 MessageCount;
             int64 MessageSendTime;
             uint32 MessageChecksum;
         }
         """) )
Exemplo n.º 4
0
 def test_multiplefields_struct(self):
     parsed_doc = parser.parse(self.xmlSource)
     res = ws.build_struct(parsed_doc["structures"][0],
                           parsed_doc["header"]["name"])
     self.assertEqual(
         res,
         norm_multiline_str("""
         struct stdUDPHeader
         {
             byte_order big_endian;
             muhheader header;
             uint16 MessageID;
             uint16 MessageLenght;
             uint32 MessageCount;
             int64 MessageSendTime;
             uint32 MessageChecksum;
         }
         """))