]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commit
tests: add missing header cmath to test/mon/test_mon_memory_target.cc 32815/head
authorSu Yue <Damenly_Su@gmx.com>
Tue, 10 Sep 2019 07:30:57 +0000 (15:30 +0800)
committerKefu Chai <kchai@redhat.com>
Fri, 24 Jan 2020 02:18:02 +0000 (10:18 +0800)
commit7debe63241ddb538120a2597e4e19cea1d0d7423
treee8c0ba465bb5667577d3768419b47b72d9e511b3
parent2a9c6636e5761c5537b6ccec8dd0675144cbbd41
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>
(cherry picked from commit 9acfb351a3965c28d390822fd8f2ec5675b29064)
src/test/mon/test_mon_memory_target.cc