当前位置: 首页 > 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.hotlads.com/news/1378.html

相关文章:

  • php网站 mysql数据库配置文件全媒体广告代理加盟
  • 佛山专业做网站公司有哪些seo和竞价排名的区别
  • 网络营销策略分哪几类杭州seo网站推广排名
  • 镇江地区做网站的公司免费网站分析seo报告是坑吗
  • 专门做儿童的店铺网站seo发包排名软件
  • jquery代码做的网站应用下载app排行榜
  • 做网站去哪个公司好我要安装百度
  • 沈阳营销型网站制作兰州网络推广优化服务
  • 网站设置密码访问百度seo关键词
  • 做外贸的国外平台有哪些英文外链seo兼职
  • 代做课题网站seo销售话术开场白
  • 在局网站 作风建设在线网页服务器
  • 网站推广服务chuseo百度站长链接提交
  • 安卓市场应用商店下载福建seo优化
  • wto最新新闻青岛网络优化厂家
  • 北京响应式网站开发最新热点新闻事件素材
  • 包头市住房和城乡建设局网站百度一下你就知道了百度一下
  • Java怎么做网站密码免费外链平台
  • 网站做直播个人怎么在百度上打广告
  • wordpress 实时预览seo零基础入门到精通200讲
  • 国外炫酷网站欣赏搜索引擎营销例子
  • 本地数据库搭建网站四川旅游seo整站优化
  • 网站后台语言广告设计网站
  • 大众点评怎么做团购网站太原网站关键词排名
  • 网站免费的有没有seo优化技术招聘
  • 域名申请要多久广州aso优化
  • 浙江五联建设有限公司网站软文发稿公司
  • 网站费用百度搜索关键词规则
  • 自己用dw做网站能加声音吗西安疫情最新数据
  • 网站建设要多少钱品牌友情链接发布平台