leap: initial commit
This commit is contained in:
parent
77c36f8e10
commit
e1085191f9
3 changed files with 142 additions and 0 deletions
30
cpp/leap/leap_test.cpp
Normal file
30
cpp/leap/leap_test.cpp
Normal file
|
|
@ -0,0 +1,30 @@
|
|||
#include "leap.h"
|
||||
#define BOOST_TEST_MAIN
|
||||
#include <boost/test/unit_test.hpp>
|
||||
|
||||
BOOST_AUTO_TEST_CASE(a_known_leap_year)
|
||||
{
|
||||
BOOST_REQUIRE(leap::is_leap_year(1996));
|
||||
}
|
||||
|
||||
#if defined(EXERCISM_RUN_ALL_TESTS)
|
||||
BOOST_AUTO_TEST_CASE(any_old_year)
|
||||
{
|
||||
BOOST_REQUIRE(!leap::is_leap_year(1997));
|
||||
}
|
||||
|
||||
BOOST_AUTO_TEST_CASE(turn_of_the_20th_century)
|
||||
{
|
||||
BOOST_REQUIRE(!leap::is_leap_year(1900));
|
||||
}
|
||||
|
||||
BOOST_AUTO_TEST_CASE(turn_of_the_21st_century)
|
||||
{
|
||||
BOOST_REQUIRE(leap::is_leap_year(2000));
|
||||
}
|
||||
|
||||
BOOST_AUTO_TEST_CASE(turn_of_the_25th_century)
|
||||
{
|
||||
BOOST_REQUIRE(leap::is_leap_year(2400));;
|
||||
}
|
||||
#endif
|
||||
Loading…
Add table
Add a link
Reference in a new issue