mirror of
https://github.com/google/cpu_features.git
synced 2025-07-03 06:03:17 +02:00
test enum macro consistency (#257)
This commit is contained in:
@ -22,6 +22,18 @@
|
||||
namespace cpu_features {
|
||||
namespace {
|
||||
|
||||
TEST(CpustringsPPCTest, PPCFeaturesEnum) {
|
||||
const char *last_name = GetPPCFeaturesEnumName(PPC_LAST_);
|
||||
EXPECT_STREQ(last_name, "unknown_feature");
|
||||
for (int i = static_cast<int>(PPC_32); i != static_cast<int>(PPC_LAST_); ++i) {
|
||||
const auto feature = static_cast<PPCFeaturesEnum>(i);
|
||||
const char *name = GetPPCFeaturesEnumName(feature);
|
||||
ASSERT_FALSE(name == nullptr);
|
||||
EXPECT_STRNE(name, "");
|
||||
EXPECT_STRNE(name, last_name);
|
||||
}
|
||||
}
|
||||
|
||||
TEST(CpustringsPPCTest, FromHardwareCap) {
|
||||
ResetHwcaps();
|
||||
SetHardwareCapabilities(PPC_FEATURE_HAS_FPU | PPC_FEATURE_HAS_VSX,
|
||||
|
Reference in New Issue
Block a user