stdcxx-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Travis Vitek" <>
Subject expectation vs requirements for locale facets
Date Sun, 19 Aug 2007 06:09:01 GMT

So I've got myself stuck a little bit, and I'm hoping to get some
direction. The test that I'm writing currently has
some problems. In the test I generate date/time strings like this...

    switch (data.type_) {
    case MyTimeData::get_time:
        *np.put (std::ostreambuf_iterator<char>(&nsb),
                 nio, ' ', &data.time_, 'X') = '\0';

In the test threads, I attempt to read the data back like this...

    switch (data.type_) {
    case MyTimeData::get_time:
        ng.get_time (std::istreambuf_iterator<char>(&nsb),
                     std::istreambuf_iterator<char>(), nio,
                     state, &local);
        RW_ASSERT (local.tm_hour == data.time_.tm_hour);
        RW_ASSERT (local.tm_min == data.time_.tm_min);
        RW_ASSERT (local.tm_sec == data.time_.tm_sec);

The problem is that some locales pad their date/time output with
whitespace [like '7. 6. 1988' or ' 7.6.1988'] and I'm unable to use
num_get<>::get_[time,date] to read what is written by num_put<>::put. It
is my understanding that I should be able to do so. Is this a bug, a
known issue, or is it acceptable behavior that I need to code around in
the test?


View raw message