test.h

来自「HIP 硬件设备管理标准接口」· C头文件 代码 · 共 39 行

H
39
字号
#ifndef dTest_h#define dTest_h#include <stdio.h>static int num_ok   = 0;static int num_fail = 0;static voidTestFunction( const char *str, const char *file, int line, bool expr ){  if ( expr )       num_ok++;  else     {       printf( "FAIL %s:%d: %s\n", file, line, str );       num_fail++;     }}#define Test(expr) TestFunction( __STRING(expr), __FILE__, __LINE__, expr )static intTestResult(){  if ( num_fail )       return 1;  return 0;}#endif

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?