Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/r/80.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Unit testing 如何使用--std=c++;11标志启用_Unit Testing_C++11_Googletest - Fatal编程技术网

Unit testing 如何使用--std=c++;11标志启用

Unit testing 如何使用--std=c++;11标志启用,unit-testing,c++11,googletest,Unit Testing,C++11,Googletest,我使用以下命令/步骤在ubuntu-16.04中安装gtest(谷歌测试)开发包: sudo apt-get install libgtest-dev sudo apt-get install cmake # install cmake cd /usr/src/gtest sudo cmake CMakeLists.txt sudo make # copy or symlink libgtest.a and libgtest_main.a to your /usr/lib

我使用以下命令/步骤在ubuntu-16.04中安装gtest(谷歌测试)开发包:

  sudo apt-get install libgtest-dev
  sudo apt-get install cmake # install cmake
  cd /usr/src/gtest
  sudo cmake CMakeLists.txt
  sudo make
  # copy or symlink libgtest.a and libgtest_main.a to your /usr/lib folder
  sudo cp *.a /usr/lib
在我的项目文件夹中编写了一个CMakeLists.txt,其内容包括:

cmake_minimum_required(VERSION 3.5.1)

# Locate GTest
find_package(GTest REQUIRED)
include_directories(${GTEST_INCLUDE_DIRS})

# Link runTests with what we want to test and the GTest and pthread library
add_executable(runTests test.cpp)
target_link_libraries(runTests ${GTEST_LIBRARIES}  pthread)
更新:复制实验的最短代码: myFunc.cpp文件

int main(){
    std::string input="JUMBO";
    std::cout << myFunc(input)<< std::endl;
    return  0;
}
std::string myFunc(std::string input){
    std::string result="";
    result= input
    return result;
}
为了编译和运行测试:

ubuntu@XPS:/hm/an/folder$ cmake CMakeLists.txt
-- The C compiler identification is GNU 5.5.0
-- The CXX compiler identification is GNU 5.5.0
-- Check for working C compiler: /usr/bin/cc
-- Check for working C compiler: /usr/bin/cc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Check for working CXX compiler: /usr/bin/c++
-- Check for working CXX compiler: /usr/bin/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Found GTest: /usr/lib/libgtest.a  
-- Looking for pthread.h
-- Looking for pthread.h - found
-- Looking for pthread_create
-- Looking for pthread_create - not found
-- Looking for pthread_create in pthreads
-- Looking for pthread_create in pthreads - not found
-- Looking for pthread_create in pthread
-- Looking for pthread_create in pthread - found
-- Found Threads: TRUE  
-- Configuring done
-- Generating done
-- Build files have been written to: /hm/an/folder/
更新:执行
make
命令时出现的完整错误:

函数“std::_cxx11::string countexecutions(std:_cxx11::string)”中的

