'Test reading from a 2D array within a structured type'

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

    nbval = np.recarray(1, dtype=recordwith2darray)
    nbval[0].j = np.asarray([1.5, 2.5, 3.5, 4.5, 5.5, 6.5], np.float32).reshape(3, 2)
    nbrecord = numpy_support.from_dtype(recordwith2darray)
    cfunc = self.get_cfunc(record_read_2d_array00, (nbrecord,))
    res = cfunc(nbval[0])
    np.testing.assert_equal(res, nbval[0].j[(0, 0)])
    cfunc = self.get_cfunc(record_read_2d_array01, (nbrecord,))
    res = cfunc(nbval[0])
    np.testing.assert_equal(res, nbval[0].j[(0, 1)])
    cfunc = self.get_cfunc(record_read_2d_array10, (nbrecord,))
    res = cfunc(nbval[0])
    np.testing.assert_equal(res, nbval[0].j[(1, 0)])
