当前位置: 首页 > news >正文

网站平均停留时间网页设计模板百度云

网站平均停留时间,网页设计模板百度云,网站优化排名优化,有没有找项目的网站本文开始从googletest提供的sample案例分析如何使用单元测试, 代码路径在googletest/googletest/samples/sample1.unittest.cc 本文件主要介绍EXPECT*相关宏使用 EXPECT_EQ 判断是否相等 EXPECT_TRUE 是否为True EXPECT_FALSE 是否为False TEST(FactorialTest, N…

本文开始从googletest提供的sample案例分析如何使用单元测试,

代码路径在googletest/googletest/samples/sample1.unittest.cc
本文件主要介绍EXPECT
*相关宏使用

EXPECT_EQ 判断是否相等
EXPECT_TRUE 是否为True
EXPECT_FALSE 是否为False

TEST(FactorialTest, Negative) {// This test is named "Negative", and belongs to the "FactorialTest"// test case.EXPECT_EQ(1, Factorial(-5));EXPECT_EQ(1, Factorial(-1));EXPECT_GT(Factorial(-10), 0);// <TechnicalDetails>//// EXPECT_EQ(expected, actual) is the same as////   EXPECT_TRUE((expected) == (actual))//// except that it will print both the expected value and the actual// value when the assertion fails.  This is very helpful for// debugging.  Therefore in this case EXPECT_EQ is preferred.//// On the other hand, EXPECT_TRUE accepts any Boolean expression,// and is thus more general.//// </TechnicalDetails>
}

下面介绍sample2_unittest.cc文件

这里测试MyString类,
EXPECT_STREQ(nullptr, s.c_string()); //这里的STREQ是判断字符串内容,s为空类比较要使用nullptr

TEST(MyString, DefaultConstructor) {const MyString s;// Asserts that s.c_string() returns NULL.//// <TechnicalDetails>//// If we write NULL instead of////   static_cast<const char *>(NULL)//// in this assertion, it will generate a warning on gcc 3.4.  The// reason is that EXPECT_EQ needs to know the types of its// arguments in order to print them when it fails.  Since NULL is// #defined as 0, the compiler will use the formatter function for// int to print it.  However, gcc thinks that NULL should be used as// a pointer, not an int, and therefore complains.//// The root of the problem is C++'s lack of distinction between the// integer number 0 and the null pointer constant.  Unfortunately,// we have to live with this fact.//// </TechnicalDetails>EXPECT_STREQ(nullptr, s.c_string());EXPECT_EQ(0u, s.Length());
}
http://www.yayakq.cn/news/988930/

相关文章:

  • 网站规划内容有哪些做头像的网站
  • 江苏建设工程网站凡科网企业账号登录
  • 天津魔方网站建设百度怎么发布广告
  • 做兽设的网站wordpress修改文章页面
  • 湖南营销型网站国际网络交易平台
  • 静态网站建设步骤wordpress 文章多了
  • 网站图片用什么格式三星网上商城发什么快递
  • 意识形态网站建设商务网站开发背景
  • 企业内部网站如何建设杭州市建设工程招标投标网
  • 哪里的网站建设好前端写一个页面多少钱
  • 网页网站原型图占位符怎么做企业申请网站建设请示
  • 建建建设网站首页鸟瞰图效果图制作
  • 江苏网站建设联系方式电商网站设计公司优选亿企邦
  • 空间印象商业空间设计短视频搜索优化
  • 为什么企业要建设网站h5制作方法和步骤
  • 后湖做网站石家庄哪家公司做网络推广好
  • 网站对联广告代码东莞公司的网页怎么做的
  • 网络营销网站建设论文白云免费网站建设
  • 网站服务器租用价格 百度一下搜索网站排行
  • 合肥的网站建设河北沧州最新消息今天
  • 东莞建设网站综合服务平台php网站怎么做静态化
  • 网站怎么做关键词在哪做微信平台登录
  • 中小企业网络营销长春网站优化教程
  • 做k12网站多地进一步优化防控措施
  • 网站设计规划说明书视频号排名优化帝搜软件
  • 十大装修公司排名哪家最好广安seo
  • 网站的设计思想网站404页面查询
  • 做网站的财务需求昆明建设局网站
  • 公司网站开发实训报告百度搜索引擎下载免费
  • 深圳光明新区网站建设查询公司