char assert_buf[];
int assert_buf_len; #ifdef XXX_DEBUG
#define assert(expr, ...) \
do{ \
if ((!(expr))) \
{\
char *str = __FILE__; \
int i; \
for(i=strlen(str);i>=;i--) if(str[i]=='\\'||str[i]=='/') break; \
printf("ASSERTION FAILED (%s) at: %s:%d:: ", #expr, str+i+, __LINE__);\
assert_buf_len = snprintf(assert_buf, sizeof(assert_buf)-, __VA_ARGS__);\
printf("%s\r\n", assert_buf);\
}\
} while ()
#else
#define assert(expr, ...) do{ \
}while()
#endif

一个assert的写法的更多相关文章

  1. Spring MVC 中采用注解方式 Action中跳转到另一个Action的写法

    Spring MVC 中采用注解方式 Action中跳转到另一个Action的写法 在Action中方法的返回值都是字符串行,一般情况是返回某个JSP,如: return "xx" ...

  2. JSP中,EL表达式向session中取出一个attribute和JSP脚本访问session取出一个attribute,写法有何不同?(转自百度知道)

    EL表达式使用起来会更简洁,假如session中有一个属性A(attrA),那么EL和jsp脚本取值的方式如下: EL表达式:${ sessionScope.attrA } JSP脚本:<%=s ...

  3. 在ascx中调用另一个ascx的写法

    using System; using System.Collections.Generic; using System.Linq; using System.Web; using System.We ...

  4. C#去掉字符串最后面的一个标点符号的写法

    keywordHtml = keywordHtml.Remove(keywordHtml.LastIndexOf(','),1);

  5. oracle 单独开始一个事物的写法 。

    SET TRANSACTION NAME 'Update salaries'; SAVEPOINT before_salary_update; UPDATE employees SET salary= ...

  6. Java断言assert

    public class Welcome{ public static void main(String[] args){ assert false; System.out.println(" ...

  7. SQL Server 执行计划操作符详解(1)——断言(Assert)

    前言: 很多很多地方对于语句的优化,一般比较靠谱的回复即使--把执行计划发出来看看.当然那些只看语句就说如何如何改代码,我一直都是拒绝的,因为这种算是纯蒙.根据本人经验,大量的性能问题单纯从语句来看很 ...

  8. 使用xUnit为.net core程序进行单元测试 -- Assert

    第一部分: http://www.cnblogs.com/cgzl/p/8283610.html Assert Assert做什么?Assert基于代码的返回值.对象的最终状态.事件是否发生等情况来评 ...

  9. c++ assert() 使用方法

    assert宏的原型定义在<assert.h>中,其作用是如果它的条件返回错误,则终止程序执行,原型定义: #include <assert.h> void assert( i ...

随机推荐

  1. x64内联汇编注意点

    #include <windows.h> #include <stdio.h> extern "C" int MyPrintf(ULONGLONG,ULON ...

  2. CentOS搭建VPN

    安装ppp #yum install ppp 安装pptpd 配置软件源,修改/etc/yum.repos.d/Doylenet.repo,如果系统没有该文件则创建 #vim /etc/yum.rep ...

  3. win7系统 .chm文件打不开的解决办法

    一.正确操作方法1.鼠标右键单击该CHM文件,在右键快捷窗口中选择“打开方式”-“Microsoft HTML Help Executable”:2.如果出现一个提示窗口,大意是说,该CHM文件的发行 ...

  4. JSP内置对象---request对象(用户登录页面(返回值和数组:gerParameter,getParameterValues))

    创建两个jsp页面:reg.jsp 和 request.jsp reg.jsp: <%@ page language="java" import="java.uti ...

  5. Ant_的最完整build.xml解释

    Ant的概念 Make命令是一个项目管理工具,而Ant所实现功能与此类似.像make,gnumake和nmake这些编译工具都有一定的缺陷,但是Ant却克服了这些工具的缺陷.最初Ant开发者在开发跨平 ...

  6. LLDB, iOS调试器

    breakpoint set -s "" breakpoint set    -M <method> ( --method <method> )    -S ...

  7. ssh无密钥登陆的简单配置

    主要目的是把本地的公钥放到远端被登陆的host上. 本地操作: # ssh-keygen # ssh-copy-id user@host 远端sshd_config配置: RSAAuthenticat ...

  8. 一个自定义控件的Demo

    里面包括Button.Checkbock.listview.popupwindow的自定义 import android.app.Activity; import android.content.In ...

  9. SoapUI中如何获取当前active环境

    // Get the current selected Environment def activeEnv = testRunner.testCase.testSuite.project.getAct ...

  10. 《我是一只IT小小鸟》读后感

    过了半个学期的大学生活,说实话,我是迷茫的,因为我还没有足够的了解IT这门课程,也不知道怎么学好这门课程. 直到老师推荐我们读一本书<我是一只it小小鸟>,起初,我并不认为它是一本多么好的 ...