Boost logo

Boost Users :

From: Markus Schöpflin (markus.schoepflin_at_[hidden])
Date: 2005-08-23 02:51:37

Steven Solie wrote:

> I'm getting the following output from one of the date_time tests with
> Boost 1.33.0 on AmigaOS:
> execute-test ../../../bin/boost/libs/date_time/test/testdate_facet_new.test/gcc/debug/
> ====== BEGIN OUTPUT ======
> Pass :: to_string & default formats match
> Pass :: to_string & default formats match
> FAIL :: default classic date
> FAIL :: default classic date period
> Pass :: custom date facet date period
> ....
> I've traced it down to the %x date format specifier using the default
> locale while the tests themselves expect something else.

The test looks like this:

date_facet* datefacet = new date_facet();
teststreaming("default classic date", d, std::string("10/13/04"),
   std::locale(std::locale::classic(), datefacet));

AFAICT, this should produce a date formatted for the classic locale, i.e.
the C locale. But isn't the output of the C local itself implementation

> According to the ANSI K&R C book this is correct behaviour because C++
> classic locale uses the same format specifiers as the ANSI C strftime()
> function.

The C++ classic locale's result is implementation defined, see
of the C++ std. OTOH, the std says that "Implementations are encouraged to
refer to other standards (such as POSIX) for these definitions.", so it
might be a reasonable assumption to expect the POSIX output format for this.

> So am I correct in assuming these two test cases are broken?

If the result of formatting with the classic locale really is
implementation defined, then yes, you are right. I'm sure Jeff can shed
some more light on this.


Boost-users list run by williamkempf at, kalb at, bjorn.karlsson at, gregod at, wekempf at