コード例 #1
0
ファイル: test_parser.py プロジェクト: mgaitan/yaswfp
 def test_fixed8(self, _a, _b):
     parser = SWFParser(io.BytesIO(b'\x80\x07'))
     self.assertEqual(parser._get_struct_fixed8(), 7.5)
コード例 #2
0
ファイル: test_parser.py プロジェクト: mgaitan/yaswfp
 def test_encodedu32_simple(self, _a, _b):
     parser = SWFParser(io.BytesIO(b'\x3a'))
     self.assertEqual(parser._get_struct_encodedu32(), 58)
コード例 #3
0
ファイル: test_parser.py プロジェクト: mgaitan/yaswfp
 def test_encodedu32_several(self, _a, _b):
     parser = SWFParser(io.BytesIO(b'\x8c\xac\x29'))
     # compose: 0101001 0101100 0001100
     self.assertEqual(parser._get_struct_encodedu32(), 677388)
コード例 #4
0
ファイル: test_parser.py プロジェクト: mgaitan/yaswfp
 def test_rect_simple(self, _a, _b):
     parser = SWFParser(io.BytesIO(b'\x1b\xae\x80'))
     self.assertEqual(parser._get_struct_rect(), (3, 5, 3, 5))
コード例 #5
0
ファイル: test_parser.py プロジェクト: mgaitan/yaswfp
 def test_rect_long(self, _a, _b):
     parser = SWFParser(io.BytesIO(b'\x70\x00\x0a\x8c\x00\x00\xda\xc0'))
     self.assertEqual(parser._get_struct_rect(), (0, 5400, 0, 7000))
コード例 #6
0
 def test_encodedu32_several(self, _a, _b):
     parser = SWFParser(io.BytesIO(b'\x8c\xac\x29'))
     # compose: 0101001 0101100 0001100
     self.assertEqual(parser._get_struct_encodedu32(), 677388)
コード例 #7
0
 def test_encodedu32_simple(self, _a, _b):
     parser = SWFParser(io.BytesIO(b'\x3a'))
     self.assertEqual(parser._get_struct_encodedu32(), 58)
コード例 #8
0
 def test_rect_long(self, _a, _b):
     parser = SWFParser(io.BytesIO(b'\x70\x00\x0a\x8c\x00\x00\xda\xc0'))
     self.assertEqual(parser._get_struct_rect(), (0, 5400, 0, 7000))
コード例 #9
0
 def test_rect_simple(self, _a, _b):
     parser = SWFParser(io.BytesIO(b'\x1d\x71\x00'))
     self.assertEqual(parser._get_struct_rect(), (-3, 3, -4, 2))
コード例 #10
0
ファイル: test_parser.py プロジェクト: EricLau2018/yaswfp
 def test_rect_simple(self, _a, _b):
     parser = SWFParser(io.BytesIO(b'\x1d\x71\x00'))
     self.assertEqual(parser._get_struct_rect(), (-3, 3, -4, 2))