<commit_before>#include "../src/include/Player.hpp"
#define BOOST_TEST_MODULE Test_player
#include <boost/test/unit_test.hpp>

/* Fixture: player initialized with 42 lives */
struct PlayerTester {
    Player * p;
    PlayerTester() { p = new Player(42); }
    ~PlayerTester() { delete p; }
};

BOOST_AUTO_TEST_SUITE( Player_constructors )

BOOST_AUTO_TEST_CASE( Player_defaultContructor )
{
    Player p;
    BOOST_CHECK_EQUAL( p.getLifes(), 3 );
}

BOOST_AUTO_TEST_CASE( Player_contructor )
{
    Player p(42);
    BOOST_CHECK_EQUAL( p.getLifes(), 42);
}

BOOST_AUTO_TEST_SUITE_END()

BOOST_AUTO_TEST_SUITE( Player_removeLife )

BOOST_FIXTURE_TEST_CASE( Player_removeLife_init_fixture, PlayerTester )
{
    BOOST_REQUIRE_EQUAL( p->getLifes(), 42);
}

BOOST_FIXTURE_TEST_CASE( Player_removeLife_default, PlayerTester )
{
    p->removeLife();
    BOOST_CHECK_EQUAL( p->getLifes(), 41);
}

BOOST_FIXTURE_TEST_CASE( Player_removeLife_int, PlayerTester )
{
    p->removeLife(42);
    BOOST_CHECK_EQUAL( p->getLifes(), 42);
}

/*
  BOOST_FIXTURE_TEST_CASE( Player_removeLife_below_zero, PlayerTester )
  {
  p->removeLife(43);
  }
*/

BOOST_AUTO_TEST_SUITE_END() // Player_removeLife

BOOST_AUTO_TEST_SUITE( Player_addLife )

BOOST_FIXTURE_TEST_CASE( Player_addLife_init_fixture, PlayerTester )
{
    BOOST_REQUIRE_EQUAL( p->getLifes(), 42);
}

BOOST_FIXTURE_TEST_CASE( Player_addLife_default, PlayerTester )
{
    p->addLife();
    BOOST_CHECK_EQUAL( p->getLifes(), 43);
}

BOOST_FIXTURE_TEST_CASE( Player_addLife_int, PlayerTester )
{
    p->addLife(42);
    BOOST_CHECK_EQUAL( p->getLifes(), 84);
}

/*
  BOOST_FIXTURE_TEST_CASE( Player_addLife_overflow, PlayerTester )
  {
  }
*/
BOOST_AUTO_TEST_SUITE_END() // Player_addLife


BOOST_AUTO_TEST_SUITE( Player_setLife )

BOOST_FIXTURE_TEST_CASE( Player_setLife_init_fixture, PlayerTester )
{
    BOOST_REQUIRE_EQUAL( p->getLifes(), 42);
}

BOOST_FIXTURE_TEST_CASE( Player_setLife_int, PlayerTester )
{
    p->setLifes(1);
    BOOST_CHECK_EQUAL( p->getLifes(), 1);
}

BOOST_AUTO_TEST_SUITE_END() //Player_setLife

/* TODO: same with score */

/* TODO: draw */<commit_msg>updated the test with plurals<commit_after>#include "../src/include/Player.hpp"
#define BOOST_TEST_MODULE Test_player
#include <boost/test/unit_test.hpp>

/* Fixture: player initialized with 42 lives */
struct PlayerTester {
    Player * p;
    PlayerTester() { p = new Player(42); }
    ~PlayerTester() { delete p; }
};

BOOST_AUTO_TEST_SUITE( Player_constructors )

BOOST_AUTO_TEST_CASE( Player_defaultContructor )
{
    Player p;
    BOOST_CHECK_EQUAL( p.getLifes(), 3 );
}

BOOST_AUTO_TEST_CASE( Player_contructor )
{
    Player p(42);
    BOOST_CHECK_EQUAL( p.getLifes(), 42);
}

BOOST_AUTO_TEST_SUITE_END()

BOOST_AUTO_TEST_SUITE( Player_removeLife )

BOOST_FIXTURE_TEST_CASE( Player_removeLifes_init_fixture, PlayerTester )
{
    BOOST_REQUIRE_EQUAL( p->getLifes(), 42);
}

BOOST_FIXTURE_TEST_CASE( Player_removeLifes_default, PlayerTester )
{
    p->removeLifes();
    BOOST_CHECK_EQUAL( p->getLifes(), 41);
}

BOOST_FIXTURE_TEST_CASE( Player_removeLifes_int, PlayerTester )
{
    p->removeLifes(42);
    BOOST_CHECK_EQUAL( p->getLifes(), 42);
}

/*
  BOOST_FIXTURE_TEST_CASE( Player_removeLife_below_zero, PlayerTester )
  {
  p->removeLife(43);
  }
*/

BOOST_AUTO_TEST_SUITE_END() // Player_removeLife

BOOST_AUTO_TEST_SUITE( Player_addLifes )

BOOST_FIXTURE_TEST_CASE( Player_addLifes_init_fixture, PlayerTester )
{
    BOOST_REQUIRE_EQUAL( p->getLifes(), 42);
}

BOOST_FIXTURE_TEST_CASE( Player_addLifes_default, PlayerTester )
{
    p->addLifes();
    BOOST_CHECK_EQUAL( p->getLifes(), 43);
}

BOOST_FIXTURE_TEST_CASE( Player_addLifes_int, PlayerTester )
{
    p->addLifes(42);
    BOOST_CHECK_EQUAL( p->getLifes(), 84);
}

/*
  BOOST_FIXTURE_TEST_CASE( Player_addLife_overflow, PlayerTester )
  {
  }
*/
BOOST_AUTO_TEST_SUITE_END() // Player_addLife


BOOST_AUTO_TEST_SUITE( Player_setLifes )

BOOST_FIXTURE_TEST_CASE( Player_setLifes_init_fixture, PlayerTester )
{
    BOOST_REQUIRE_EQUAL( p->getLifes(), 42);
}

BOOST_FIXTURE_TEST_CASE( Player_setLifes_int, PlayerTester )
{
    p->setLifes(1);
    BOOST_CHECK_EQUAL( p->getLifes(), 1);
}

BOOST_AUTO_TEST_SUITE_END() //Player_setLife

/* TODO: same with score */

/* TODO: draw */
{'fraction_non_alphanumeric': 0.11866791744840526, 'fraction_numerical': 0.014540337711069419, 'mean_word_length': 5.281296023564065, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 33, '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': '4807368', 'n_tokens_mistral': 1749, 'n_tokens_neox': 1655, 'n_words': 242}