<commit_before>import me.hugmanrique.pokedata.maps.Map;
import me.hugmanrique.pokedata.roms.Game;
import me.hugmanrique.pokedata.roms.ReadableROM;
import org.junit.Test;

public class MapLoadingTest extends ROMTest {
    /**
     * Load up the ROM, check Pallet Town data and exit
     */
    @Test
    public void testMapDataIntegrity() {
        ReadableROM rom = load();

        checkFireRed(rom);


        // Pallet town is
        Map map = Map.load(rom, data, 3, 0);

    }
}<commit_msg>Add Map loading test<commit_after>import me.hugmanrique.pokedata.loaders.ROMData;
import me.hugmanrique.pokedata.maps.Map;
import me.hugmanrique.pokedata.maps.MapData;
import me.hugmanrique.pokedata.maps.MapHeader;
import me.hugmanrique.pokedata.maps.MapTileData;
import me.hugmanrique.pokedata.roms.ReadableROM;
import org.junit.Test;

public class MapLoadingTest extends ROMTest {
    /**
     * Load up the ROM, check Pallet Town data and exit
     */
    @Test
    public void testMapDataIntegrity() {
        ReadableROM rom = load();

        checkFireRed(rom);

        ROMData data = loadData(rom);

        // Pallet town is in bank 3, map 0
        Map map = Map.load(rom, data, 3, 0);

        // Check header
        MapHeader header = map.getHeader();

        checkPointer("Map data", header.getMapPtr(), 0x2DD4C0);
        checkPointer("Event data", header.getSpritesPtr(), 0x3B4E50);
        checkPointer("Map scripts", header.getScriptPtr(), 0x16545A);
        checkPointer("Connections", header.getConnectPtr(), 0x35276C);

        // Check data
        MapData mapData = map.getData();

        checkPointer("Border", mapData.getBorderTilePtr(), 0x2DD0F8);
        checkPointer("Tile structure", mapData.getMapTilesPtr(), 0x2DD100);
        checkPointer("Global tileset", mapData.getGlobalTilesetPtr(), 0x2D4A94);
        checkPointer("Local tileset", mapData.getLocalTilesetPtr(), 0x2D4AAC);

        // TODO Check scripts, connections...
    }

    private void checkPointer(String name, long pointer, long expected) {
        if (pointer != expected) {
            throwFail(name, pointer, expected);
        }
    }

    private void throwFail(String name, Object obj, Object comparedTo) {
        String message = String.format("%s don't/doesn't match (got %s, expected: %s)", name, obj, comparedTo);

        throw new Error(message);
    }
}
{'fraction_non_alphanumeric': 0.1143099068585944, 'fraction_numerical': 0.018628281117696866, 'mean_word_length': 3.0255536626916526, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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': '4020492', 'n_tokens_mistral': 782, 'n_tokens_neox': 733, 'n_words': 178}