在VC ++中获得断言的控制 [英] Getting control of Assertion in VC++

查看:78
本文介绍了在VC ++中获得断言的控制的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在准备一个实用程序来测试某些应用程序.我需要部分帮助.
假设我已经启动了一个调试构建应用程序.然后,在两个开发人员之间提出了一个断言.所以我必须做2项任务:
1)获取该断言的内容
2)单击忽略"或一些忽略断言的方法.
在此初始应用程序之后,将继续.
我没有代码.因此,修改现有exe毫无疑问.

I am preparing one utility for testing some of the application. I need some help in some part of it.
Suppose I have launched one debug build application. Then in between one assertion has come which was put by developer. So I have to do 2 tasks:
1) Get the content of that assertion
2) Click ignore or some how ignore the assertion.
After this initial application will resume.
I am not having the code with me. So modifying existing exe is out of question.

推荐答案

成员1544087写道:
Member 1544087 wrote:

测试某些...应用程序...
我没有代码.因此,修改现有exe毫无疑问.

testing some of ... the application ...
I am not having the code with me. So modifying existing exe is out of question.



由此推断,您正在充当测试人员,为开发人员识别错误.

断言通常表示程序中遇到严重错误.尝试继续执行下去可能会由于已识别出的问题而导致程序表现出不良行为,因此其有用性也令人怀疑.然后,您将注意到来自已标记的同一源的其他程序异常行为.相反,我建议在为开发人员记录此文件(触发触发断言的方式,要重复执行什么操作以及将其粘贴到正在创建的文档中的消息的屏幕截图)之后,您应该开始新的测试通过该程序运行其他路径.返回并继续经过开发人员提供了修复程序后的断言所在,您不会猛烈地针对已出现并已表征的错误产生的特殊症状.



I am inferring from this that you are acting as a tester identifying bugs for a developer to fix.

An assertion often indicates a serious error encountered in a program. Attempting to continue past one is likely to exhibit bad behavior from the program caused by the problem already identified, so is of doubtful usefulness. You will then be noting further program misbehavior from the same source you have already flagged. I would suggest instead that after documenting this for the developer (what you did to trigger the assert, what needs to be done to repeat it, and a screen shot of the message pasted into the document you are creating) that you start a new test run exercising other paths through the program. Come back and proceed past where the assertion was after the developer has provided a fix and you won''t be banging you head against peculiar symptoms from the bug you have already turned up and characterized.


您最好的选择IMO是替换ASSERT宏,以便它按您希望的方式工作.
Your best bet IMO is to replace the ASSERT macro so that it works the way you want it to.


这篇关于在VC ++中获得断言的控制的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