code: def test_pointers(self):
      f = dll._testfunc_p_p
      f.restype = POINTER(c_int)
      f.argtypes = [POINTER(c_int)]
  
      # This only works if the value c_int(42) passed to the
      # function is still alive while the pointer (the result) is
      # used.
  
      v = c_int(42)
  
      self.assertEqual(pointer(v).contents.value, 42)
      result = f(pointer(v))
      self.assertEqual(type(result), POINTER(c_int))
      self.assertEqual(result.contents.value, 42)
  
      # This on works...
      result = f(pointer(v))
      self.assertEqual(result.contents.value, v.value)
  
      p = pointer(c_int(99))
      result = f(p)
      self.assertEqual(result.contents.value, 99)
  
      arg = byref(v)
      result = f(arg)
      self.assertNotEqual(result.contents, v.value)
  
      self.assertRaises(ArgumentError, f, byref(c_short(22)))
  
      # It is dangerous, however, because you don't control the lifetime
      # of the pointer:
      result = f(byref(c_int(99)))
      self.assertNotEqual(result.contents, 99)
  
imports: import _ctypes_test
  import ctypes
  import sys
  import unittest
  from ctypes import CDLL, Structure, Array, CFUNCTYPE, byref, POINTER, pointer, ArgumentError, c_char, c_wchar, c_byte, c_char_p, c_wchar_p, c_short, c_int, c_long, c_longlong, c_void_p, c_float, c_double, c_longdouble
  from _ctypes import _Pointer, _SimpleCData
label_desc: Use image node_id 15 for calling the FunctionTestCase obj's underlying member method code with example usage: obj.test_pointers() without return types