def METHOD_NAME(obj_func, metric, normalize, direction, selection, benchmark, func_mode):
    variable = test_var
    result = results[obj_func][metric][normalize][direction][selection]
    benchmark.group = "OptimizationFunction " + str(obj_func) + " " + metric
    of = obj_func(default_variable=variable, metric=metric, normalize=normalize)
    f = OPTFunctions.GridSearch(objective_function=of, default_variable=variable,
                                search_space=search_space, direction=direction,
                                select_randomly_from_optimal_values=(selection=='RANDOM'),
                                seed=0, save_values=False)
    EX = pytest.helpers.get_func_execution(f, func_mode)
    res = benchmark(EX, variable)
    np.testing.assert_allclose(res[0], result[0], rtol=1e-5, atol=1e-8)
    np.testing.assert_allclose(res[1], result[1], rtol=1e-5, atol=1e-8)
    if func_mode == 'Python':
        np.testing.assert_allclose(res[2], result[2], rtol=1e-5, atol=1e-8)
        np.testing.assert_allclose(res[3], result[3], rtol=1e-5, atol=1e-8)