lmi
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [lmi] authenticity_test.cpp compilation error under Linux


From: Greg Chicares
Subject: Re: [lmi] authenticity_test.cpp compilation error under Linux
Date: Mon, 02 Jun 2008 02:57:00 +0000
User-agent: Thunderbird 2.0.0.14 (Windows/20080421)

On 2008-06-01 23:01Z, Vadim Zeitlin wrote:
> 
> The following trivial patch

...was applied 20080602T0229Z.

> of course, but I'm not sure whether the CheckNominal() call before the end
> of the function is intentional,

It is intentional. In this module, multiple 'Test*()' functions
each violate separate conditions that are all necessary for the
objective condition of "authenticity". This particular function
ensures, e.g., that, at exit, each test restores the conditions
it deliberately messed up, so that one test doesn't spoil another
and impel us to search for a problem in the wrong place. It feels
like something I would have written upon returning from just such
a fool's errand and resolving never to repeat the same costly
mistake.

> it seems strange to execute it after an
> exception

This C++ exception isn't an irrecoverable problem in execution;
it's an error in a library that I don't want to patch. Here,
try...catch serves to work around a defect in boost:

/// BOOST !! This test traps an exception that boost-1.33.1 can throw
/// if exists("E:/") returns true but ::GetFileAttributesA() fails.
/// That's supposed to be impossible because the is_directory()
/// documentation says:
///   "Throws: if !exists(ph)"
/// but it can be reproduced by placing an unformatted disk in "E:".

> but I admit that I don't really understand what does this code
> do.

I therefore amplified its inline documentation.





reply via email to

[Prev in Thread] Current Thread [Next in Thread]