testexpt.h
来自「开放源码的编译器open watcom 1.6.0版的源代码」· C头文件 代码 · 共 27 行
H
27 行
#define test_except( code, except, string ) \
try{ \
code; \
cout << "supposed to happen exception not thrown\n"; \
} catch( WCExcept::failure oops ) { \
WCExcept::wc_state cause = oops.cause(); \
if( cause & WCExcept::except ) { \
cout << string << " (supposed to happen)\n"; \
} else { \
cout << "wrong except\n"; \
} \
} catch( ... ) { \
cout << "should not get here!\n"; \
}
#define not_happen_except( code, string ) \
try{ \
code; \
} catch( WCExcept::failure oops ) { \
WCExcept::wc_state cause = oops.cause(); \
if( cause & WCExcept::check_all ) { \
cout << string << " (supposed to happen)\n"; \
} \
} catch( ... ) { \
cout << "should not get here!\n"; \
}
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?