Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cmake test error: ‘struct tests::http_request_mock’ has no member named ‘set_expect’ #207

Open
Shadowsith opened this issue Sep 22, 2023 · 1 comment
Assignees
Labels
Milestone

Comments

@Shadowsith
Copy link

Shadowsith commented Sep 22, 2023

What I've done:

git clone --recursive https://github.com/otris/ews-cpp.git
cd ews-cpp
mkdir build
cd build
cmake -DCMAKE_BUILD_TYPE=Debug -DENABLE_SANITIZERS=ON ..

OS: Ubuntu 22.04 LTS
curl: curl 7.81.0 (x86_64-pc-linux-gnu) libcurl/7.81.0 OpenSSL/3.0.2 zlib/1.2.11 brotli/1.0.9 zstd/1.4.8 libidn2/2.3.2 libpsl/0.21.0 (+libidn2/2.3.2) libssh/0.9.6/openssl/zlib nghttp2/1.43.0 librtmp/2.3 OpenLDAP/2.5.12

Output from cmake:

-- The CXX compiler identification is GNU 11.4.0
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: /usr/bin/c++ - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Git tag: 0.11
-- Git SHA-1: 7e555eadf4144e4159084ee8735aa19218ab650a
-- Performing Test GCC_HAS_COLOR
-- Performing Test GCC_HAS_COLOR - Success
-- Found CURL: /usr/lib/x86_64-linux-gnu/libcurl.so (found suitable version "7.81.0", minimum required is "7.29")
-- Performing Test HAS_OPTIONAL
-- Performing Test HAS_OPTIONAL - Success
-- Performing Test HAS_NOEXCEPT_SPECIFIER
-- Performing Test HAS_NOEXCEPT_SPECIFIER - Success
-- Performing Test HAS_MAKE_UNIQUE
-- Performing Test HAS_MAKE_UNIQUE - Success
-- Performing Test HAS_TYPE_ALIAS
-- Performing Test HAS_TYPE_ALIAS - Success
-- Performing Test HAS_DEFAULT_TEMPLATE_ARGS_FOR_FUNCTIONS
-- Performing Test HAS_DEFAULT_TEMPLATE_ARGS_FOR_FUNCTIONS - Success
-- Performing Test HAS_THREAD_LOCAL_STORAGE
-- Performing Test HAS_THREAD_LOCAL_STORAGE - Success
-- Performing Test HAS_DEFAULT_AND_DELETE
-- Performing Test HAS_DEFAULT_AND_DELETE - Success
-- Performing Test HAS_VARIADIC_TEMPLATES
-- Performing Test HAS_VARIADIC_TEMPLATES - Success
-- Performing Test HAS_NON_BUGGY_TYPE_TRAITS
-- Performing Test HAS_NON_BUGGY_TYPE_TRAITS - Success
-- Performing Test HAS_CXX17_STATIC_ASSERT
-- Performing Test HAS_CXX17_STATIC_ASSERT - Success
-- Performing Test HAS_ROBUST_NONMODIFYING_SEQ_OPS
-- Performing Test HAS_ROBUST_NONMODIFYING_SEQ_OPS - Success
-- Performing Test HAS_INITIALIZER_LISTS
-- Performing Test HAS_INITIALIZER_LISTS - Success
-- Performing Test HAS_VARIANT
-- Performing Test HAS_VARIANT - Success
-- Performing Test HAS_FILESYSTEM_HEADER
-- Performing Test HAS_FILESYSTEM_HEADER - Success
-- The C compiler identification is GNU 11.4.0
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: /usr/bin/cc - skipped
-- Detecting C compile features
-- Detecting C compile features - done
CMake Deprecation Warning at 3rdparty/gtest/googletest/CMakeLists.txt:55 (cmake_minimum_required):
  Compatibility with CMake < 2.8.12 will be removed from a future version of
  CMake.

  Update the VERSION argument <min> value or use a ...<max> suffix to tell
  CMake that the project does not need compatibility with older versions.


-- Found PythonInterp: /usr/bin/python3.10 (found version "3.10.12")
-- Looking for pthread.h
-- Looking for pthread.h - found
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD - Success
-- Found Threads: TRUE
-- Found Doxygen: /usr/bin/doxygen (found version "1.9.1") found components: doxygen missing components: dot
-- Configuring done
-- Generating done

Output from make:

