BOOST_AUTO_TEST_SUITE_END() 行出现异常错误
我对老师的增强测试有疑问。 当我调试我的项目时,我在这一行收到错误:
BOOST_AUTO_TEST_SUITE_END()
异常如下:
homework2.exe中的0x7521b727(KernelBase.dll):0xC0020001:字符串绑定无效。
我正在使用 Visual Studio 2010 Ultimate 和 Win7 Professional(包含所有更新) 这个错误非常烦人,因为抛出异常时我得到一个僵尸控制台窗口。
对不起我的英语;)
编辑:我的测试代码
#define BOOST_TEST_MAIN
#define BOOST_TEST_DYN_LINK
#include <boost/test/unit_test.hpp>
#include <string>
BOOST_AUTO_TEST_SUITE( easy_stringtest)
BOOST_AUTO_TEST_CASE( length_test)
{
std::string s("xyz");
BOOST_CHECK(s.length() ==3);
}
BOOST_AUTO_TEST_CASE( same)
{
std::string s("abc");
BOOST_CHECK(s == "abc");
}
BOOST_AUTO_TEST_SUITE_END()
编辑:我犯了我的错误...IDE选项/clr已打开,将其关闭,您将不会有错误:D
i have a problem with the boost-test from my teacher.
When i'm debugging my project i get an error at this Line:
BOOST_AUTO_TEST_SUITE_END()
The Exception is the following:
0x7521b727 (KernelBase.dll) in homework2.exe: 0xC0020001: The string binding is invalid.
i'm using Visual Studio 2010 ultimate and Win7 Professional (with all updates)
This Bug is very annoying,because i get an Zombie console Window when the exception is thrown.
sorry for my English ;)
Edit: My test Code
#define BOOST_TEST_MAIN
#define BOOST_TEST_DYN_LINK
#include <boost/test/unit_test.hpp>
#include <string>
BOOST_AUTO_TEST_SUITE( easy_stringtest)
BOOST_AUTO_TEST_CASE( length_test)
{
std::string s("xyz");
BOOST_CHECK(s.length() ==3);
}
BOOST_AUTO_TEST_CASE( same)
{
std::string s("abc");
BOOST_CHECK(s == "abc");
}
BOOST_AUTO_TEST_SUITE_END()
Edit: I have fould my fault... The IDE Option /clr was turned on, turn it off and you will have no error :D
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我改变了我的包含;我的老师告诉我问题出在我的二进制文件上。
当其他人遇到同样的问题时这里是解决方案:
新代码:
I have changed my include; my teacher told me that the problem was with my binaries.
When someone else has the same problem here is the solution:
New Code: