On Thu, Apr 21, 2005 at 11:49:21AM +0100, Christian Smith wrote:
> I know the snippet above is from a test program, but don't ever put things
> like sqlite3_exec() inside an assert()! I hope you're (OP) not doing this in
> your application.

I realize that evaluation of assert() is short-circuited when NDEBUG is defined
during the compile (i.e typically when optimizations are used). Using assert()
in a test program like this is a very quick, very effective, way to insure that
each of your OS calls is completing successfully. Much better (IMHO) than
naively assuming that everything succeeds and then being dumbfounded later when
things break in mysterious ways.

-- William Hachfeld

Reply via email to