Title / Description
Code CDcmImage* misc::RetrieveAndMaybeCreateDcmImage( CDcmSeries* a_pSeries, const std::string& a_sImgUID, size_t a_nImageIdx ) { const bool bMakeItFail = false; //true; if ( bMakeItFail) { const bool bFailAlways = true; //false; if ( bFailAlways ) return 0; else { static size_t nCalls = 0; if ( nCalls == std::numeric_limits< size_t >::max() ) nCalls = 0; // Reset if necessary const size_t N = 10; // One call out of N will be forced to fail if ( ++nCalls % N == 0 ) return 0; } } ···/··· }
Author
Highlight as C C++ CSS Clojure Delphi ERb Groovy (beta) HAML HTML JSON Java JavaScript PHP Plain text Python Ruby SQL XML YAML diff code