def check_type(self, interface, typename, type):
        print "Checking type %s" % typename
        v = type()
        for n in dir(v):
            if n[0] == '_':
                continue
            try:
                value = getattr(v, n)
            except __HOLE__, errstr:
                if str(errstr) == "unknown union level":
                    print "ERROR: Unknown union level in %s.%s" % (typename, n)
                    self.errcount += 1
                    continue
                print str(errstr)[1:21]
                if str(errstr)[0:21] == "Can not convert C Type":
                    print "ERROR: Unknown C type for %s.%s" % (typename, n)
                    self.errcount += 1
                    continue
                else:
                    print "ERROR: Failed to instantiate %s.%s" % (typename, n)
                    self.errcount += 1
                    continue
            except Exception:
                print "ERROR: Failed to instantiate %s.%s" % (typename, n)
                self.errcount += 1
                continue

            # now try setting the value back
            try:
                print "Setting %s.%s" % (typename, n)
                setattr(v, n, value)
            except Exception, e:
                if isinstance(e, AttributeError) and str(e).endswith("is read-only"):
                    # readonly, ignore
                    continue
                else:
                    print "ERROR: Failed to set %s.%s: %r: %s" % (typename, n, e.__class__, e)
                    self.errcount += 1
                    continue

            # and try a comparison
            try:
                if value != getattr(v, n):
                    print "ERROR: Comparison failed for %s.%s: %r != %r" % (typename, n, value, getattr(v, n))
                    continue
            except Exception, e:
                print "ERROR: compare exception for %s.%s: %r: %s" % (typename, n, e.__class__, e)
                continue
dataset/ETHPy150Open byt3bl33d3r/pth-toolkit/lib/python2.7/site-packages/samba/tests/dcerpc/testrpc.py/RpcTests.check_type