<commit_before>#include <gtest/gtest.h>
#include <Options.h>
#include <TileGenerator.h>
#include <TilesetGenerator.h>

class TestTilesetGenerator : public ::testing::Test {
protected:
    virtual void SetUp()
    {

    }
    virtual void TearDown()
    {
        
    }
};

TEST_F(TestTilesetGenerator, TestGenerateClique)
{
    std::string filename("../Wangscape/example/example_options.json");
    const Options options(filename);
    TilesetGenerator tg(options);
    std::map<std::pair<size_t, size_t>, std::vector<TerrainID>> tiles;
    const auto& clique = options.cliques[0];
    sf::RenderTexture image;
    tg.generateClique(clique, image, "nope.png",
                      [&](sf::RenderTexture& image, size_t x, size_t y,
                          std::vector<TerrainID> terrains,
                          const TerrainImages& images,
                          const Options& options)
    {
        tiles.insert({ { x,y }, terrains });
    });
    const auto& first_tile = tiles.at({ 0,0 });
    for (auto corner : first_tile)
    {
        EXPECT_EQ(corner.c_str(), "g") << "Incorrect corners in first tile";
    }
    const auto& last_tile = tiles.at({ 3,3 });
    for (auto corner : last_tile)
    {
        EXPECT_EQ(corner.c_str(), "s") << "Incorrect corners in last tile";
    }
    for (size_t x = 0; x < 4; x++)
    {
        for (size_t y = 0; y < 4; y++)
        {<commit_msg>Fix TestGenerateClique<commit_after>#include <gtest/gtest.h>
#include <Options.h>
#include <TileGenerator.h>
#include <TilesetGenerator.h>

class TestTilesetGenerator : public ::testing::Test {
protected:
    virtual void SetUp()
    {

    }
    virtual void TearDown()
    {
        
    }
};

TEST_F(TestTilesetGenerator, TestGenerateClique)
{
    std::string filename("../Wangscape/example/example_options.json");
    const Options options(filename);
    TilesetGenerator tg(options);
    std::map<std::pair<size_t, size_t>, std::vector<TerrainID>> tiles;
    const auto& clique = options.cliques[0];
    sf::RenderTexture image;
    tg.generateClique(clique, image, "nope.png",
                      [&](sf::RenderTexture& image, size_t x, size_t y,
                          std::vector<TerrainID> terrains,
                          const TerrainImages& images,
                          const Options& options)
    {
        tiles.insert({ { x,y }, terrains });
    });
    const auto& first_tile = tiles.at({ 0,0 });
    for (auto corner : first_tile)
    {
        EXPECT_STREQ(corner.c_str(), "g") << "Incorrect corner in first tile";
    }
    const auto& last_tile = tiles.at({ 3,3 });
    for (auto corner : last_tile)
    {
        EXPECT_STREQ(corner.c_str(), "s") << "Incorrect corner in last tile";
    }
    for (size_t x = 0; x < 4; x++)
    {
        for (size_t y = 0; y < 4; y++)
        {
{'fraction_non_alphanumeric': 0.1401636428317325, 'fraction_numerical': 0.0064034151547491995, 'mean_word_length': 2.4545454545454546, 'pattern_counts': {'":': 0, '<': 31, '<?xml version=': 0, '>': 19, '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': '1771684', 'n_tokens_mistral': 941, 'n_tokens_neox': 918, 'n_words': 209}