'Testing scalar record value as return value.
We can only return a copy of the record.'

@tag('important')
def test_record_return(self):

    pyfunc = record_return
    recty = numpy_support.from_dtype(recordtype)
    cfunc = self.get_cfunc(pyfunc, (recty[:], types.intp))
    attrs = 'abc'
    indices = [0, 1, 2]
    for (index, attr) in zip(indices, attrs):
        nbary = self.nbsample1d.copy()
        old_refcnt = sys.getrefcount(nbary)
        res = cfunc(nbary, index)
        self.assertEqual(nbary[index], res)
        setattr(res, attr, 0)
        self.assertNotEqual(nbary[index], res)
        del res
        self.assertEqual(sys.getrefcount(nbary), old_refcnt)
