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

SparseGridTest.cpp is missing header algorithm #1318

Closed
expeditioneer opened this issue Sep 6, 2020 · 0 comments
Closed

SparseGridTest.cpp is missing header algorithm #1318

expeditioneer opened this issue Sep 6, 2020 · 0 comments

Comments

@expeditioneer
Copy link

expeditioneer commented Sep 6, 2020

The SparseGridTest.cpp is missing the include of the algorithm header from the STL. When compiling on gentoo with recent gtest (1.10) it produces the following error:

FAILED: CMakeFiles/SparseGridTest.dir/tests/utils/SparseGridTest.cpp.o 
/usr/bin/x86_64-pc-linux-gnu-g++ -DARCUS -DBUILD_TESTS -DBUILD_TESTS=1 -I/usr/include/polyclipping -I.  -march=native -O2 -pipe -frecord-gcc-switches  -O3 -DNDEBUG -Wall  -fopenmp   -std=gnu++11 -MD -MT CMakeFiles/SparseGridTest.dir/tests/utils/SparseGridTest.cpp.o -MF CMakeFiles/SparseGridTest.dir/tests/utils/SparseGridTest.cpp.o.d -o CMakeFiles/SparseGridTest.dir/tests/utils/SparseGridTest.cpp.o -c /var/tmp/portage/media-gfx/curaengine-4.6.1-r1/work/CuraEngine-4.6.1/tests/utils/SparseGridTest.cpp
In file included from /usr/include/gtest/gtest.h:387,
                 from /var/tmp/portage/media-gfx/curaengine-4.6.1-r1/work/CuraEngine-4.6.1/tests/utils/SparseGridTest.cpp:4:
/var/tmp/portage/media-gfx/curaengine-4.6.1-r1/work/CuraEngine-4.6.1/tests/utils/SparseGridTest.cpp: In member function 'virtual void cura::GetNearbyTest_GetNearby_Test::TestBody()':
/var/tmp/portage/media-gfx/curaengine-4.6.1-r1/work/CuraEngine-4.6.1/tests/utils/SparseGridTest.cpp:48:38: error: 'find_if' is not a member of 'std'; did you mean 'find'?
   48 |         EXPECT_NE(result.end(), std::find_if(result.begin(), result.end(), [&point](const typename SparsePointGridInclusive<Point>::Elem &elem) { return elem.val == point; }))
      |                                      ^~~~~~~
/var/tmp/portage/media-gfx/curaengine-4.6.1-r1/work/CuraEngine-4.6.1/tests/utils/SparseGridTest.cpp:54:38: error: 'find_if' is not a member of 'std'; did you mean 'find'?
   54 |         EXPECT_EQ(result.end(), std::find_if(result.begin(), result.end(), [&point](const typename SparsePointGridInclusive<Point>::Elem &elem) { return elem.val == point; }))
      |                                      ^~~~~~~
/var/tmp/portage/media-gfx/curaengine-4.6.1-r1/work/CuraEngine-4.6.1/tests/utils/SparseGridTest.cpp: In member function 'virtual void cura::GetNearbyTest_getNearbyLine2_Test::TestBody()':
/var/tmp/portage/media-gfx/curaengine-4.6.1-r1/work/CuraEngine-4.6.1/tests/utils/SparseGridTest.cpp:99:38: error: 'find_if' is not a member of 'std'; did you mean 'find'?
   99 |         EXPECT_NE(result.end(), std::find_if(result.begin(), result.end(), [&point](const typename SparsePointGridInclusive<Point>::Elem &elem) { return elem.val == point; }))
      |                                      ^~~~~~~
/var/tmp/portage/media-gfx/curaengine-4.6.1-r1/work/CuraEngine-4.6.1/tests/utils/SparseGridTest.cpp:105:38: error: 'find_if' is not a member of 'std'; did you mean 'find'?
  105 |         EXPECT_EQ(result.end(), std::find_if(result.begin(), result.end(), [&point](const typename SparsePointGridInclusive<Point>::Elem &elem) { return elem.val == point; }))
      |                                      ^~~~~~~
/var/tmp/portage/media-gfx/curaengine-4.6.1-r1/work/CuraEngine-4.6.1/tests/utils/SparseGridTest.cpp: In member function 'virtual void cura::GetNearbyTest_getNearbyLine_Test::TestBody()':
/var/tmp/portage/media-gfx/curaengine-4.6.1-r1/work/CuraEngine-4.6.1/tests/utils/SparseGridTest.cpp:144:38: error: 'find_if' is not a member of 'std'; did you mean 'find'?
  144 |         EXPECT_NE(result.end(), std::find_if(result.begin(), result.end(), [&point](const typename SparsePointGridInclusive<Point>::Elem &elem) { return elem.val == point; }))
      |                                      ^~~~~~~
/var/tmp/portage/media-gfx/curaengine-4.6.1-r1/work/CuraEngine-4.6.1/tests/utils/SparseGridTest.cpp:150:38: error: 'find_if' is not a member of 'std'; did you mean 'find'?
  150 |         EXPECT_EQ(result.end(), std::find_if(result.begin(), result.end(), [&point](const typename SparsePointGridInclusive<Point>::Elem &elem) { return elem.val == point; }))
      |                                      ^~~~~~~

ninja: build stopped: subcommand failed.
 * ERROR: media-gfx/curaengine-4.6.1-r1::testworld failed (compile phase):

After adding +#include <algorithm> to SparseGridTest.cpp everything works fine.

See Standard Template Library: Algorithms
and std:find

@rburema rburema closed this as completed in ae354d8 Sep 6, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant