'Testing scalar record value as argument'

def _test_record_args(self, revargs):

    npval = self.refsample1d.copy()[0]
    nbval = self.nbsample1d.copy()[0]
    attrs = 'abc'
    valtypes = (types.float64, types.int16, types.complex64)
    values = (1.23, 12345, (123 + 456j))
    old_refcnt = sys.getrefcount(nbval)
    for (attr, valtyp, val) in zip(attrs, valtypes, values):
        expected = getattr(npval, attr)
        nbrecord = numpy_support.from_dtype(recordtype)
        if revargs:
            prefix = 'get_record_rev_'
            argtypes = (valtyp, nbrecord)
            args = (val, nbval)
        else:
            prefix = 'get_record_'
            argtypes = (nbrecord, valtyp)
            args = (nbval, val)
        pyfunc = globals()[(prefix + attr)]
        cfunc = self.get_cfunc(pyfunc, argtypes)
        got = cfunc(*args)
        try:
            self.assertEqual(expected, got)
        except AssertionError as e:
            import llvmlite.binding as ll
            if (attr != 'c'):
                raise
            if (ll.get_default_triple() != 'armv7l-unknown-linux-gnueabihf'):
                raise
            self.assertEqual(val, got)
        else:
            self.assertEqual(nbval[attr], val)
        del got, expected, args
    self.assertEqual(sys.getrefcount(nbval), old_refcnt)
