From: dave@boostpro.com   
      
   on Thu Dec 27 2012, Ian Collins wrote:   
      
   >> Unless certainly the test is not interested in the singleton   
   >> object's state, then it is even simpler:   
   >>   
   >> NullLogger l;   
   >> Logger& GetLogger() { return l;}   
   >>   
   >> and the cases skip the fist line.   
   >>   
   >> I repeat my original question: what the heck can possibly be that   
   >> test-ruining boogie related to singleton usage?   
   >   
   > I'd like to know the answer to that as well.   
      
   A logger singleton is probably not the greatest example for proving this   
   point, because its actions are usually benign and often untested.   
   However, the use of a singleton may impede or prevent the logger from   
   being replaced for testing purposes, or prevent different loggers from   
   being used for individual tests.   
      
   --   
   Dave Abrahams   
   BoostPro Computing Software Development Training   
   http://www.boostpro.com Clang/LLVM/EDG Compilers C++ Boost   
      
      
    [ See http://www.gotw.ca/resources/clcm.htm for info about ]   
    [ comp.lang.c++.moderated. First time posters: Do this! ]   
      
   --- SoupGate-Win32 v1.05   
    * Origin: you cannot sedate... all the things you hate (1:229/2)   
|