@@ -16,55 +16,64 @@ TEST(HumanReadableTest, base2) {
1616 }
1717}
1818
19- TEST (HumanReadableTest, base10) {
20- {
21- const auto res = benchmark::Base10HumanReadableFormat (100 );
22- EXPECT_STREQ (res.c_str (), " 100" );
23- }
24- {
25- const auto res = benchmark::Base10HumanReadableFormat (1000 );
26- EXPECT_STREQ (res.c_str (), " 1k" );
27- }
28- {
29- const auto res = benchmark::Base10HumanReadableFormat (10000 );
30- EXPECT_STREQ (res.c_str (), " 10k" );
31- }
32- {
33- const auto res = benchmark::Base10HumanReadableFormat (20000 );
34- EXPECT_STREQ (res.c_str (), " 20k" );
35- }
36- {
37- const auto res = benchmark::Base10HumanReadableFormat (32000 );
38- EXPECT_STREQ (res.c_str (), " 32k" );
39- }
40- {
41- const auto res = benchmark::Base10HumanReadableFormat (1000000 );
42- EXPECT_STREQ (res.c_str (), " 1M" );
43- }
44- {
45- const auto res = benchmark::Base10HumanReadableFormat (42000000 );
46- EXPECT_STREQ (res.c_str (), " 42M" );
47- }
48- {
49- const auto res = benchmark::Base10HumanReadableFormat (1000000000 );
50- EXPECT_STREQ (res.c_str (), " 1B" );
51- }
52- {
53- const auto res = benchmark::Base10HumanReadableFormat (4000000000 );
54- EXPECT_STREQ (res.c_str (), " 4B" );
55- }
56- {
57- const auto res = benchmark::Base10HumanReadableFormat (4200000000 );
58- EXPECT_STREQ (res.c_str (), " 4.2B" );
59- }
60- {
61- const auto res = benchmark::Base10HumanReadableFormat (40200000 );
62- EXPECT_STREQ (res.c_str (), " 40.2M" );
63- }
64- {
65- const auto res = benchmark::Base10HumanReadableFormat (4200000000000000000 );
66- EXPECT_STREQ (res.c_str (), " 4.2Qi" );
67- }
19+ TEST (HumanReadableTest, base10_100) {
20+ const auto res = benchmark::Base10HumanReadableFormat (100 );
21+ EXPECT_STREQ (res.c_str (), " 100" );
22+ }
23+
24+ TEST (HumanReadableTest, base10_1k) {
25+ const auto res = benchmark::Base10HumanReadableFormat (1000 );
26+ EXPECT_STREQ (res.c_str (), " 1k" );
27+ }
28+
29+ TEST (HumanReadableTest, base10_10k) {
30+ const auto res = benchmark::Base10HumanReadableFormat (10000 );
31+ EXPECT_STREQ (res.c_str (), " 10k" );
32+ }
33+
34+ TEST (HumanReadableTest, base10_20k) {
35+ const auto res = benchmark::Base10HumanReadableFormat (20000 );
36+ EXPECT_STREQ (res.c_str (), " 20k" );
37+ }
38+
39+ TEST (HumanReadableTest, base10_32k) {
40+ const auto res = benchmark::Base10HumanReadableFormat (32000 );
41+ EXPECT_STREQ (res.c_str (), " 32k" );
42+ }
43+
44+ TEST (HumanReadableTest, base10_1M) {
45+ const auto res = benchmark::Base10HumanReadableFormat (1000000 );
46+ EXPECT_STREQ (res.c_str (), " 1M" );
47+ }
48+
49+ TEST (HumanReadableTest, base10_42M) {
50+ const auto res = benchmark::Base10HumanReadableFormat (42000000 );
51+ EXPECT_STREQ (res.c_str (), " 42M" );
52+ }
53+
54+ TEST (HumanReadableTest, base10_1B) {
55+ const auto res = benchmark::Base10HumanReadableFormat (1000000000 );
56+ EXPECT_STREQ (res.c_str (), " 1B" );
57+ }
58+
59+ TEST (HumanReadableTest, base10_4B) {
60+ const auto res = benchmark::Base10HumanReadableFormat (4000000000 );
61+ EXPECT_STREQ (res.c_str (), " 4B" );
62+ }
63+
64+ TEST (HumanReadableTest, base10_4_2B) {
65+ const auto res = benchmark::Base10HumanReadableFormat (4200000000 );
66+ EXPECT_STREQ (res.c_str (), " 4.2B" );
67+ }
68+
69+ TEST (HumanReadableTest, base10_40_2M) {
70+ const auto res = benchmark::Base10HumanReadableFormat (40200000 );
71+ EXPECT_STREQ (res.c_str (), " 40.2M" );
72+ }
73+
74+ TEST (HumanReadableTest, base10_4_2Qi) {
75+ const auto res = benchmark::Base10HumanReadableFormat (4200000000000000000 );
76+ EXPECT_STREQ (res.c_str (), " 4.2Qi" );
6877}
6978
7079} // end namespace
0 commit comments