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

用css做网站菜单岳阳seo快速排名

用css做网站菜单,岳阳seo快速排名,中国电信网站备案,做全景图有哪些网站目录 环境准备GoogleTest 环境准备 git clone https://github.com/google/googletest.git说cmkae版本过低了,解决方法 进到googletest中 cmake CMakeLists.txt make sudo make installls /usr/local/lib存在以下文件说明安装成功 中间出了个问题就是,…

目录

  • 环境准备
  • GoogleTest

环境准备

git clone https://github.com/google/googletest.git

说cmkae版本过低了,解决方法

进到googletest中

cmake CMakeLists.txt
make
sudo make install

在这里插入图片描述


ls /usr/local/lib

存在以下文件说明安装成功

在这里插入图片描述
中间出了个问题就是,总是出现链接不成功,导致库导入不进去
在这里插入图片描述
可以对G++命令加上-L编译的命令,这样就指定了库的搜索路径。

g++ sample1.cc sample1_unittest.cc -o sample1 -L/usr/local/lib -lgtest -lgtest_main -lpthread

在这里插入图片描述

在这里插入图片描述

GoogleTest

单元测试是用来对一个模块、一个函数或者一个类来进行正确性检测的测试工作。
比如我们测试一个岛问题的解决方法

#include <iostream>
#include <initializer_list>
#include <vector>
#include <gtest/gtest.h>using namespace std;class IslandProblem {
public:using Matrix = vector<vector<char>>;IslandProblem(const initializer_list<vector<char>> list) {_islands.assign(list);}int Do() {int num = 0;for (int row = 0; row < (int)_islands.size(); row++) {for (int col = 0; col < (int)_islands[row].size(); col++) {if (canUnion(row, col)) {num++;unionIsland(row, col);}}}return num;}protected:bool canUnion(int row, int col) {if (row < 0 || row >= (int)_islands.size())return false;if (col < 0 || col >= (int)_islands[row].size())return false;if (_islands[row][col] != 1)return false;return true;}void unionIsland(int row, int col) {_islands[row][col] = 2;// upif (canUnion(row-1, col)) unionIsland(row-1, col);// leftif (canUnion(row, col-1)) unionIsland(row, col-1);// downif (canUnion(row+1, col)) unionIsland(row+1, col);// rightif (canUnion(row, col+1)) unionIsland(row, col+1);}private:Matrix _islands;
};TEST(IslandProblem, logic) {IslandProblem ip1{{1,1,1,1},{1,0,1,1},{0,0,0,0},{1,0,1,0}};EXPECT_EQ(ip1.Do(), 3);IslandProblem ip2{{1,0,1,1},{1,0,1,1},{0,0,0,0},{1,0,1,0}};EXPECT_EQ(ip2.Do(), 4);
}TEST(IslandProblem, boundary) {IslandProblem ip1{{1,1,1,1},{1,0,0,1},{1,0,0,1},{1,1,1,1}};EXPECT_EQ(ip1.Do(), 1);IslandProblem ip2{};EXPECT_EQ(ip2.Do(), 0);
}TEST(IslandProblem, exception) {IslandProblem ip1{{-1,1,1,1},{1,0,0,1},{1,0,0,1},{1,1,1,1}};EXPECT_EQ(ip1.Do(), 1);
}

解决方法要考虑:逻辑问题(功能正确),边界问题,异常情况。TEST的测试案例中已经把这些问题考虑进去了。
然后实际去测试,说明解决方法能够考虑以上三种情况在这里插入图片描述

http://www.hkea.cn/news/655730/

相关文章:

  • 集约化网站建设情况广告公司网站制作
  • 网站制作发票字节跳动广告代理商加盟
  • 义乌做网站武汉seo推广优化公司
  • 济宁哪家网站建设公司正规谷歌浏览器 免费下载
  • 有没有女的做任务的网站广东省新闻
  • seo长尾关键词优化如何做网站推广优化
  • 网站搭建服务合同seo排名赚
  • 东莞有什么比较好的网站公司苏州关键词排名系统
  • 做中国供应商免费网站有作用吗浙江网站推广运营
  • mysql8 wordpress百度推广优化是什么意思
  • 做装修广告网站好seo推广公司招商
  • 城市模拟建设游戏网站今天最新的新闻头条新闻
  • 手机网站自适应代码品牌网络营销策划方案
  • 个人网站建设在哪里百度资源搜索平台
  • 云空间免费空间北京网站优化校学费
  • 个人网站做导航网站项目推广平台有哪些
  • 威海住房建设局网站培训学校资质办理条件
  • 做趣味图形的网站免费线上培训平台
  • 女生做网站前端设计师成都网站seo
  • 濮阳建设银行官方网站搜索引擎优化的对比
  • 完全删除wordpressseo小白入门
  • 做网站常用到的css标签什么软件可以找客户资源
  • 有做销售产品的网站有哪些新闻头条今日新闻
  • 深圳自己做网站 服务器优化的近义词
  • 网站开发职业工资网站推广上首页
  • 宝安附近公司做网站建设多少钱深圳百度开户
  • 成都紧急通知seo网络营销招聘
  • 思坎普网站建设如何做营销推广
  • 太原网站优化公司有域名和服务器怎么建网站
  • 网站策划的前景seo 推广