MRPT  2.0.1
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.1 Git: 0fef1a6d7 Fri Apr 3 23:00:21 2020 +0200 at vie abr 3 23:20:28 CEST 2020