[  1%] Building CXX object CMakeFiles/add_delegate.dir/examples/add_delegate.cpp.o
[  2%] Linking CXX executable add_delegate
[  2%] Built target add_delegate
[  3%] Building CXX object CMakeFiles/autodiscover.dir/examples/autodiscover.cpp.o
[  4%] Linking CXX executable autodiscover
[  4%] Built target autodiscover
[  5%] Building CXX object CMakeFiles/create_contact.dir/examples/create_contact.cpp.o
[  6%] Linking CXX executable create_contact
[  6%] Built target create_contact
[  8%] Building CXX object CMakeFiles/create_folder.dir/examples/create_folder.cpp.o
[  9%] Linking CXX executable create_folder
[  9%] Built target create_folder
[ 10%] Building CXX object CMakeFiles/create_task.dir/examples/create_task.cpp.o
[ 11%] Linking CXX executable create_task
[ 11%] Built target create_task
[ 12%] Building CXX object CMakeFiles/create_task_with_delegate_access.dir/examples/create_task_with_delegate_access.cpp.o
[ 13%] Linking CXX executable create_task_with_delegate_access
[ 13%] Built target create_task_with_delegate_access
[ 14%] Building CXX object CMakeFiles/create_task_with_impersonation.dir/examples/create_task_with_impersonation.cpp.o
[ 16%] Linking CXX executable create_task_with_impersonation
[ 16%] Built target create_task_with_impersonation
[ 17%] Building CXX object CMakeFiles/delete_folder.dir/examples/delete_folder.cpp.o
[ 18%] Linking CXX executable delete_folder
[ 18%] Built target delete_folder
[ 19%] Building CXX object CMakeFiles/find_calendar_items.dir/examples/find_calendar_items.cpp.o
[ 20%] Linking CXX executable find_calendar_items
[ 20%] Built target find_calendar_items
[ 21%] Building CXX object CMakeFiles/find_folder.dir/examples/find_folder.cpp.o
[ 22%] Linking CXX executable find_folder
[ 22%] Built target find_folder
[ 24%] Building CXX object CMakeFiles/find_messages.dir/examples/find_messages.cpp.o
[ 25%] Linking CXX executable find_messages
[ 25%] Built target find_messages
[ 26%] Building CXX object CMakeFiles/find_tasks.dir/examples/find_tasks.cpp.o
[ 27%] Linking CXX executable find_tasks
[ 27%] Built target find_tasks
[ 28%] Building CXX object CMakeFiles/find_unread_messages.dir/examples/find_unread_messages.cpp.o
[ 29%] Linking CXX executable find_unread_messages
[ 29%] Built target find_unread_messages
[ 31%] Building CXX object CMakeFiles/get_delegates.dir/examples/get_delegates.cpp.o
[ 32%] Linking CXX executable get_delegates
[ 32%] Built target get_delegates
[ 33%] Building CXX object CMakeFiles/get_folder.dir/examples/get_folder.cpp.o
[ 34%] Linking CXX executable get_folder
[ 34%] Built target get_folder
[ 35%] Building CXX object CMakeFiles/get_meeting_room_calendar.dir/examples/get_meeting_room_calendar.cpp.o
[ 36%] Linking CXX executable get_meeting_room_calendar
[ 36%] Built target get_meeting_room_calendar
[ 37%] Building CXX object CMakeFiles/get_rooms.dir/examples/get_rooms.cpp.o
[ 39%] Linking CXX executable get_rooms
[ 39%] Built target get_rooms
[ 40%] Building CXX object CMakeFiles/move_folder.dir/examples/move_folder.cpp.o
[ 41%] Linking CXX executable move_folder
[ 41%] Built target move_folder
[ 42%] Building CXX object CMakeFiles/move_item.dir/examples/move_item.cpp.o
[ 43%] Linking CXX executable move_item
[ 43%] Built target move_item
[ 44%] Building CXX object CMakeFiles/office365.dir/examples/office365.cpp.o
[ 45%] Linking CXX executable office365
[ 45%] Built target office365
[ 47%] Building CXX object CMakeFiles/office365_oauth2_cc.dir/examples/office365_oauth2_cc.cpp.o
[ 48%] Linking CXX executable office365_oauth2_cc
[ 48%] Built target office365_oauth2_cc
[ 49%] Building CXX object CMakeFiles/office365_oauth2_ropc.dir/examples/office365_oauth2_ropc.cpp.o
[ 50%] Linking CXX executable office365_oauth2_ropc
[ 50%] Built target office365_oauth2_ropc
[ 51%] Building CXX object CMakeFiles/paging_view.dir/examples/paging_view.cpp.o
[ 52%] Linking CXX executable paging_view
[ 52%] Built target paging_view
[ 54%] Building CXX object CMakeFiles/raw_soap_request.dir/examples/raw_soap_request.cpp.o
[ 55%] Linking CXX executable raw_soap_request
[ 55%] Built target raw_soap_request
[ 56%] Building CXX object CMakeFiles/remove_delegate.dir/examples/remove_delegate.cpp.o
[ 57%] Linking CXX executable remove_delegate
[ 57%] Built target remove_delegate
[ 58%] Building CXX object CMakeFiles/resolve_names.dir/examples/resolve_names.cpp.o
[ 59%] Linking CXX executable resolve_names
[ 59%] Built target resolve_names
[ 60%] Building CXX object CMakeFiles/save_attachment.dir/examples/save_attachment.cpp.o
[ 62%] Linking CXX executable save_attachment
[ 62%] Built target save_attachment
[ 63%] Building CXX object CMakeFiles/send_message.dir/examples/send_message.cpp.o
[ 64%] Linking CXX executable send_message
[ 64%] Built target send_message
[ 65%] Building CXX object CMakeFiles/sync_folder_hierarchy.dir/examples/sync_folder_hierarchy.cpp.o
[ 66%] Linking CXX executable sync_folder_hierarchy
[ 66%] Built target sync_folder_hierarchy
[ 67%] Building CXX object CMakeFiles/sync_folder_items.dir/examples/sync_folder_items.cpp.o
[ 68%] Linking CXX executable sync_folder_items
[ 68%] Built target sync_folder_items
[ 70%] Building CXX object CMakeFiles/update_contact.dir/examples/update_contact.cpp.o
[ 71%] Linking CXX executable update_contact
[ 71%] Built target update_contact
[ 72%] Building CXX object CMakeFiles/update_extended_property.dir/examples/update_extended_property.cpp.o
[ 73%] Linking CXX executable update_extended_property
[ 73%] Built target update_extended_property
[ 74%] Building CXX object CMakeFiles/update_folder.dir/examples/update_folder.cpp.o
[ 75%] Linking CXX executable update_folder
[ 75%] Built target update_folder
[ 77%] Building CXX object 3rdparty/gtest/googletest/CMakeFiles/gtest.dir/src/gtest-all.cc.o
In file included from /home/fasdev/cpp/ews-cpp/3rdparty/gtest/googletest/src/gtest-all.cc:43:
/home/fasdev/cpp/ews-cpp/3rdparty/gtest/googletest/src/gtest-death-test.cc: In function ‘bool testing::internal::StackGrowsDown()’:
/home/fasdev/cpp/ews-cpp/3rdparty/gtest/googletest/src/gtest-death-test.cc:1002:24: warning: ‘dummy’ may be used uninitialized [-Wmaybe-uninitialized]
 1002 |   StackLowerThanAddress(&dummy, &result);
      |   ~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~
