📄 exceptiontest.cpp
字号:
#pragma ident "$Id$"#include <iostream>#include <string>#include "Exception.hpp"/** * @file exceptiontest.cpp * tests gpslib::Exception */using namespace std;class TestException{public: NEW_EXCEPTION_CLASS(TE, gpstk::Exception); int foo; void funcie() throw(TE) { try { foo=1; if (foo-1==0) { TE e("Blarfo"); e.addLocation(FILE_LOCATION); throw e; } foo=4; } catch (TE& e) { e.addText("Ja mon"); e.addLocation(FILE_LOCATION); throw; } }};// returns 0 if all tests passint main(){ TestException a; try { a.funcie(); } catch (gpstk::Exception& e) { cout << "main " << e; }}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -