📄 test.h
字号:
// test.h// utilities for test code// copyright SafeTP Development Group, Inc., 2000 Terms of use are as specified in license.txt#ifndef __TEST_H#define __TEST_H#include <iostream.h> // cout#include <stdio.h> // printf#include "exc.h" // xBase#include "nonport.h" // getMilliseconds// reports uncaught exceptions#define USUAL_MAIN \int main() \{ \ try { \ entry(); \ return 0; \ } \ catch (xBase &x) { \ cout << "exception caught: " << x << endl; \ return 4; \ } \}// same as above, but with command-line args#define ARGS_MAIN \int main(int argc, char *argv[]) \{ \ try { \ entry(argc, argv); \ return 0; \ } \ catch (xBase &x) { \ cout << "exception caught: " << x << endl; \ return 4; \ } \}// convenient for printing the value of a variable or expression#define PVAL(val) cout << #val << " = " << (val) << endl// easy way to time a section of codeclass TimedSection { char const *name; long start;public: TimedSection(char const *n) : name(n) { start = getMilliseconds(); } ~TimedSection() { cout << name << ": " << (getMilliseconds() - start) << " msecs\n"; }};#endif // __TEST_H
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -