<commit_before>#include <SDL2/SDL.h>

#include "catch.hpp"
#include "../src/Camera.h"

TEST_CASE( "CameraTests", "[camera]" )
{
	flat2d::Camera *camera = new flat2d::Camera(200, 100);
	camera->setMapDimensions(1000, 100);

	SECTION( "Map dimensions", "[camera][map]" )
	{
		camera->setMapDimensions(1000, 100);
		REQUIRE( camera->getMapWidth() == 1000 );
		REQUIRE( camera->getMapHeight() == 100 );
		camera->setMapDimensions(2000, 200);
		REQUIRE( camera->getMapWidth() == 2000 );
		REQUIRE( camera->getMapHeight() == 200 );
	}

	SECTION( "Camera dimensions", "[camera]" )
	{
		REQUIRE( camera->getHeight() == 100 );
		REQUIRE( camera->getWidth() == 200 );
	}

	SECTION( "Is visible on camera", "[camera]" )
	{
		SDL_Rect box = { 0, 0, 50, 50 };
		REQUIRE( camera->isVisibleOnCamera(box) );
		box.x = -25;
		box.y = -25;
		REQUIRE( camera->isVisibleOnCamera(box) );
		box.x = 201;
		box.y = 101;
		REQUIRE( !camera->isVisibleOnCamera(box) );
		box.x = 199;
		box.y = 99;
		REQUIRE( camera->isVisibleOnCamera(box) );
	}

	SECTION( "Center camera", "[camera]" )
	{
		camera->setMapDimensions(1000, 1000);
		camera->centerOn(500, 500);
		REQUIRE(camera->getXpos() == 400);
		REQUIRE(camera->getYpos() == 450);
	}
}<commit_msg>Extended Camera center test slightly<commit_after>#include <SDL2/SDL.h>

#include "catch.hpp"
#include "../src/Camera.h"

TEST_CASE( "CameraTests", "[camera]" )
{
	flat2d::Camera *camera = new flat2d::Camera(200, 100);
	camera->setMapDimensions(1000, 100);

	SECTION( "Map dimensions", "[camera][map]" )
	{
		camera->setMapDimensions(1000, 100);
		REQUIRE( camera->getMapWidth() == 1000 );
		REQUIRE( camera->getMapHeight() == 100 );
		camera->setMapDimensions(2000, 200);
		REQUIRE( camera->getMapWidth() == 2000 );
		REQUIRE( camera->getMapHeight() == 200 );
	}

	SECTION( "Camera dimensions", "[camera]" )
	{
		REQUIRE( camera->getHeight() == 100 );
		REQUIRE( camera->getWidth() == 200 );
	}

	SECTION( "Is visible on camera", "[camera]" )
	{
		SDL_Rect box = { 0, 0, 50, 50 };
		REQUIRE( camera->isVisibleOnCamera(box) );
		box.x = -25;
		box.y = -25;
		REQUIRE( camera->isVisibleOnCamera(box) );
		box.x = 201;
		box.y = 101;
		REQUIRE( !camera->isVisibleOnCamera(box) );
		box.x = 199;
		box.y = 99;
		REQUIRE( camera->isVisibleOnCamera(box) );
	}

	SECTION( "Center camera", "[camera]" )
	{
		camera->setMapDimensions(1000, 1000);
		camera->centerOn(500, 500);
		REQUIRE(camera->getXpos() == 400);
		REQUIRE(camera->getYpos() == 450);

		camera->centerOn(1000, 1000);
		REQUIRE(camera->getXpos() == 800);
		REQUIRE(camera->getYpos() == 900);
	}
}
{'fraction_non_alphanumeric': 0.19937936384794414, 'fraction_numerical': 0.07602792862684252, 'mean_word_length': 4.317525773195876, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 42, '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': '6778250', 'n_tokens_mistral': 1204, 'n_tokens_neox': 980, 'n_words': 190}