Boost Testing :
From: Caleb Epstein (caleb.epstein_at_[hidden])
Date: 2005-06-02 08:25:34
On 6/2/05, Victor A. Wagner Jr. <vawjr_at_[hidden]> wrote:
> One has to wonder why the test functions in 7.1 then and fails in
> 8.0. Surely you don't imply that the older libraries were "better".
The VS2005 runtime has deprecated many "standard" facilities that are
either unsafe or prone to overflow, localtime() among them. The
deprecated functions now either have 64-bit analogs or *_s (safe)
versions. It seems that as part of this, MS has added asserting range
checks on the values passed to functions like localtime (really
_localtime64_s down deep).
Attached is a simple test program that illustrates the behavior of
localtime using extreme values of time_t (-1,
It runs without generating any errors on Visual Studio .NET 2003,
though the return values of localtime are NULL when the time_t
argument is <0. Output:
With VS2005, an exception is thrown from _localtime64_s when a
negative value is passed to localtime, terminating the program.
Here's the pertinent info from the popup I see when compiled with
Expression: ( ( *ptime >= 0) && (*ptime <= _MAX__TIME64_T ) )
This happens with the non-debug runtime as well, though the popup is
-- Caleb Epstein caleb dot epstein at gmail dot com