MRPT  2.0.4
cpu_unittest.cpp
Go to the documentation of this file.
1 /* +------------------------------------------------------------------------+
2  | Mobile Robot Programming Toolkit (MRPT) |
3  | https://www.mrpt.org/ |
4  | |
5  | Copyright (c) 2005-2020, Individual contributors, see AUTHORS file |
6  | See: https://www.mrpt.org/Authors - All rights reserved. |
7  | Released under BSD License. See: https://www.mrpt.org/License |
8  +------------------------------------------------------------------------+ */
9 
10 #include <gtest/gtest.h>
11 #include <mrpt/core/cpu.h>
12 
14 {
15  const std::string s = mrpt::cpu::features_as_string();
16  std::cout << "CPU features: " << s << "\n";
17 
18  EXPECT_GT(s.size(), 10UL);
19 }
20 
22 {
23  // Test that, at least, it does not crash.
24  // We cannot test against any known value since the result is CPU-dependant
26  (void)r;
27 }
EXPECT_GT(out.final_iters, 10UL)
bool supports(feature f) noexcept
Returns true if the current CPU (and OS) supports the given CPU feature.
Definition: cpu.h:75
std::string features_as_string() noexcept
Returns a string with detected features: "MMX:1 SSE2:0 etc.".
Definition: cpu.cpp:95
TEST(cpu, features_as_string)



Page generated by Doxygen 1.8.14 for MRPT 2.0.4 Git: 33de1d0ad Sat Jun 20 11:02:42 2020 +0200 at sáb jun 20 17:35:17 CEST 2020