MRPT  2.0.3
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 }
TEST
TEST(cpu, features_as_string)
Definition: cpu_unittest.cpp:13
mrpt::cpu::features_as_string
std::string features_as_string() noexcept
Returns a string with detected features: "MMX:1 SSE2:0 etc.".
Definition: cpu.cpp:95
mrpt::cpu::feature::SSE2
@ SSE2
mrpt::cpu::supports
bool supports(feature f) noexcept
Returns true if the current CPU (and OS) supports the given CPU feature.
Definition: cpu.h:75
cpu.h
EXPECT_GT
EXPECT_GT(out.final_iters, 10UL)



Page generated by Doxygen 1.8.17 for MRPT 2.0.3 at Fri May 15 23:51:15 UTC 2020