【发布时间】:2015-12-12 12:24:26
【问题描述】:
我的代码如下:
char* Add()
{
p = new char[10];
return p;
}
我使用 CPPUTEST 和下面的测试代码:
TEST(MyTestGroup, TestAdd_1)
{
p = Add(); // the above function
delete p;
}
但错误是:“Allocation/deallocation type mismatch”
我不知道为什么,请帮忙。 提前致谢!
【问题讨论】:
-
这是哪种编程语言? (如何)
p被声明了?
标签: c++ unit-testing cpputest