/hm/an/folder/myfunc.cpp:42:29:错误:“to_string”不是“std”的成员
else结果+=输入[i]+std::to_字符串(计数器);
^
在/hm/an/folder/test.cpp:2:0中包含的文件中:
/usr/include/gtest/gtest.h:testing::AssertionResult testing::internal::CmpHelperEQ(const char*、const char*、const T1&、const T2&)的实例化[with T1=int;T2=std::_cx11::basic_string]:
/usr/include/gtest/gtest.h:1524:23:来自“静态测试::断言结果测试::内部::EqHelper::比较(const char*、const char*、const T1&、const T2&、typename testing::internal::EnableIf::type*)[with T1=int;T2=std:u cx11::basic_字符串;typename testing::internal::EnableIf::type=void]
/hm/an/folder/test.cpp:16:3:此处为必填项
/usr/include/gtest/gtest.h:1448:16:错误:运算符=='不匹配(操作数类型为'const int'和'const std::_cxx11::basic_string')
如果(预期==实际){
^
在/usr/include/gtest/internal/gtest param util.h:45:0中包含的文件中,
从/usr/include/gtest/gtest-param-test.h:192,
from/usr/include/gtest/gtest.h:62,
来自/hm/an/folder/test.cpp:2:
/usr/include/gtest/internal/gtest-linked_ptr.h:213:6:注:候选:模板布尔测试::内部::运算符=(T*,常量测试::内部::链接_ptr&)
布尔运算符==(T*ptr,常数链接的ptr&x){
^
/usr/include/gtest/internal/gtest-linked_ptr.h:213:6:注意:模板参数推导/替换失败:
在/hm/an/folder/test.cpp:2:0中包含的文件中:
/usr/include/gtest/gtest.h:1448:16:注意:不匹配的类型“T*”和“int”
如果(预期==实际){
^
在/usr/include/c++/5/iterator:66:0中包含的文件中,
from/usr/include/gtest/internal/gtest param util.h:37,
从/usr/include/gtest/gtest-param-test.h:192,
from/usr/include/gtest/gtest.h:62,
来自/hm/an/folder/test.cpp:2:
/usr/include/c++/5/bits/stream\u iterator.h:130:5:注:候选:模板bool std::operator==(const std::istream\u iterator&,const std::istream\u iterator&)
运算符==(常量istream\u迭代器&\u x,
^
/usr/include/c++/5/bits/stream_迭代器。h:130:5:注意:模板参数推导/替换失败:
在/hm/an/folder/test.cpp:2:0中包含的文件中:
/usr/include/gtest/gtest.h:1448:16:注意:不匹配的类型“const std::istream_iterator”和“const int”
如果(预期==实际){
^
在/usr/include/c++/5/set:62:0中包含的文件中,
从/usr/include/gtest/internal/gtest internal.h:58,
from/usr/include/gtest/gtest.h:58,
来自/hm/an/folder/test.cpp:2:
/usr/include/c++/5/bits/stl_multiset.h:826:5:注:候选:模板bool std::operator==(常量std::multiset&,常量std::multiset&)
运算符==(常数多集&ux,
^
/usr/include/c++/5/bits/stl_multiset.h:826:5:注意:模板参数推导/替换失败:
在/hm/an/folder/test.cpp:2:0中包含的文件中:
/usr/include/gtest/gtest.h:1448:16:注意:不匹配的类型“const std::multiset”和“const int”
如果(预期==实际){
^
在/usr/include/c++/5/set:61:0中包含的文件中,
从/usr/include/gtest/internal/gtest internal.h:58,
from/usr/include/gtest/gtest.h:58,
来自/hm/an/folder/test.cpp:2:
/usr/include/c++/5/bits/stl_set.h:843:5:注:候选:模板bool std::operator==(常量std::set&,常量std::set&)
运算符==(常量集和,
^
/usr/include/c++/5/bits/stl_set.h:843:5:注意:模板参数推导/替换失败:
在/hm/an/folder/test.cpp:2:0中包含的文件中:
/usr/include/gtest/gtest.h:1448:16:注意:类型“const std::set”和“const int”不匹配
如果(预期==实际){
^
在/usr/include/c++/5/set:60:0中包含的文件中,
从/usr/include/gtest/internal/gtest internal.h:58,
from/usr/include/gtest/gtest.h:58,
来自/hm/an/folder/test.cpp:2:
/usr/include/c++/5/bits/stl_tree.h:1285:5:注:候选:模板bool std::operator==(常量std::_Rb_tree&,常量std:_Rb_tree&)
运算符==(常数Rb_树和x,
^
/usr/include/c++/5/bits/stl_tree.h:1285:5:注意:模板参数推断/替换失败:
在/hm/an/folder/test.cpp:2:0中包含的文件中:
/usr/include/gtest/gtest.h:1448:16:注意:不匹配的类型“const std::_Rb_tree”和“const int”
如果(预期==实际){
^
在/usr/include/c++/5/set:60:0中包含的文件中,
从/usr/include/gtest/internal/gtest internal.h:58,
from/usr/include/gtest/gtest.h:58,
来自/hm/an/folder/test.cpp:2:
/usr/include/c++/5/bits/stl_tree.h:324:5:注:候选:模板bool std::operator==(常量std::_Rb_tree_iterator&,常量std::_Rb_tree_const_iterator&)
运算符==(常量(Rb)树(tree)迭代器&(ux),
^
/usr/include/c++/5/bits/stl_tree.h:324:5:注意:模板参数推导/替换失败:
在/hm/an/folder/test.cpp:2:0中包含的文件中:
/usr/include/gtest/gtest.h:1448:16:注意:不匹配的类型“const std::_Rb_tree_iterator”和“const int”
如果(预期==实际){
^
文件中包括
├── CMakeCache.txt
├── CMakeFiles //generated folder
├── cmake_install.cmake
├── CMakeLists.txt
├── myFunc.cpp
├── main
├── Makefile
├── README.md
└── test.cpp
ubuntu@XPS:/hm/an/folder$ cmake CMakeLists.txt
-- The C compiler identification is GNU 5.5.0
-- The CXX compiler identification is GNU 5.5.0
-- Check for working C compiler: /usr/bin/cc
-- Check for working C compiler: /usr/bin/cc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Check for working CXX compiler: /usr/bin/c++
-- Check for working CXX compiler: /usr/bin/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Found GTest: /usr/lib/libgtest.a  
-- Looking for pthread.h
-- Looking for pthread.h - found
-- Looking for pthread_create
-- Looking for pthread_create - not found
-- Looking for pthread_create in pthreads
-- Looking for pthread_create in pthreads - not found
-- Looking for pthread_create in pthread
-- Looking for pthread_create in pthread - found
-- Found Threads: TRUE  
-- Configuring done
-- Generating done
-- Build files have been written to: /hm/an/folder/
In function ‘std::__cxx11::string countOccurrences(std::__cxx11::string)’:
/hm/an/folder/myfunc.cpp:42:29: error: ‘to_string’ is not a member of ‘std’
    else result+= input[i] + std::to_string(counter);
                             ^
In file included from /hm/an/folder/test.cpp:2:0:
/usr/include/gtest/gtest.h: In instantiation of ‘testing::AssertionResult testing::internal::CmpHelperEQ(const char*, const char*, const T1&, const T2&) [with T1 = int; T2 = std::__cxx11::basic_string<char>]’:
/usr/include/gtest/gtest.h:1524:23:   required from ‘static testing::AssertionResult testing::internal::EqHelper<true>::Compare(const char*, const char*, const T1&, const T2&, typename testing::internal::EnableIf<(! testing::internal::is_pointer<T2>::value)>::type*) [with T1 = int; T2 = std::__cxx11::basic_string<char>; typename testing::internal::EnableIf<(! testing::internal::is_pointer<T2>::value)>::type = void]’
/hm/an/folder/test.cpp:16:3:   required from here
/usr/include/gtest/gtest.h:1448:16: error: no match for ‘operator==’ (operand types are ‘const int’ and ‘const std::__cxx11::basic_string<char>’)
   if (expected == actual) {
                ^
In file included from /usr/include/gtest/internal/gtest-param-util.h:45:0,
                 from /usr/include/gtest/gtest-param-test.h:192,
                 from /usr/include/gtest/gtest.h:62,
                 from /hm/an/folder/test.cpp:2:
/usr/include/gtest/internal/gtest-linked_ptr.h:213:6: note: candidate: template<class T> bool testing::internal::operator==(T*, const testing::internal::linked_ptr<T>&)
 bool operator==(T* ptr, const linked_ptr<T>& x) {
      ^
/usr/include/gtest/internal/gtest-linked_ptr.h:213:6: note:   template argument deduction/substitution failed:
In file included from /hm/an/folder/test.cpp:2:0:
/usr/include/gtest/gtest.h:1448:16: note:   mismatched types ‘T*’ and ‘int’
   if (expected == actual) {
                ^
In file included from /usr/include/c++/5/iterator:66:0,
                 from /usr/include/gtest/internal/gtest-param-util.h:37,
                 from /usr/include/gtest/gtest-param-test.h:192,
                 from /usr/include/gtest/gtest.h:62,
                 from /hm/an/folder/test.cpp:2:
/usr/include/c++/5/bits/stream_iterator.h:130:5: note: candidate: template<class _Tp, class _CharT, class _Traits, class _Dist> bool std::operator==(const std::istream_iterator<_Tp, _CharT, _Traits, _Dist>&, const std::istream_iterator<_Tp, _CharT, _Traits, _Dist>&)
     operator==(const istream_iterator<_Tp, _CharT, _Traits, _Dist>& __x,
     ^
/usr/include/c++/5/bits/stream_iterator.h:130:5: note:   template argument deduction/substitution failed:
In file included from /hm/an/folder/test.cpp:2:0:
/usr/include/gtest/gtest.h:1448:16: note:   mismatched types ‘const std::istream_iterator<_Tp, _CharT, _Traits, _Dist>’ and ‘const int’
   if (expected == actual) {
                ^
In file included from /usr/include/c++/5/set:62:0,
                 from /usr/include/gtest/internal/gtest-internal.h:58,
                 from /usr/include/gtest/gtest.h:58,
                 from /hm/an/folder/test.cpp:2:
/usr/include/c++/5/bits/stl_multiset.h:826:5: note: candidate: template<class _Key, class _Compare, class _Alloc> bool std::operator==(const std::multiset<_Key, _Compare, _Alloc>&, const std::multiset<_Key, _Compare, _Alloc>&)
     operator==(const multiset<_Key, _Compare, _Alloc>& __x,
     ^
/usr/include/c++/5/bits/stl_multiset.h:826:5: note:   template argument deduction/substitution failed:
In file included from /hm/an/folder/test.cpp:2:0:
/usr/include/gtest/gtest.h:1448:16: note:   mismatched types ‘const std::multiset<_Key, _Compare, _Alloc>’ and ‘const int’
   if (expected == actual) {
                ^
In file included from /usr/include/c++/5/set:61:0,
                 from /usr/include/gtest/internal/gtest-internal.h:58,
                 from /usr/include/gtest/gtest.h:58,
                 from /hm/an/folder/test.cpp:2:
/usr/include/c++/5/bits/stl_set.h:843:5: note: candidate: template<class _Key, class _Compare, class _Alloc> bool std::operator==(const std::set<_Key, _Compare, _Alloc>&, const std::set<_Key, _Compare, _Alloc>&)
     operator==(const set<_Key, _Compare, _Alloc>& __x,
     ^
/usr/include/c++/5/bits/stl_set.h:843:5: note:   template argument deduction/substitution failed:
In file included from /hm/an/folder/test.cpp:2:0:
/usr/include/gtest/gtest.h:1448:16: note:   mismatched types ‘const std::set<_Key, _Compare, _Alloc>’ and ‘const int’
   if (expected == actual) {
                ^
In file included from /usr/include/c++/5/set:60:0,
                 from /usr/include/gtest/internal/gtest-internal.h:58,
                 from /usr/include/gtest/gtest.h:58,
                 from /hm/an/folder/test.cpp:2:
/usr/include/c++/5/bits/stl_tree.h:1285:5: note: candidate: template<class _Key, class _Val, class _KeyOfValue, class _Compare, class _Alloc> bool std::operator==(const std::_Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>&, const std::_Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>&)
     operator==(const _Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>& __x,
     ^
/usr/include/c++/5/bits/stl_tree.h:1285:5: note:   template argument deduction/substitution failed:
In file included from /hm/an/folder/test.cpp:2:0:
/usr/include/gtest/gtest.h:1448:16: note:   mismatched types ‘const std::_Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>’ and ‘const int’
   if (expected == actual) {
                ^
In file included from /usr/include/c++/5/set:60:0,
                 from /usr/include/gtest/internal/gtest-internal.h:58,
                 from /usr/include/gtest/gtest.h:58,
                 from /hm/an/folder/test.cpp:2:
/usr/include/c++/5/bits/stl_tree.h:324:5: note: candidate: template<class _Val> bool std::operator==(const std::_Rb_tree_iterator<_Tp>&, const std::_Rb_tree_const_iterator<_Val>&)
     operator==(const _Rb_tree_iterator<_Val>& __x,
     ^
/usr/include/c++/5/bits/stl_tree.h:324:5: note:   template argument deduction/substitution failed:
In file included from /hm/an/folder/test.cpp:2:0:
/usr/include/gtest/gtest.h:1448:16: note:   mismatched types ‘const std::_Rb_tree_iterator<_Tp>’ and ‘const int’
   if (expected == actual) {
                ^
In file included from /usr/include/c++/5/vector:64:0,
                 from /usr/include/gtest/gtest.h:56,
                 from /hm/an/folder/test.cpp:2:
/usr/include/c++/5/bits/stl_vector.h:1511:5: note: candidate: template<class _Tp, class _Alloc> bool std::operator==(const std::vector<_Tp, _Alloc>&, const std::vector<_Tp, _Alloc>&)
     operator==(const vector<_Tp, _Alloc>& __x, const vector<_Tp, _Alloc>& __y)
     ^
/usr/include/c++/5/bits/stl_vector.h:1511:5: note:   template argument deduction/substitution failed:
In file included from /hm/an/folder/test.cpp:2:0:
/usr/include/gtest/gtest.h:1448:16: note:   mismatched types ‘const std::vector<_Tp, _Alloc>’ and ‘const int’
   if (expected == actual) {
                ^
In file included from /usr/include/c++/5/bits/locale_facets.h:48:0,
                 from /usr/include/c++/5/bits/basic_ios.h:37,
                 from /usr/include/c++/5/ios:44,
                 from /usr/include/c++/5/ostream:38,
                 from /usr/include/c++/5/iostream:39,
                 from /hm/an/folder/myfunc.cpp:1,
                 from /hm/an/folder/test.cpp:1:
/usr/include/c++/5/bits/streambuf_iterator.h:204:5: note: candidate: template<class _CharT, class _Traits> bool std::operator==(const std::istreambuf_iterator<_CharT, _Traits>&, const std::istreambuf_iterator<_CharT, _Traits>&)
     operator==(const istreambuf_iterator<_CharT, _Traits>& __a,
     ^
/usr/include/c++/5/bits/streambuf_iterator.h:204:5: note:   template argument deduction/substitution failed:
In file included from /hm/an/folder/test.cpp:2:0:
/usr/include/gtest/gtest.h:1448:16: note:   mismatched types ‘const std::istreambuf_iterator<_CharT, _Traits>’ and ‘const int’
   if (expected == actual) {
                ^
In file included from /usr/include/c++/5/string:52:0,
                 from /usr/include/c++/5/bits/locale_classes.h:40,
                 from /usr/include/c++/5/bits/ios_base.h:41,
                 from /usr/include/c++/5/ios:42,
                 from /usr/include/c++/5/ostream:38,
                 from /usr/include/c++/5/iostream:39,
                 from /hm/an/folder/myfunc.cpp:1,
                 from /hm/an/folder/test.cpp:1:
/usr/include/c++/5/bits/basic_string.h:5032:5: note: candidate: template<class _CharT, class _Traits, class _Alloc> bool std::operator==(const std::__cxx11::basic_string<_CharT, _Traits, _Alloc>&, const _CharT*)
     operator==(const basic_string<_CharT, _Traits, _Alloc>& __lhs,
     ^
/usr/include/c++/5/bits/basic_string.h:5032:5: note:   template argument deduction/substitution failed:
In file included from /hm/an/folder/test.cpp:2:0:
/usr/include/gtest/gtest.h:1448:16: note:   mismatched types ‘const std::__cxx11::basic_string<_CharT, _Traits, _Alloc>’ and ‘const int’
   if (expected == actual) {
                ^
In file included from /usr/include/c++/5/string:52:0,
                 from /usr/include/c++/5/bits/locale_classes.h:40,
                 from /usr/include/c++/5/bits/ios_base.h:41,
                 from /usr/include/c++/5/ios:42,
                 from /usr/include/c++/5/ostream:38,
                 from /usr/include/c++/5/iostream:39,
                 from /hm/an/folder/myfunc.cpp:1,
                 from /hm/an/folder/test.cpp:1:
/usr/include/c++/5/bits/basic_string.h:5020:5: note: candidate: template<class _CharT, class _Traits, class _Alloc> bool std::operator==(const _CharT*, const std::__cxx11::basic_string<_CharT, _Traits, _Alloc>&)
     operator==(const _CharT* __lhs,
     ^
/usr/include/c++/5/bits/basic_string.h:5020:5: note:   template argument deduction/substitution failed:
In file included from /hm/an/folder/test.cpp:2:0:
/usr/include/gtest/gtest.h:1448:16: note:   mismatched types ‘const _CharT*’ and ‘int’
   if (expected == actual) {
                ^
In file included from /usr/include/c++/5/string:52:0,
                 from /usr/include/c++/5/bits/locale_classes.h:40,
                 from /usr/include/c++/5/bits/ios_base.h:41,
                 from /usr/include/c++/5/ios:42,
                 from /usr/include/c++/5/ostream:38,
                 from /usr/include/c++/5/iostream:39,
                 from /hm/an/folder/myfunc.cpp:1,
                 from /hm/an/folder/test.cpp:1:
/usr/include/c++/5/bits/basic_string.h:5006:5: note: candidate: template<class _CharT> typename __gnu_cxx::__enable_if<std::__is_char<_Tp>::__value, bool>::__type std::operator==(const std::__cxx11::basic_string<_CharT>&, const std::__cxx11::basic_string<_CharT>&)
     operator==(const basic_string<_CharT>& __lhs,
     ^
/usr/include/c++/5/bits/basic_string.h:5006:5: note:   template argument deduction/substitution failed:
In file included from /hm/an/folder/test.cpp:2:0:
/usr/include/gtest/gtest.h:1448:16: note:   mismatched types ‘const std::__cxx11::basic_string<_CharT>’ and ‘const int’
   if (expected == actual) {
                ^
In file included from /usr/include/c++/5/string:52:0,
                 from /usr/include/c++/5/bits/locale_classes.h:40,
                 from /usr/include/c++/5/bits/ios_base.h:41,
                 from /usr/include/c++/5/ios:42,
                 from /usr/include/c++/5/ostream:38,
                 from /usr/include/c++/5/iostream:39,
                 from /hm/an/folder/myfunc.cpp:1,
                 from /hm/an/folder/test.cpp:1:
/usr/include/c++/5/bits/basic_string.h:4998:5: note: candidate: template<class _CharT, class _Traits, class _Alloc> bool std::operator==(const std::__cxx11::basic_string<_CharT, _Traits, _Alloc>&, const std::__cxx11::basic_string<_CharT, _Traits, _Alloc>&)
     operator==(const basic_string<_CharT, _Traits, _Alloc>& __lhs,
     ^
/usr/include/c++/5/bits/basic_string.h:4998:5: note:   template argument deduction/substitution failed:
In file included from /hm/an/folder/test.cpp:2:0:
/usr/include/gtest/gtest.h:1448:16: note:   mismatched types ‘const std::__cxx11::basic_string<_CharT, _Traits, _Alloc>’ and ‘const int’
   if (expected == actual) {
                ^
In file included from /usr/include/c++/5/string:41:0,
                 from /usr/include/c++/5/bits/locale_classes.h:40,
                 from /usr/include/c++/5/bits/ios_base.h:41,
                 from /usr/include/c++/5/ios:42,
                 from /usr/include/c++/5/ostream:38,
                 from /usr/include/c++/5/iostream:39,
                 from /hm/an/folder/myfunc.cpp:1,
                 from /hm/an/folder/test.cpp:1:
/usr/include/c++/5/bits/allocator.h:143:5: note: candidate: template<class _Tp> bool std::operator==(const std::allocator<_CharT>&, const std::allocator<_CharT>&)
     operator==(const allocator<_Tp>&, const allocator<_Tp>&)
     ^
/usr/include/c++/5/bits/allocator.h:143:5: note:   template argument deduction/substitution failed:
In file included from /hm/an/folder/test.cpp:2:0:
/usr/include/gtest/gtest.h:1448:16: note:   mismatched types ‘const std::allocator<_CharT>’ and ‘const int’
   if (expected == actual) {
                ^
In file included from /usr/include/c++/5/string:41:0,
                 from /usr/include/c++/5/bits/locale_classes.h:40,
                 from /usr/include/c++/5/bits/ios_base.h:41,
                 from /usr/include/c++/5/ios:42,
                 from /usr/include/c++/5/ostream:38,
                 from /usr/include/c++/5/iostream:39,
                 from /hm/an/folder/myfunc.cpp:1,
                 from /hm/an/folder/test.cpp:1:
/usr/include/c++/5/bits/allocator.h:137:5: note: candidate: template<class _T1, class _T2> bool std::operator==(const std::allocator<_CharT>&, const std::allocator<_T2>&)
     operator==(const allocator<_T1>&, const allocator<_T2>&)
     ^
/usr/include/c++/5/bits/allocator.h:137:5: note:   template argument deduction/substitution failed:
In file included from /hm/an/folder/test.cpp:2:0:
/usr/include/gtest/gtest.h:1448:16: note:   mismatched types ‘const std::allocator<_CharT>’ and ‘const int’
   if (expected == actual) {
                ^
In file included from /usr/include/c++/5/bits/stl_algobase.h:67:0,
                 from /usr/include/c++/5/bits/char_traits.h:39,
                 from /usr/include/c++/5/ios:40,
                 from /usr/include/c++/5/ostream:38,
                 from /usr/include/c++/5/iostream:39,
                 from /hm/an/folder/myfunc.cpp:1,
                 from /hm/an/folder/test.cpp:1:
/usr/include/c++/5/bits/stl_iterator.h:349:5: note: candidate: template<class _IteratorL, class _IteratorR> bool std::operator==(const std::reverse_iterator<_Iterator>&, const std::reverse_iterator<_IteratorR>&)
     operator==(const reverse_iterator<_IteratorL>& __x,
     ^
/usr/include/c++/5/bits/stl_iterator.h:349:5: note:   template argument deduction/substitution failed:
In file included from /hm/an/folder/test.cpp:2:0:
/usr/include/gtest/gtest.h:1448:16: note:   mismatched types ‘const std::reverse_iterator<_Iterator>’ and ‘const int’
   if (expected == actual) {
                ^
In file included from /usr/include/c++/5/bits/stl_algobase.h:67:0,
                 from /usr/include/c++/5/bits/char_traits.h:39,
                 from /usr/include/c++/5/ios:40,
                 from /usr/include/c++/5/ostream:38,
                 from /usr/include/c++/5/iostream:39,
                 from /hm/an/folder/myfunc.cpp:1,
                 from /hm/an/folder/test.cpp:1:
/usr/include/c++/5/bits/stl_iterator.h:292:5: note: candidate: template<class _Iterator> bool std::operator==(const std::reverse_iterator<_Iterator>&, const std::reverse_iterator<_Iterator>&)
     operator==(const reverse_iterator<_Iterator>& __x,
     ^
/usr/include/c++/5/bits/stl_iterator.h:292:5: note:   template argument deduction/substitution failed:
In file included from /hm/an/folder/test.cpp:2:0:
/usr/include/gtest/gtest.h:1448:16: note:   mismatched types ‘const std::reverse_iterator<_Iterator>’ and ‘const int’
   if (expected == actual) {
                ^
In file included from /usr/include/c++/5/bits/stl_algobase.h:64:0,
                 from /usr/include/c++/5/bits/char_traits.h:39,
                 from /usr/include/c++/5/ios:40,
                 from /usr/include/c++/5/ostream:38,
                 from /usr/include/c++/5/iostream:39,
                 from /hm/an/folder/myfunc.cpp:1,
                 from /hm/an/folder/test.cpp:1:
/usr/include/c++/5/bits/stl_pair.h:214:5: note: candidate: template<class _T1, class _T2> bool std::operator==(const std::pair<_T1, _T2>&, const std::pair<_T1, _T2>&)
     operator==(const pair<_T1, _T2>& __x, const pair<_T1, _T2>& __y)
     ^
/usr/include/c++/5/bits/stl_pair.h:214:5: note:   template argument deduction/substitution failed:
In file included from /hm/an/folder/test.cpp:2:0:
/usr/include/gtest/gtest.h:1448:16: note:   mismatched types ‘const std::pair<_T1, _T2>’ and ‘const int’
   if (expected == actual) {
                ^
In file included from /usr/include/c++/5/iosfwd:40:0,
                 from /usr/include/c++/5/ios:38,
                 from /usr/include/c++/5/ostream:38,
                 from /usr/include/c++/5/iostream:39,
                 from /hm/an/folder/myfunc.cpp:1,
                 from /hm/an/folder/test.cpp:1:
/usr/include/c++/5/bits/postypes.h:216:5: note: candidate: template<class _StateT> bool std::operator==(const std::fpos<_StateT>&, const std::fpos<_StateT>&)
     operator==(const fpos<_StateT>& __lhs, const fpos<_StateT>& __rhs)
     ^
/usr/include/c++/5/bits/postypes.h:216:5: note:   template argument deduction/substitution failed:
In file included from /hm/an/folder/test.cpp:2:0:
/usr/include/gtest/gtest.h:1448:16: note:   mismatched types ‘const std::fpos<_StateT>’ and ‘const int’
   if (expected == actual) {
                ^
In file included from /usr/include/x86_64-linux-gnu/c++/5/bits/c++allocator.h:33:0,
                 from /usr/include/c++/5/bits/allocator.h:46,
                 from /usr/include/c++/5/string:41,
                 from /usr/include/c++/5/bits/locale_classes.h:40,
                 from /usr/include/c++/5/bits/ios_base.h:41,
                 from /usr/include/c++/5/ios:42,
                 from /usr/include/c++/5/ostream:38,
                 from /usr/include/c++/5/iostream:39,
                 from /hm/an/folder/myfunc.cpp:1,
                 from /hm/an/folder/test.cpp:1:
/usr/include/c++/5/ext/new_allocator.h:139:5: note: candidate: template<class _Tp> bool __gnu_cxx::operator==(const __gnu_cxx::new_allocator<_Tp>&, const __gnu_cxx::new_allocator<_Tp>&)
     operator==(const new_allocator<_Tp>&, const new_allocator<_Tp>&)
     ^
/usr/include/c++/5/ext/new_allocator.h:139:5: note:   template argument deduction/substitution failed:
In file included from /hm/an/folder/test.cpp:2:0:
/usr/include/gtest/gtest.h:1448:16: note:   mismatched types ‘const __gnu_cxx::new_allocator<_Tp>’ and ‘const int’
   if (expected == actual) {
                ^
In file included from /usr/include/c++/5/bits/stl_algobase.h:67:0,
                 from /usr/include/c++/5/bits/char_traits.h:39,
                 from /usr/include/c++/5/ios:40,
                 from /usr/include/c++/5/ostream:38,
                 from /usr/include/c++/5/iostream:39,
                 from /hm/an/folder/myfunc.cpp:1,
                 from /hm/an/folder/test.cpp:1:
/usr/include/c++/5/bits/stl_iterator.h:834:5: note: candidate: template<class _Iterator, class _Container> bool __gnu_cxx::operator==(const __gnu_cxx::__normal_iterator<_Iterator, _Container>&, const __gnu_cxx::__normal_iterator<_Iterator, _Container>&)
     operator==(const __normal_iterator<_Iterator, _Container>& __lhs,
     ^
/usr/include/c++/5/bits/stl_iterator.h:834:5: note:   template argument deduction/substitution failed:
In file included from /hm/an/folder/test.cpp:2:0:
/usr/include/gtest/gtest.h:1448:16: note:   mismatched types ‘const __gnu_cxx::__normal_iterator<_Iterator, _Container>’ and ‘const int’
   if (expected == actual) {
                ^
In file included from /usr/include/c++/5/bits/stl_algobase.h:67:0,
                 from /usr/include/c++/5/bits/char_traits.h:39,
                 from /usr/include/c++/5/ios:40,
                 from /usr/include/c++/5/ostream:38,
                 from /usr/include/c++/5/iostream:39,
                 from /hm/an/folder/myfunc.cpp:1,
                 from /hm/an/folder/test.cpp:1:
/usr/include/c++/5/bits/stl_iterator.h:827:5: note: candidate: template<class _IteratorL, class _IteratorR, class _Container> bool __gnu_cxx::operator==(const __gnu_cxx::__normal_iterator<_IteratorL, _Container>&, const __gnu_cxx::__normal_iterator<_IteratorR, _Container>&)
     operator==(const __normal_iterator<_IteratorL, _Container>& __lhs,
     ^
/usr/include/c++/5/bits/stl_iterator.h:827:5: note:   template argument deduction/substitution failed:
In file included from /hm/an/folder/test.cpp:2:0:
/usr/include/gtest/gtest.h:1448:16: note:   mismatched types ‘const __gnu_cxx::__normal_iterator<_IteratorL, _Container>’ and ‘const int’
   if (expected == actual) {
                ^
CMakeFiles/runTests.dir/build.make:62: recipe for target 'CMakeFiles/runTests.dir/test.cpp.o' failed
make[2]: *** [CMakeFiles/runTests.dir/test.cpp.o] Error 1
CMakeFiles/Makefile2:67: recipe for target 'CMakeFiles/runTests.dir/all' failed
make[1]: *** [CMakeFiles/runTests.dir/all] Error 2
Makefile:83: recipe for target 'all' failed
make: *** [all] Error 2
set(CMAKE_CXX_STANDARD 17)