Sha256: be768f4737e0bd80ea797bbc1389969cd7c50f7ecd788912a1ee92451d6a5083

Contents?: true

Size: 1.06 KB

Versions: 396

Compression:

Stored size: 1.06 KB

Contents

#include "trinary.h"
#define BOOST_TEST_MAIN
#include <boost/test/unit_test.hpp>

BOOST_AUTO_TEST_CASE(_1_yields_decimal_1)
{
    BOOST_REQUIRE_EQUAL(1, trinary::to_decimal("1"));
}

#if defined(EXERCISM_RUN_ALL_TESTS)
BOOST_AUTO_TEST_CASE(_2_yields_decimal_2)
{
    BOOST_REQUIRE_EQUAL(2, trinary::to_decimal("2"));
}

BOOST_AUTO_TEST_CASE(_10_yields_decimal_3)
{
    BOOST_REQUIRE_EQUAL(3, trinary::to_decimal("10"));
}

BOOST_AUTO_TEST_CASE(_11_yields_decimal_4)
{
    BOOST_REQUIRE_EQUAL(4, trinary::to_decimal("11"));
}

BOOST_AUTO_TEST_CASE(_100_yields_decimal_9)
{
    BOOST_REQUIRE_EQUAL(9, trinary::to_decimal("100"));
}

BOOST_AUTO_TEST_CASE(_112_yields_decimal_14)
{
    BOOST_REQUIRE_EQUAL(14, trinary::to_decimal("112"));
}

BOOST_AUTO_TEST_CASE(_222_yields_decimal_26)
{
    BOOST_REQUIRE_EQUAL(26, trinary::to_decimal("222"));
}

BOOST_AUTO_TEST_CASE(_1122000120_yields_decimal_32091)
{
    BOOST_REQUIRE_EQUAL(32091, trinary::to_decimal("1122000120"));
}

BOOST_AUTO_TEST_CASE(invalid_yields_decimal_0)
{
    BOOST_REQUIRE_EQUAL(0, trinary::to_decimal("carrot"));
}
#endif

Version data entries

396 entries across 396 versions & 1 rubygems

Version Path
trackler-2.2.1.180 tracks/cpp/exercises/trinary/trinary_test.cpp
trackler-2.2.1.179 tracks/cpp/exercises/trinary/trinary_test.cpp
trackler-2.2.1.178 tracks/cpp/exercises/trinary/trinary_test.cpp
trackler-2.2.1.177 tracks/cpp/exercises/trinary/trinary_test.cpp
trackler-2.2.1.176 tracks/cpp/exercises/trinary/trinary_test.cpp
trackler-2.2.1.175 tracks/cpp/exercises/trinary/trinary_test.cpp
trackler-2.2.1.174 tracks/cpp/exercises/trinary/trinary_test.cpp
trackler-2.2.1.173 tracks/cpp/exercises/trinary/trinary_test.cpp
trackler-2.2.1.172 tracks/cpp/exercises/trinary/trinary_test.cpp
trackler-2.2.1.171 tracks/cpp/exercises/trinary/trinary_test.cpp
trackler-2.2.1.170 tracks/cpp/exercises/trinary/trinary_test.cpp
trackler-2.2.1.169 tracks/cpp/exercises/trinary/trinary_test.cpp
trackler-2.2.1.167 tracks/cpp/exercises/trinary/trinary_test.cpp
trackler-2.2.1.166 tracks/cpp/exercises/trinary/trinary_test.cpp
trackler-2.2.1.165 tracks/cpp/exercises/trinary/trinary_test.cpp
trackler-2.2.1.164 tracks/cpp/exercises/trinary/trinary_test.cpp
trackler-2.2.1.163 tracks/cpp/exercises/trinary/trinary_test.cpp
trackler-2.2.1.162 tracks/cpp/exercises/trinary/trinary_test.cpp
trackler-2.2.1.161 tracks/cpp/exercises/trinary/trinary_test.cpp
trackler-2.2.1.160 tracks/cpp/exercises/trinary/trinary_test.cpp