Ticket #8336: io.cpp.patch

File io.cpp.patch, 1.1 KB (added by Jeffrey.Flinn@…, 10 years ago)

added test for overwriting tuple_xxx io manipulater, using strings as values, fix compile warning

  • io.cpp

     
    7373        BOOST_TEST (os2.str() == std::string("(TUPU:HUPU:LUPU:4.5)") );
    7474    }
    7575
     76    {
     77        useThisOStringStream os2;
     78        // Set format (a:b:c) for os2;
     79        os2 << tuple_open('(');
     80        os2 << tuple_close(')');
     81        os2 << tuple_delimiter(':');
     82        // overwrite previous setting
     83        os2 << tuple_open("< ");
     84        os2 << tuple_close('>');
     85        os2 << tuple_delimiter(", ");
     86
     87        os2 << make_vector("TUPU", "HUPU", "LUPU", 4.5);
     88        BOOST_TEST (os2.str() == std::string("< TUPU, HUPU, LUPU, 4.5>") );
     89    }
     90
    7691    // The format is still [a, b, c] for os1
    7792    os1 << make_vector(1, 2, 3);
    7893    BOOST_TEST (os1.str() == std::string("[1,2,3][1,2,3]") );
     
    103118    useThisIStringStream is("(100 200 300)");
    104119
    105120    vector<int, int, int> ti;
    106     BOOST_TEST(bool(is >> ti) != 0);
     121    BOOST_TEST((is >> ti) != 0);
    107122    BOOST_TEST(ti == make_vector(100, 200, 300));
    108123
    109124    // Note that strings are problematic: