⚝
One Hat Cyber Team
⚝
Your IP:
216.73.216.65
Server IP:
97.74.87.16
Server:
Linux 16.87.74.97.host.secureserver.net 5.14.0-503.38.1.el9_5.x86_64 #1 SMP PREEMPT_DYNAMIC Fri Apr 18 08:52:10 EDT 2025 x86_64
Server Software:
Apache
PHP Version:
8.2.28
Buat File
|
Buat Folder
Eksekusi
Dir :
~
/
opt
/
python38
/
lib
/
python3.8
/
ctypes
/
test
/
View File Name :
test_checkretval.py
import unittest from ctypes import * from ctypes.test import need_symbol class CHECKED(c_int): def _check_retval_(value): # Receives a CHECKED instance. return str(value.value) _check_retval_ = staticmethod(_check_retval_) class Test(unittest.TestCase): def test_checkretval(self): import _ctypes_test dll = CDLL(_ctypes_test.__file__) self.assertEqual(42, dll._testfunc_p_p(42)) dll._testfunc_p_p.restype = CHECKED self.assertEqual("42", dll._testfunc_p_p(42)) dll._testfunc_p_p.restype = None self.assertEqual(None, dll._testfunc_p_p(42)) del dll._testfunc_p_p.restype self.assertEqual(42, dll._testfunc_p_p(42)) @need_symbol('oledll') def test_oledll(self): self.assertRaises(OSError, oledll.oleaut32.CreateTypeLib2, 0, None, None) if __name__ == "__main__": unittest.main()