,   "Value Borneo invalid for type '"
,   "Value 'Borneo' invalid for type '"
int test_main(int, char*[]){    // Default ctor.    e_holiday holiday0;    BOOST_TEST_EQUAL("Theophany", holiday0);    // Construct from enumerator.    e_holiday holiday1(h_Easter);    BOOST_TEST_EQUAL(holiday1, "Easter");    // Construct from std::string.    std::string const s_Pentecost("Pentecost");    e_holiday holiday2(s_Pentecost);    BOOST_TEST_EQUAL(holiday2, "Pentecost");    // Construct from char const* implicitly converted to std::string.    e_holiday holiday3("Pentecost");    BOOST_TEST_EQUAL(holiday3, "Pentecost");    // Copy ctor.    e_holiday holiday4(holiday1);    BOOST_TEST_EQUAL(holiday4, "Easter");    // Copy assignment operator.    holiday4 = holiday2;    BOOST_TEST_EQUAL(holiday4, "Pentecost");    // Assign from enumerator.    holiday4 = h_Theophany;    BOOST_TEST_EQUAL(holiday4, "Theophany");    // Assign from std::string.    holiday4 = s_Pentecost;    BOOST_TEST_EQUAL(holiday4, "Pentecost");    // Assign from char const* implicitly converted to std::string.    holiday4 = "Easter";    BOOST_TEST_EQUAL(holiday4, "Easter");    // Equivalence to same type.    BOOST_TEST_EQUAL(holiday4, holiday1);    // Equivalence to enumerator.    BOOST_TEST_EQUAL(holiday4, h_Easter);    // Equivalence to std::string.    std::string const s_Easter("Easter");    BOOST_TEST_EQUAL(holiday4, s_Easter);    // Equivalence to char const* implicitly converted to std::string.    BOOST_TEST_EQUAL(holiday4, "Easter");    // Operators added by boost::equality_comparable.    BOOST_TEST_EQUAL  (h_Easter,    holiday4);    BOOST_TEST_EQUAL  (s_Easter,    holiday4);    BOOST_TEST_EQUAL  ("Easter",    holiday4);    BOOST_TEST_UNEQUAL(holiday3,    holiday4);    BOOST_TEST_UNEQUAL(h_Pentecost, holiday4);    BOOST_TEST_UNEQUAL(s_Pentecost, holiday4);    BOOST_TEST_UNEQUAL("Pentecost", holiday4);    // Ordinal. Function ordinal() itself is not tested because it's    // private, but this is equivalent here.    BOOST_TEST_EQUAL(holiday4.allowed_ordinal(), 1);    // Explicit conversion to std::string.    BOOST_TEST_EQUAL(holiday4.str(), "Easter");    // Explicit conversion to enumerator.    BOOST_TEST_EQUAL(holiday4.value(), h_Easter);    // Cardinality.    BOOST_TEST_EQUAL(holiday4.cardinality(), 3);    mc_enum_base* base_pointer = dynamic_cast<mc_enum_base*>(&holiday4);    BOOST_TEST_UNEQUAL(base_pointer, 0);    int expected_cardinality = 0;    if(base_pointer)        {        expected_cardinality = base_pointer->cardinality();        }    BOOST_TEST_EQUAL(expected_cardinality, 3);    // Strings.    BOOST_TEST_EQUAL("Theophany", holiday4.str(0));    BOOST_TEST_EQUAL("Easter"   , holiday4.str(1));    BOOST_TEST_EQUAL("Pentecost", holiday4.str(2));    // Allowed ordinal. By default, any conceivable value is allowed,    // conceivability meaning 0 <= value < cardinality.    BOOST_TEST_EQUAL(holiday4.allowed_ordinal(), 1);    // If current value isn't allowed, pick the first one that is.    holiday4.allow(1, false);    BOOST_TEST(!holiday4.is_allowed(1));    BOOST_TEST_EQUAL(holiday4.allowed_ordinal(), 0);    holiday4.allow(0, false);    BOOST_TEST(!holiday4.is_allowed(0));    BOOST_TEST_EQUAL(holiday4.allowed_ordinal(), 2);    // If no value is allowed, return the current ordinal.    holiday4.allow(2, false);    BOOST_TEST(!holiday4.is_allowed(2));    BOOST_TEST_EQUAL(holiday4.allowed_ordinal(), 1);    // That which is inconceivable is not to be allowed.    BOOST_TEST_THROW(holiday4.allow( 3, false), std::runtime_error, "");    BOOST_TEST_THROW(holiday4.allow(17, false), std::runtime_error, "");    BOOST_TEST_THROW(holiday4.allow(-1, false), std::runtime_error, "");    // Stream operators.    e_holiday const Easter(h_Easter);    e_holiday holiday5;    std::stringstream ss;    ss << Easter;    ss >> holiday5;    BOOST_TEST_EQUAL(Easter, holiday5);    ss.str("");    ss.clear();    e_holiday const Pentecost(h_Pentecost);    ss << Pentecost;    ss >> holiday5;    BOOST_TEST_EQUAL(Pentecost, holiday5);    // Test an enum class defined in this translation unit that has a    // std::string name that matches one in a different class.    e_island island0;    BOOST_TEST_EQUAL("Easter", island0);    BOOST_TEST_EQUAL(i_Easter, island0);    // Streaming shouldn't stop reading at blanks, which are not    // treated as whitespace.    e_island island1(i_Pago_Pago);    ss.clear();    ss.str("");    ss << island1;    ss >> island1;    BOOST_TEST_EQUAL("Pago Pago", island1);    BOOST_TEST_THROW        (e_island unknown("Borneo")        ,std::runtime_error        ,   "Value Borneo invalid for type '"        +   std::string(typeid(enum_island).name())        +   "'."        );    return 0;}