]> git.apps.os.sepia.ceph.com Git - ceph.git/commit
tests: add missing header cmath to test/mon/test_mon_memory_target.cc 30284/head
authorSu Yue <Damenly_Su@gmx.com>
Tue, 10 Sep 2019 07:30:57 +0000 (15:30 +0800)
committerSu Yue <Damenly_Su@gmx.com>
Wed, 11 Sep 2019 02:01:04 +0000 (10:01 +0800)
commit9acfb351a3965c28d390822fd8f2ec5675b29064
treed51ca6076fb6f8fb86bb0e42d0a002113723d924
parent0589dbb1cab6e96cd38ae111512bd66dbf6c7111
tests: add missing header cmath to test/mon/test_mon_memory_target.cc

While building ceph, the complier complains:
=================================================================
[ 86%] Building CXX object src/test/mon/CMakeFiles/ceph_test_mon_memory_target.dir/test_mon_memory_target.cc.o
/root/ceph/src/test/mon/test_mon_memory_target.cc: In int main(int, :
/root/ceph/src/test/mon/test_mon_memory_target.cc:66:16:  was not declared in this scope
   66 |   auto stdev = sqrt(sump / results.size());
      |                ^~~~
make[2]: *** [src/test/mon/CMakeFiles/ceph_test_mon_memory_target.dir/build.make:63: src/test/mon/CMakeFiles/ceph_test_mon_memory_target.dir/test_mon_memory_target.cc.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:15575: src/test/mon/CMakeFiles/ceph_test_mon_memory_target.dir/all] Error 2
make: *** [Makefile:141: all] Error 2
=================================================================

This's caused by lack of header cmath which is required by
std::sqrt().
Fix it by add the header then build continues.

Fixes: https://tracker.ceph.com/issues/41739
Signed-off-by: Su Yue <Damenly_Su@gmx.com>
src/test/mon/test_mon_memory_target.cc