'Test that the different modes are producing the correct results using
a 3x3 uniform kernel.'

@pytest.mark.parametrize(option_names, options)
def test_uniform_3x3(self, boundary, nan_treatment, normalize_kernel):

    x = np.array([[0.0, 0.0, 3.0], [1.0, 0.0, 0.0], [0.0, 2.0, 0.0]], dtype=u'float64')
    y = np.array([[1.0, 1.0, 1.0], [1.0, 1.0, 1.0], [1.0, 1.0, 1.0]], dtype=u'float64')
    z = convolve_fft(x, y, boundary=boundary, nan_treatment=nan_treatment, fill_value=(np.nan if normalize_kernel else 0), normalize_kernel=normalize_kernel)
    w = np.array([[4.0, 6.0, 4.0], [6.0, 9.0, 6.0], [4.0, 6.0, 4.0]], dtype=u'float64')
    answer_dict = {u'sum': np.array([[1.0, 4.0, 3.0], [3.0, 6.0, 5.0], [3.0, 3.0, 2.0]], dtype=u'float64'), u'sum_wrap': np.array([[6.0, 6.0, 6.0], [6.0, 6.0, 6.0], [6.0, 6.0, 6.0]], dtype=u'float64')}
    answer_dict[u'average'] = (answer_dict[u'sum'] / w)
    answer_dict[u'average_wrap'] = (answer_dict[u'sum_wrap'] / 9.0)
    answer_dict[u'average_withzeros'] = (answer_dict[u'sum'] / 9.0)
    answer_dict[u'sum_withzeros'] = answer_dict[u'sum']
    if normalize_kernel:
        answer_key = u'average'
    else:
        answer_key = u'sum'
    if (boundary == u'wrap'):
        answer_key += u'_wrap'
    elif (nan_treatment == u'fill'):
        answer_key += u'_withzeros'
    a = answer_dict[answer_key]
    assert np.all((np.abs((z - a)) <= (np.spacing(np.where((z > a), z, a)) * 10)))