/home/fasdev/cpp/ews-cpp/3rdparty/gtest/googletest/src/gtest-death-test.cc:992:13: note: by argument 1 of type ‘const void*’ to ‘void testing::internal::StackLowerThanAddress(const void*, bool*)’ declared here
  992 | static void StackLowerThanAddress(const void* ptr, bool* result) {
      |             ^~~~~~~~~~~~~~~~~~~~~
/home/fasdev/cpp/ews-cpp/3rdparty/gtest/googletest/src/gtest-death-test.cc:1000:7: note: ‘dummy’ declared here
 1000 |   int dummy;
      |       ^~~~~
[ 78%] Linking CXX static library libgtestd.a
[ 78%] Built target gtest
[ 79%] Building CXX object CMakeFiles/tests.dir/tests/main.cpp.o
[ 80%] Building CXX object CMakeFiles/tests.dir/tests/regressions/91.cpp.o
In file included from /home/fasdev/cpp/ews-cpp/tests/regressions/91.cpp:18:
/home/fasdev/cpp/ews-cpp/include/ews/ews.hpp: In instantiation of ‘void ews::basic_service<T>::set_expect(const string&) [with RequestHandler = tests::http_request_mock; std::string = std::__cxx11::basic_string<char>]’:
/home/fasdev/cpp/ews-cpp/include/ews/ews.hpp:20983:13:   required from ‘void ews::basic_service<T>::set_credentials(const ews::internal::credentials&) [with RequestHandler = tests::http_request_mock]’
/home/fasdev/cpp/ews-cpp/include/ews/ews.hpp:20795:9:   required from ‘ews::basic_service<T>::basic_service(const string&, const string&, const string&, const string&) [with RequestHandler = tests::http_request_mock; std::string = std::__cxx11::basic_string<char>]’
/usr/include/c++/11/bits/unique_ptr.h:962:30:   required from ‘typename std::_MakeUniq<_Tp>::__single_object std::make_unique(_Args&& ...) [with _Tp = ews::basic_service<tests::http_request_mock>; _Args = {const char (&)[38], const char (&)[11], const char (&)[9], const char (&)[13]}; typename std::_MakeUniq<_Tp>::__single_object = std::unique_ptr<ews::basic_service<tests::http_request_mock> >]’
/home/fasdev/cpp/ews-cpp/tests/fixtures.hpp:214:79:   required from here
/home/fasdev/cpp/ews-cpp/include/ews/ews.hpp:20972:26: error: ‘struct tests::http_request_mock’ has no member named ‘set_expect’
20972 |         request_handler_.set_expect(value);
      |         ~~~~~~~~~~~~~~~~~^~~~~~~~~~
make[2]: *** [CMakeFiles/tests.dir/build.make:90: CMakeFiles/tests.dir/tests/regressions/91.cpp.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:1026: CMakeFiles/tests.dir/all] Error 2
make: *** [Makefile:136: all] Error 2
@idolum idolum self-assigned this Sep 26, 2023
@idolum idolum added the bug label Sep 26, 2023
@idolum idolum added this to the 0.12 milestone Sep 26, 2023
@idolum
Copy link
Member

idolum commented Sep 26, 2023

@Shadowsith Thanks! I will take a look.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants