16
16
17
17
#include " cpp/score/score.h"
18
18
19
+ #include < cstdint>
19
20
#include < map>
20
21
#include < vector>
21
22
@@ -27,7 +28,7 @@ namespace material_color_utilities {
27
28
namespace {
28
29
29
30
TEST (ScoreTest, PrioritizesChroma) {
30
- std::map<Argb, int > argb_to_population = {
31
+ std::map<Argb, uint32_t > argb_to_population = {
31
32
{0xff000000 , 1 }, {0xffffffff , 1 }, {0xff0000ff , 1 }};
32
33
33
34
std::vector<Argb> ranked =
@@ -38,7 +39,7 @@ TEST(ScoreTest, PrioritizesChroma) {
38
39
}
39
40
40
41
TEST (ScoreTest, PrioritizesChromaWhenProportionsEqual) {
41
- std::map<Argb, int > argb_to_population = {
42
+ std::map<Argb, uint32_t > argb_to_population = {
42
43
{0xffff0000 , 1 }, {0xff00ff00 , 1 }, {0xff0000ff , 1 }};
43
44
44
45
std::vector<Argb> ranked =
@@ -51,7 +52,7 @@ TEST(ScoreTest, PrioritizesChromaWhenProportionsEqual) {
51
52
}
52
53
53
54
TEST (ScoreTest, GeneratesGblueWhenNoColorsAvailable) {
54
- std::map<Argb, int > argb_to_population = {{0xff000000 , 1 }};
55
+ std::map<Argb, uint32_t > argb_to_population = {{0xff000000 , 1 }};
55
56
56
57
std::vector<Argb> ranked =
57
58
RankedSuggestions (argb_to_population, {.desired = 4 });
@@ -61,7 +62,7 @@ TEST(ScoreTest, GeneratesGblueWhenNoColorsAvailable) {
61
62
}
62
63
63
64
TEST (ScoreTest, DedupesNearbyHues) {
64
- std::map<Argb, int > argb_to_population = {
65
+ std::map<Argb, uint32_t > argb_to_population = {
65
66
{0xff008772 , 1 }, // H 180 C 42 T 50
66
67
{0xff318477 , 1 } // H 184 C 35 T 50
67
68
};
@@ -74,7 +75,7 @@ TEST(ScoreTest, DedupesNearbyHues) {
74
75
}
75
76
76
77
TEST (ScoreTest, MaximizesHueDistance) {
77
- std::map<Argb, int > argb_to_population = {
78
+ std::map<Argb, uint32_t > argb_to_population = {
78
79
{0xff008772 , 1 }, // H 180 C 42 T 50
79
80
{0xff008587 , 1 }, // H 198 C 50 T 50
80
81
{0xff007ebc , 1 } // H 245 C 50 T 50
@@ -89,7 +90,7 @@ TEST(ScoreTest, MaximizesHueDistance) {
89
90
}
90
91
91
92
TEST (ScoreTest, GeneratedScenarioOne) {
92
- std::map<Argb, int > argb_to_population = {
93
+ std::map<Argb, uint32_t > argb_to_population = {
93
94
{0xff7ea16d , 67 },
94
95
{0xffd8ccae , 67 },
95
96
{0xff835c0d , 49 },
@@ -106,7 +107,7 @@ TEST(ScoreTest, GeneratedScenarioOne) {
106
107
}
107
108
108
109
TEST (ScoreTest, GeneratedScenarioTwo) {
109
- std::map<Argb, int > argb_to_population = {
110
+ std::map<Argb, uint32_t > argb_to_population = {
110
111
{0xffd33881 , 14 },
111
112
{0xff3205cc , 77 },
112
113
{0xff0b48cf , 36 },
@@ -124,7 +125,7 @@ TEST(ScoreTest, GeneratedScenarioTwo) {
124
125
}
125
126
126
127
TEST (ScoreTest, GeneratedScenarioThree) {
127
- std::map<Argb, int > argb_to_population = {
128
+ std::map<Argb, uint32_t > argb_to_population = {
128
129
{0xffbe94a6 , 23 },
129
130
{0xffc33fd7 , 42 },
130
131
{0xff899f36 , 90 },
@@ -142,7 +143,7 @@ TEST(ScoreTest, GeneratedScenarioThree) {
142
143
}
143
144
144
145
TEST (ScoreTest, GeneratedScenarioFour) {
145
- std::map<Argb, int > argb_to_population = {
146
+ std::map<Argb, uint32_t > argb_to_population = {
146
147
{0xffdf241c , 85 }, {0xff685859 , 44 }, {0xffd06d5f , 34 },
147
148
{0xff561c54 , 27 }, {0xff713090 , 88 },
148
149
};
@@ -157,7 +158,7 @@ TEST(ScoreTest, GeneratedScenarioFour) {
157
158
}
158
159
159
160
TEST (ScoreTest, GeneratedScenarioFive) {
160
- std::map<Argb, int > argb_to_population = {
161
+ std::map<Argb, uint32_t > argb_to_population = {
161
162
{0xffbe66f8 , 41 }, {0xff4bbda9 , 88 }, {0xff80f6f9 , 44 },
162
163
{0xffab8017 , 43 }, {0xffe89307 , 65 },
163
164
};
@@ -173,7 +174,7 @@ TEST(ScoreTest, GeneratedScenarioFive) {
173
174
}
174
175
175
176
TEST (ScoreTest, GeneratedScenarioSix) {
176
- std::map<Argb, int > argb_to_population = {
177
+ std::map<Argb, uint32_t > argb_to_population = {
177
178
{0xff18ea8f , 93 }, {0xff327593 , 18 }, {0xff066a18 , 53 },
178
179
{0xfffa8a23 , 74 }, {0xff04ca1f , 62 },
179
180
};
@@ -188,7 +189,7 @@ TEST(ScoreTest, GeneratedScenarioSix) {
188
189
}
189
190
190
191
TEST (ScoreTest, GeneratedScenarioSeven) {
191
- std::map<Argb, int > argb_to_population = {
192
+ std::map<Argb, uint32_t > argb_to_population = {
192
193
{0xff2e05ed , 23 }, {0xff153e55 , 90 }, {0xff9ab220 , 23 },
193
194
{0xff153379 , 66 }, {0xff68bcc3 , 81 },
194
195
};
@@ -203,7 +204,7 @@ TEST(ScoreTest, GeneratedScenarioSeven) {
203
204
}
204
205
205
206
TEST (ScoreTest, GeneratedScenarioEight) {
206
- std::map<Argb, int > argb_to_population = {
207
+ std::map<Argb, uint32_t > argb_to_population = {
207
208
{0xff816ec5 , 24 },
208
209
{0xff6dcb94 , 19 },
209
210
{0xff3cae91 , 98 },
@@ -219,7 +220,7 @@ TEST(ScoreTest, GeneratedScenarioEight) {
219
220
}
220
221
221
222
TEST (ScoreTest, GeneratedScenarioNine) {
222
- std::map<Argb, int > argb_to_population = {
223
+ std::map<Argb, uint32_t > argb_to_population = {
223
224
{0xff206f86 , 52 }, {0xff4a620d , 96 }, {0xfff51401 , 85 },
224
225
{0xff2b8ebf , 3 }, {0xff277766 , 59 },
225
226
};
@@ -235,7 +236,7 @@ TEST(ScoreTest, GeneratedScenarioNine) {
235
236
}
236
237
237
238
TEST (ScoreTest, GeneratedScenarioTen) {
238
- std::map<Argb, int > argb_to_population = {
239
+ std::map<Argb, uint32_t > argb_to_population = {
239
240
{0xff8b1d99 , 54 },
240
241
{0xff27effe , 43 },
241
242
{0xff6f558d , 2 },
0 commit comments