1
0
mirror of https://github.com/google/cpu_features.git synced 2025-07-01 21:31:15 +02:00

[NFC] clang-format codebase (#134)

* [NFC] clang-format codebase

* revert to 80 char columns at the price of uglier table init

* Specifically disabling clang-format for table initialization
This commit is contained in:
Guillaume Chatelet
2020-09-23 11:52:20 +02:00
committed by GitHub
parent 38f2a0274f
commit 22a5362e11
27 changed files with 270 additions and 262 deletions

View File

@ -13,10 +13,10 @@
// limitations under the License.
#include "cpuinfo_aarch64.h"
#include "filesystem_for_testing.h"
#include "hwcaps_for_testing.h"
#include "filesystem_for_testing.h"
#include "gtest/gtest.h"
#include "hwcaps_for_testing.h"
namespace cpu_features {
namespace {
@ -62,7 +62,8 @@ TEST(CpuinfoAarch64Test, FromHardwareCap) {
}
TEST(CpuinfoAarch64Test, FromHardwareCap2) {
SetHardwareCapabilities(AARCH64_HWCAP_FP, AARCH64_HWCAP2_SVE2 | AARCH64_HWCAP2_BTI);
SetHardwareCapabilities(AARCH64_HWCAP_FP,
AARCH64_HWCAP2_SVE2 | AARCH64_HWCAP2_BTI);
GetEmptyFilesystem(); // disabling /proc/cpuinfo
const auto info = GetAarch64Info();
EXPECT_TRUE(info.features.fp);

View File

@ -13,10 +13,10 @@
// limitations under the License.
#include "cpuinfo_arm.h"
#include "filesystem_for_testing.h"
#include "hwcaps_for_testing.h"
#include "filesystem_for_testing.h"
#include "gtest/gtest.h"
#include "hwcaps_for_testing.h"
namespace cpu_features {
namespace {

View File

@ -13,13 +13,13 @@
// limitations under the License.
#include "cpuinfo_mips.h"
#include "filesystem_for_testing.h"
#include "gtest/gtest.h"
#include "hwcaps_for_testing.h"
#include "internal/stack_line_reader.h"
#include "internal/string_view.h"
#include "gtest/gtest.h"
namespace cpu_features {
namespace {

View File

@ -13,12 +13,12 @@
// limitations under the License.
#include "cpuinfo_ppc.h"
#include "filesystem_for_testing.h"
#include "gtest/gtest.h"
#include "hwcaps_for_testing.h"
#include "internal/string_view.h"
#include "gtest/gtest.h"
namespace cpu_features {
namespace {

View File

@ -12,13 +12,13 @@
// See the License for the specific language governing permissions and
// limitations under the License.
#include "cpuinfo_x86.h"
#include <cassert>
#include <cstdio>
#include <map>
#include "gtest/gtest.h"
#include "cpuinfo_x86.h"
#include "internal/cpuid_x86.h"
namespace cpu_features {

View File

@ -12,9 +12,10 @@
// See the License for the specific language governing permissions and
// limitations under the License.
#include "hwcaps_for_testing.h"
#include <string.h>
#include "hwcaps_for_testing.h"
#include "internal/string_view.h"
namespace cpu_features {

View File

@ -13,8 +13,8 @@
// limitations under the License.
#include "internal/stack_line_reader.h"
#include "filesystem_for_testing.h"
#include "filesystem_for_testing.h"
#include "gtest/gtest.h"
namespace cpu_features {

View File

@ -117,13 +117,13 @@ TEST(StringViewTest, CpuFeatures_StringView_Back) {
TEST(StringViewTest, CpuFeatures_StringView_TrimWhitespace) {
EXPECT_EQ(CpuFeatures_StringView_TrimWhitespace(str(" first middle last ")),
str("first middle last"));
str("first middle last"));
EXPECT_EQ(CpuFeatures_StringView_TrimWhitespace(str("first middle last ")),
str("first middle last"));
str("first middle last"));
EXPECT_EQ(CpuFeatures_StringView_TrimWhitespace(str(" first middle last")),
str("first middle last"));
str("first middle last"));
EXPECT_EQ(CpuFeatures_StringView_TrimWhitespace(str("first middle last")),
str("first middle last"));
str("first middle last"));
}
TEST(StringViewTest, CpuFeatures_StringView_ParsePositiveNumber) {

View File

@ -12,10 +12,10 @@
// See the License for the specific language governing permissions and
// limitations under the License.
#include <array>
#include "internal/unix_features_aggregator.h"
#include <array>
#include "gtest/gtest.h"
namespace cpu_features {
@ -28,11 +28,7 @@ struct Features {
bool c = false;
};
enum eFeatures {
TEST_a,
TEST_b,
TEST_c
};
enum eFeatures { TEST_a, TEST_b, TEST_c };
DECLARE_SETTER_AND_GETTER(Features, a)
DECLARE_SETTER_AND_GETTER(Features, b)
@ -40,11 +36,10 @@ DECLARE_SETTER_AND_GETTER(Features, c)
class LinuxFeatureAggregatorTest : public testing::Test {
public:
const std::array<CapabilityConfig, 3> kConfigs = {{
{{0b0001, 0b0000}, "a", &set_a, &get_a},
{{0b0010, 0b0000}, "b", &set_b, &get_b},
{{0b0000, 0b1100}, "c", &set_c, &get_c}
}};
const std::array<CapabilityConfig, 3> kConfigs = {
{{{0b0001, 0b0000}, "a", &set_a, &get_a},
{{0b0010, 0b0000}, "b", &set_b, &get_b},
{{0b0000, 0b1100}, "c", &set_c, &get_c}}};
};
TEST_F(LinuxFeatureAggregatorTest, FromFlagsEmpty) {