OCI - session 3: Tools and best practices for reliable ... - Thibault Cholez

Mar 1, 2017 - class MyException : public std::runtime_error. { public: ... UnitTest++, Google Test, etc.) Testing: ... Unit testing with Google Test. #include ...
269KB taille 1 téléchargements 201 vues
OCI - session 3: Tools and best practices for reliable C++ programming

Thibault CHOLEZ - [email protected] TELECOM Nancy - Universit´ e de Lorraine LORIA - INRIA Nancy Grand-Est From Nicolas Rougier’s C++ crash course

01/03/2017

Error management

Automatic testing

Debugging

Code profiling

Mixed programming

Cross compilation

Plan 1

Error management

2

Automatic testing

3

Debugging

4

Code profiling

5

Mixed programming

6

Cross compilation

OCI - session 3: Tools and best practices for reliable C++ programming 2 / 30

Error management

Automatic testing

Debugging

Code profiling

Mixed programming

Cross compilation

Plan 1

Error management

2

Automatic testing

3

Debugging

4

Code profiling

5

Mixed programming

6

Cross compilation

OCI - session 3: Tools and best practices for reliable C++ programming 3 / 30

Error management

Automatic testing

Debugging

Code profiling

Mixed programming

Cross compilation

Catching an exception Contrary to C ”error codes”, exceptions are transmitted from the callee to the caller until being catched You can catch any exception using the structure bellow If the raised exception is different from the ones you’re catching, program will stop try { float *array = new float[-1]; } catch( std::bad_alloc e ) { std::cerr