<commit_before>/*
 * bacteria-core, core for cellular automaton
 * Copyright (C) 2016 <NAME>
 *
 * See the LICENSE file for terms of use.
 */

#include <boost/test/unit_test.hpp>

#include "Model.hpp"

template<typename Func>
static void checkErrorHandling(
    Implementation::Model* model,
    Func model_method
) {
    // range errors: test all combinations of
    // "wrong" (outside of correct range) arguments
    // Max_index: 0; min_index: 0
    for (int arg1 = -1; arg1 <= 1; arg1++) {
        for (int arg2 = -1; arg2 <= 1; arg2++) {
            if ((arg1 != 0) || (arg2 != 0)) {
                // (0, 0) is correct
                BOOST_REQUIRE_THROW(
                    ((*model).*model_method)(arg1, arg2), Exception
                );
            }
        }
    }
    // "dead" error
    // (attempt to do something with dead bacterium)<commit_msg>Model tests: add typedef OneArgMethod<commit_after>/*
 * bacteria-core, core for cellular automaton
 * Copyright (C) 2016 <NAME>
 *
 * See the LICENSE file for terms of use.
 */

#include <boost/test/unit_test.hpp>

#include "Model.hpp"

typedef void (Implementation::Model::*OneArgMethod) (
    const Abstract::Point& coordinates
);

template<typename Func>
static void checkErrorHandling(
    Implementation::Model* model,
    Func model_method
) {
    // range errors: test all combinations of
    // "wrong" (outside of correct range) arguments
    // Max_index: 0; min_index: 0
    for (int arg1 = -1; arg1 <= 1; arg1++) {
        for (int arg2 = -1; arg2 <= 1; arg2++) {
            if ((arg1 != 0) || (arg2 != 0)) {
                // (0, 0) is correct
                BOOST_REQUIRE_THROW(
                    ((*model).*model_method)(arg1, arg2), Exception
                );
            }
        }
    }
    // "dead" error
    // (attempt to do something with dead bacterium)
{'fraction_non_alphanumeric': 0.13290113452188007, 'fraction_numerical': 0.02593192868719611, 'mean_word_length': 2.160409556313993, 'pattern_counts': {'":': 0, '<': 13, '<?xml version=': 0, '>': 9, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '613014', 'n_tokens_mistral': 612, 'n_tokens_neox': 566, 'n_words': 175}