📄 testsgl.h
字号:
//
// testsgl.h
//
// $Id: testsgl.h,v 1.1.1.1 2001/02/28 00:28:39 cstolte Exp $
//
#ifndef TESTSGL_H
#define TESTSGL_H
#include <stdlib.h>
#define checkXYZ(a,b) { if (!equal((a).x,(b).x)) \
cerr << __LINE__ << ":" << iteration << ":FailureX " << (a).x << " != " << (b).x << endl; \
if (!equal((a).y,(b).y)) \
cerr << __LINE__ << ":" << iteration << ":FailureY " << (a).y << " != " << (b).y << endl; \
if (!equal((a).z,(b).z)) \
cerr << __LINE__ << ":" << iteration << ":FailureZ " << (a).z << " != " << (b).z << endl; }
#define checkRGB(q,w) { if (!equal((q).r,(w).r)) \
cerr << __LINE__ << ":" << iteration << ":FailureR " << (q).r << " != " << (w).r << endl; \
if (!equal((q).g,(w).g)) \
cerr << __LINE__ << ":" << iteration << ":FailureG " << (q).g << " != " << (w).g << endl; \
if (!equal((q).b,(w).b)) \
cerr << __LINE__ << ":" << iteration << ":FailureB " << (q).b << " != " << (w).b << endl; }
#define checkSRGB(q,w) { if (!equal((q).r,(w).r)) \
cerr << __LINE__ << ":" << iteration << ":FailureR " << (q).r << " != " << (q).r << endl; \
if (!equal((q).g,(w).g)) \
cerr << __LINE__ << ":" << iteration << ":FailureG " << (q).g << " != " << (w).g << endl; \
if (!equal((q).b,(w).b)) \
cerr << __LINE__ << ":" << iteration << ":FailureB " << (q).b << " != " << (w).b << endl; }
#define checkUV(a,b) { if (!equal((a).u,(b).u)) \
cerr << __LINE__ << ":" << iteration << ":FailureU " << (a).u << " != " << (b).u << endl; \
if (!equal((a).v,(b).v)) \
cerr << __LINE__ << ":" << iteration << ":FailureV " << (a).v << " != " << (b).v << endl; }
#define checkIval(a,b) { if (!equal((a).sup(), (b).sup())) \
cerr << __LINE__ << ":" << iteration << ":FailureSup " << (a).sup() << " != " << (b).sup() << endl; \
if (!equal((a).inf(), (b).inf())) \
cerr << __LINE__ << ":" << iteration << ":FailureInf " << (a).inf() << " != " << (b).inf() << endl; }
#define checkH2(a,b) { assert((a.d == 0 && b.d == 0) || (a.d != 0 && b.d != 0)); \
if (a.d == 0) { \
assert(equal(a.u, b.u)); \
assert(equal(a.v, b.v)); \
} else { \
assert(equal(a.u / a.d, b.u / b.d)); \
assert(equal(a.v / a.d, b.v / b.d)); \
} }
#define checkH3(a,b) { assert((a.d == 0 && b.d == 0) || (a.d != 0 && b.d != 0)); \
if (a.d == 0) { \
assert(equal(a.x, b.x)); \
assert(equal(a.y, b.y)); \
assert(equal(a.z, b.z)); \
} else { \
assert(equal(a.x / a.d, b.x / b.d)); \
assert(equal(a.y / a.d, b.y / b.d)); \
assert(equal(a.z / a.d, b.z / b.d)); \
} }
inline double doub_random() {
return (drand48() - .5) * 1000;
}
#endif // TESTSGL_H
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -