Ran clang-format on the metrics directory.

[ Merge of http://go/wvgerrit/137809 ]

Bug: 204946540
Test: Metric unit tests
Change-Id: Ibd68db73ea9ee64664d33c2cb8e8bb7c56674c27
This commit is contained in:
Alex Dale
2021-11-03 17:24:34 -07:00
parent 2046fc05fa
commit 21a021e800
16 changed files with 431 additions and 441 deletions

View File

@@ -71,7 +71,8 @@ TEST_F(EventMetricTest, OneFieldSuccess) {
TEST_F(EventMetricTest, TwoFieldsSuccess) {
EventMetric<drm_metrics::Attributes::kErrorCodeFieldNumber, int,
drm_metrics::Attributes::kLengthFieldNumber, Pow2Bucket> metric;
drm_metrics::Attributes::kLengthFieldNumber, Pow2Bucket>
metric;
metric.Record(1, 7, Pow2Bucket(23));
metric.Record(2, 7, Pow2Bucket(33));
@@ -114,7 +115,8 @@ TEST_F(EventMetricTest, TwoFieldsSuccess) {
TEST_F(EventMetricTest, ThreeFieldsSuccess) {
EventMetric<drm_metrics::Attributes::kErrorCodeFieldNumber, int,
drm_metrics::Attributes::kLengthFieldNumber, Pow2Bucket,
drm_metrics::Attributes::kErrorCodeBoolFieldNumber, bool> metric;
drm_metrics::Attributes::kErrorCodeBoolFieldNumber, bool>
metric;
metric.Record(10LL, 7, Pow2Bucket(13), false);
metric.Record(11LL, 8, Pow2Bucket(17), true);
@@ -127,14 +129,16 @@ TEST_F(EventMetricTest, ThreeFieldsSuccess) {
EXPECT_FALSE(metric_proto.test_distributions(0).has_variance());
EXPECT_EQ(7, metric_proto.test_distributions(0).attributes().error_code());
EXPECT_EQ(8u, metric_proto.test_distributions(0).attributes().length());
EXPECT_FALSE(metric_proto.test_distributions(0).attributes().error_code_bool());
EXPECT_FALSE(
metric_proto.test_distributions(0).attributes().error_code_bool());
EXPECT_EQ(1u, metric_proto.test_distributions(1).operation_count());
EXPECT_EQ(11LL, metric_proto.test_distributions(1).mean());
EXPECT_FALSE(metric_proto.test_distributions(1).has_variance());
EXPECT_EQ(8, metric_proto.test_distributions(1).attributes().error_code());
EXPECT_EQ(16u, metric_proto.test_distributions(1).attributes().length());
EXPECT_TRUE(metric_proto.test_distributions(1).attributes().error_code_bool());
EXPECT_TRUE(
metric_proto.test_distributions(1).attributes().error_code_bool());
}
TEST_F(EventMetricTest, FourFieldsSuccess) {
@@ -142,7 +146,8 @@ TEST_F(EventMetricTest, FourFieldsSuccess) {
drm_metrics::Attributes::kLengthFieldNumber, Pow2Bucket,
drm_metrics::Attributes::kErrorCodeBoolFieldNumber, bool,
drm_metrics::Attributes::kCdmSecurityLevelFieldNumber,
CdmSecurityLevel> metric;
CdmSecurityLevel>
metric;
metric.Record(10LL, 7, Pow2Bucket(13), true, kSecurityLevelL3);
@@ -155,7 +160,8 @@ TEST_F(EventMetricTest, FourFieldsSuccess) {
EXPECT_FALSE(metric_proto.test_distributions(0).has_variance());
EXPECT_EQ(7, metric_proto.test_distributions(0).attributes().error_code());
EXPECT_EQ(8u, metric_proto.test_distributions(0).attributes().length());
EXPECT_TRUE(metric_proto.test_distributions(0).attributes().error_code_bool());
EXPECT_TRUE(
metric_proto.test_distributions(0).attributes().error_code_bool());
EXPECT_EQ(
3u, metric_proto.test_distributions(0).attributes().cdm_security_level());
}