1 #include <gtest/gtest.h> 2 3 #include <string> 4 #include <algorithm> 5 #include <cstring> 6 7 8 extern "C" uint32_t cpuinfo_x86_normalize_brand_string( 9 const char* raw_name, char* normalized_name); 10 11 12 inline std::string normalize_brand_string(const char name[48]) { 13 char normalized_name[48]; 14 cpuinfo_x86_normalize_brand_string(name, normalized_name); 15 return std::string(normalized_name); 16 } 17 18 TEST(BRAND_STRING, intel) { 19 EXPECT_EQ("", 20 normalize_brand_string("Genuine Intel(R) CPU @ 2.33GHz\0")); 21 EXPECT_EQ("", 22 normalize_brand_string(" Genuine Intel(R) CPU 3.00GHz\0")); 23 EXPECT_EQ("", 24 normalize_brand_string(" Genuine Intel(R) CPU @ 2.60GHz\0")); 25 EXPECT_EQ("", 26 normalize_brand_string("Genuine Intel(R) CPU 0000 @ 1.73GHz\0")); 27 EXPECT_EQ("", 28 normalize_brand_string(" Genuine Intel(R) CPU @ 728\0MHz\0")); 29 EXPECT_EQ("", 30 normalize_brand_string(" Genuine Intel(R) CPU 3.46GHz\0")); 31 EXPECT_EQ("", 32 normalize_brand_string(" Genuine Intel(R) CPU @ 1.66GHz\0")); 33 EXPECT_EQ("", 34 normalize_brand_string("Genuine Intel(R) CPU 0000 @ 2.40GHz\0")); 35 EXPECT_EQ("", 36 normalize_brand_string("Genuine Intel(R) processor 800MHz\0")); 37 EXPECT_EQ("", 38 normalize_brand_string(" Genuine Intel(R) CPU @ 2.40GHz\0")); 39 EXPECT_EQ("", 40 normalize_brand_string("Genuine Intel(R) CPU 0 @ 1.60GHz\0")); 41 EXPECT_EQ("", 42 normalize_brand_string("Genuine Intel(R) CPU @ 2.66GHz\0")); 43 EXPECT_EQ("", 44 normalize_brand_string("Genuine Intel(R) CPU 000 @ 2.13GHz\0")); 45 EXPECT_EQ("", 46 normalize_brand_string("Genuine Intel(R) CPU @ 0000 @ 2.67GHz\0")); 47 EXPECT_EQ("", 48 normalize_brand_string("Genuine Intel(R) CPU 000 @ 2>13GHz\0")); 49 EXPECT_EQ("", 50 normalize_brand_string("Genuine Intel(R) CPU @ 0000 @ 1.87GHz\0")); 51 EXPECT_EQ("", 52 normalize_brand_string("Genuine Intel(R) CPU @ 2.13GHz\0")); 53 EXPECT_EQ("", 54 normalize_brand_string("Genuine Intel(R) CPU 000 @ 3.20GHz\0")); 55 EXPECT_EQ("4000", 56 normalize_brand_string(" Genuine Intel(R) CPU 4000 @ 1.00GHz\0")); 57 EXPECT_EQ("5Y70", 58 normalize_brand_string("Intel(R) Processor 5Y70 CPU @ 1.10GHz\0\0\0\0\0\0\0\0\0\0\0")); 59 EXPECT_EQ("Atom 230", 60 normalize_brand_string(" Intel(R) Atom(TM) CPU 230 @ 1.60GHz\0")); 61 EXPECT_EQ("Atom 330", 62 normalize_brand_string(" Intel(R) Atom(TM) CPU 330 @ 1.60GHz\0")); 63 EXPECT_EQ("Atom C2750", 64 normalize_brand_string(" Intel(R) Atom(TM) CPU C2750 @ 2.40GHz\0")); 65 EXPECT_EQ("Atom C2758", 66 normalize_brand_string(" Intel(R) Atom(TM) CPU C2758 @ 2.40GHz\0")); 67 EXPECT_EQ("Atom D2500", 68 normalize_brand_string(" Intel(R) Atom(TM) CPU D2500 @ 1.86GHz\0")); 69 EXPECT_EQ("Atom D2700", 70 normalize_brand_string(" Intel(R) Atom(TM) CPU D2700 @ 2.13GHz\0")); 71 EXPECT_EQ("Atom D525", 72 normalize_brand_string(" Intel(R) Atom(TM) CPU D525 @ 1.80GHz\0")); 73 EXPECT_EQ("Atom N455", 74 normalize_brand_string(" Intel(R) Atom(TM) CPU N455 @ 1.66GHz\0")); 75 EXPECT_EQ("Atom S1260", 76 normalize_brand_string(" Intel(R) Atom(TM) CPU S1260 @ 2.00GHz\0")); 77 EXPECT_EQ("Atom Z2460", 78 normalize_brand_string(" Intel(R) Atom(TM) CPU Z2460 @ 1.60GHz\0")); 79 EXPECT_EQ("Atom Z2760", 80 normalize_brand_string(" Intel(R) Atom(TM) CPU Z2760 @ 1.80GHz\0")); 81 EXPECT_EQ("Atom Z3740", 82 normalize_brand_string(" Intel(R) Atom(TM) CPU Z3740 @ 1.33GHz\0")); 83 EXPECT_EQ("Atom Z3745", 84 normalize_brand_string(" Intel(R) Atom(TM) CPU Z3745 @ 1.33GHz\0")); 85 EXPECT_EQ("Atom Z670", 86 normalize_brand_string(" Intel(R) Atom(TM) CPU Z670 @ 1.50GHz\0")); 87 EXPECT_EQ("Atom x7-Z8700", 88 normalize_brand_string(" Intel(R) Atom(TM) x7-Z8700 CPU @ 1.60GHz\0")); 89 EXPECT_EQ("Celeron 1.70GHz", 90 normalize_brand_string(" Intel(R) Celeron(R) CPU 1.70GHz\0")); 91 EXPECT_EQ("Celeron 2.00GHz", 92 normalize_brand_string(" Intel(R) Celeron(R) CPU 2.00GHz\0")); 93 EXPECT_EQ("Celeron 2.53GHz", 94 normalize_brand_string(" Intel(R) Celeron(R) CPU 2.53GHz\0")); 95 EXPECT_EQ("Celeron 215", 96 normalize_brand_string("Intel(R) Celeron(R) CPU 215 @ 1.33GHz\0")); 97 EXPECT_EQ("Celeron 420", 98 normalize_brand_string("Intel(R) Celeron(R) CPU 420 @ 1.60GHz\0")); 99 EXPECT_EQ("Celeron 600MHz", 100 normalize_brand_string("Intel(R) Celeron(R) processor 600MHz\0")); 101 EXPECT_EQ("Celeron D 3.06GHz", 102 normalize_brand_string(" Intel(R) Celeron(R) D CPU 3.06GHz\0")); 103 EXPECT_EQ("Celeron G1610", 104 normalize_brand_string(" Intel(R) Celeron(R) CPU G1610 @ 2.60GHz\0")); 105 EXPECT_EQ("Celeron J1900", 106 normalize_brand_string(" Intel(R) Celeron(R) CPU J1900 @ 1.99GHz\0")); 107 EXPECT_EQ("Celeron J3455", 108 normalize_brand_string("Intel(R) Celeron(R) CPU J3455 @ 1.50GHz\0\0\0\0\0\0\0\0\0")); 109 EXPECT_EQ("Celeron M 1300MHz", 110 normalize_brand_string("Intel(R) Celeron(R) M processor 1300MHz\0")); 111 EXPECT_EQ("Celeron M 430", 112 normalize_brand_string("Intel(R) Celeron(R) M CPU 430 @ 1.73GHz\0")); 113 EXPECT_EQ("Celeron N3050", 114 normalize_brand_string(" Intel(R) Celeron(R) CPU N3050 @ 1.60GHz\0")); 115 EXPECT_EQ("Celeron N3150", 116 normalize_brand_string(" Intel(R) Celeron(R) CPU N3150 @ 1.60GHz\0")); 117 EXPECT_EQ("Core 2 6300", 118 normalize_brand_string("Intel(R) Core(TM)2 CPU 6300 @ 1.86GHz\0")); 119 EXPECT_EQ("Core 2 6700", 120 normalize_brand_string("Intel(R) Core(TM)2 CPU 6700 @ 2.66GHz\0")); 121 EXPECT_EQ("Core 2 Duo P8400", 122 normalize_brand_string("Intel(R) Core(TM)2 Duo CPU P8400 @ 2.26GHz\0")); 123 EXPECT_EQ("Core 2 Duo T8300", 124 normalize_brand_string("Intel(R) Core(TM)2 Duo CPU T8300 @ 2.40GHz\0")); 125 EXPECT_EQ("Core 2 Extreme X9650", 126 normalize_brand_string("Intel(R) Core(TM)2 Extreme CPU X9650 @ 3.00GHz\0")); 127 EXPECT_EQ("Core 2 Quad 2.66GHz", 128 normalize_brand_string("Intel(R) Core(TM)2 Quad CPU @ 2.66GHz\0")); 129 EXPECT_EQ("Core 2 Quad Q6600", 130 normalize_brand_string("Intel(R) Core(TM)2 Quad CPU Q6600 @ 2.40GHz\0")); 131 EXPECT_EQ("Core 2 Quad Q9300", 132 normalize_brand_string("Intel(R) Core(TM)2 Quad CPU Q9300 @ 2.50GHz\0")); 133 EXPECT_EQ("Core 2 T5600", 134 normalize_brand_string("Intel(R) Core(TM)2 CPU T5600 @ 1.83GHz\0")); 135 EXPECT_EQ("Core 820Q", 136 normalize_brand_string("Intel(R) Core(TM) CPU Q 820 @ 1.73GHz\0")); 137 EXPECT_EQ("Core i3 380M", 138 normalize_brand_string("Intel(R) Core(TM) i3 CPU M 380 @ 2.53GHz\0")); 139 EXPECT_EQ("Core i5 480M", 140 normalize_brand_string("Intel(R) Core(TM) i5 CPU M 480 @ 2.67GHz\0")); 141 EXPECT_EQ("Core i5 650", 142 normalize_brand_string("Intel(R) Core(TM) i5 CPU 650 @ 3.20GHz\0")); 143 EXPECT_EQ("Core i5 750", 144 normalize_brand_string("Intel(R) Core(TM) i5 CPU 750 @ 2.67GHz\0")); 145 EXPECT_EQ("Core i5-2400", 146 normalize_brand_string(" Intel(R) Core(TM) i5-2400 CPU @ 3.10GHz\0")); 147 EXPECT_EQ("Core i5-2450M", 148 normalize_brand_string(" Intel(R) Core(TM) i5-2450M CPU @ 2.50GHz\0")); 149 EXPECT_EQ("Core i5-5250U", 150 normalize_brand_string("Intel(R) Core(TM) i5-5250U CPU @ 1.60GHz\0\0\0\0\0\0\0\0")); 151 EXPECT_EQ("Core i5-6400T", 152 normalize_brand_string("Intel(R) Core(TM) i5-6400T CPU @ 2.20GHz\0\0\0\0\0\0\0\0")); 153 EXPECT_EQ("Core i5-7200U", 154 normalize_brand_string("Intel(R) Core(TM) i5-7200U CPU @ 2.50GHz\0\0\0\0\0\0\0\0")); 155 EXPECT_EQ("Core i7 720Q", 156 normalize_brand_string("Intel(R) Core(TM) i7 CPU Q 720 @ 1.60GHz\0")); 157 EXPECT_EQ("Core i7 860", 158 normalize_brand_string("Intel(R) Core(TM) i7 CPU 860 @ 2.80GHz\0")); 159 EXPECT_EQ("Core i7 990X", 160 normalize_brand_string("Intel(R) Core(TM) i7 CPU X 990 @ 3.47GHz\0")); 161 EXPECT_EQ("Core i7-2600", 162 normalize_brand_string(" Intel(R) Core(TM) i7-2600 CPU @ 3.40GHz\0")); 163 EXPECT_EQ("Core i7-2600K", 164 normalize_brand_string(" Intel(R) Core(TM) i7-2600K CPU @ 3.40GHz\0")); 165 EXPECT_EQ("Core i7-3770K", 166 normalize_brand_string(" Intel(R) Core(TM) i7-3770K CPU @ 3.50GHz\0")); 167 EXPECT_EQ("Core i7-3960X", 168 normalize_brand_string(" Intel(R) Core(TM) i7-3960X CPU @ 3.30GHz\0")); 169 EXPECT_EQ("Core i7-4500U", 170 normalize_brand_string("Intel(R) Core(TM) i7-4500U CPU @ 1.80GHz\0\0\0\0\0\0\0\0")); 171 EXPECT_EQ("Core i7-4770", 172 normalize_brand_string("Intel(R) Core(TM) i7-4770 CPU @ 3.40GHz\0\0\0\0\0\0\0\0\0")); 173 EXPECT_EQ("Core i7-4770R", 174 normalize_brand_string("Intel(R) Core(TM) i7-4770R CPU @ 3.20GHz\0\0\0\0\0\0\0\0")); 175 EXPECT_EQ("Core i7-4930K", 176 normalize_brand_string(" Intel(R) Core(TM) i7-4930K CPU @ 3.40GHz\0")); 177 EXPECT_EQ("Core i7-5775C", 178 normalize_brand_string("Intel(R) Core(TM) i7-5775C CPU @ 3.30GHz\0\0\0\0\0\0\0\0")); 179 EXPECT_EQ("Core i7-5820K", 180 normalize_brand_string("Intel(R) Core(TM) i7-5820K CPU @ 3.30GHz\0\0\0\0\0\0\0\0")); 181 EXPECT_EQ("Core i7-6500U", 182 normalize_brand_string("Intel(R) Core(TM) i7-6500U CPU @ 2.50GHz\0\0\0\0\0\0\0\0")); 183 EXPECT_EQ("Core i7-6800K", 184 normalize_brand_string("Intel(R) Core(TM) i7-6800K CPU @ 3.40GHz\0\0\0\0\0\0\0\0")); 185 EXPECT_EQ("Core i7-6850K", 186 normalize_brand_string("Intel(R) Core(TM) i7-6850K CPU @ 3.60GHz\0\0\0\0\0\0\0\0")); 187 EXPECT_EQ("Core i7-6950X", 188 normalize_brand_string("Intel(R) Core(TM) i7-6950X CPU @ 3.00GHz\0\0\0\0\0\0\0\0")); 189 EXPECT_EQ("Core i7-7700K", 190 normalize_brand_string("Intel(R) Core(TM) i7-7700K CPU @ 4.20GHz\0\0\0\0\0\0\0\0")); 191 EXPECT_EQ("Core i7-7800X", 192 normalize_brand_string("Intel(R) Core(TM) i7-7800X CPU @ 3.50GHz\0\0\0\0\0\0\0\0")); 193 EXPECT_EQ("Core i9-7900X", 194 normalize_brand_string("Intel(R) Core(TM) i9-7900X CPU @ 3.30GHz\0\0\0\0\0\0\0\0")); 195 EXPECT_EQ("Core m3-6Y30", 196 normalize_brand_string("Intel(R) Core(TM) m3-6Y30 CPU @ 0.90GHz\0\0\0\0\0\0\0\0\0")); 197 EXPECT_EQ("Pentium 4 1.60GHz", 198 normalize_brand_string(" Intel(R) Pentium(R) 4 CPU 1.60GHz\0")); 199 EXPECT_EQ("Pentium 4 2.40GHz", 200 normalize_brand_string(" Intel(R) Pentium(R) 4 CPU 2.40GHz\0")); 201 EXPECT_EQ("Pentium 4 2.80GHz", 202 normalize_brand_string(" Intel(R) Pentium(R) 4 CPU 2.80GHz\0")); 203 EXPECT_EQ("Pentium 4 3.00GHz", 204 normalize_brand_string(" Intel(R) Pentium(R) 4 CPU 3.00GHz\0")); 205 EXPECT_EQ("Pentium 4 3.20GHz", 206 normalize_brand_string(" Intel(R) Pentium(R) 4 CPU 3.20GHz\0")); 207 EXPECT_EQ("Pentium 4 3.46GHz", 208 normalize_brand_string(" Intel(R) Pentium(R) 4 CPU 3.46GHz\0")); 209 EXPECT_EQ("Pentium 4 3.73GHz", 210 normalize_brand_string(" Intel(R) Pentium(R) 4 CPU 3.73GHz\0")); 211 EXPECT_EQ("Pentium D 2.80GHz", 212 normalize_brand_string(" Intel(R) Pentium(R) D CPU 2.80GHz\0")); 213 EXPECT_EQ("Pentium Dual E2220", 214 normalize_brand_string("Intel(R) Pentium(R) Dual CPU E2220 @ 2.40GHz\0")); 215 EXPECT_EQ("Pentium G840", 216 normalize_brand_string(" Intel(R) Pentium(R) CPU G840 @ 2.80GHz\0")); 217 EXPECT_EQ("Pentium III 1266MHz", 218 normalize_brand_string("Intel(R) Pentium(R) III CPU family 1266MHz\0")); 219 EXPECT_EQ("Pentium M 1.60GHz", 220 normalize_brand_string(" Intel(R) Pentium(R) M processor 1.60GHz\0")); 221 EXPECT_EQ("Pentium M 2.00GHz", 222 normalize_brand_string("Intel(R) Pentium(R) M CPU 000 @ 2.00GHz\0")); 223 EXPECT_EQ("Pentium N4200", 224 normalize_brand_string("Intel(R) Pentium(R) CPU N4200 @ 1.10GHz\0\0\0\0\0\0\0\0\0")); 225 EXPECT_EQ("Pentium T4200", 226 normalize_brand_string("Pentium(R) Dual-Core CPU T4200 @ 2.00GHz\0")); 227 EXPECT_EQ("Pentium T4500", 228 normalize_brand_string("Pentium(R) Dual-Core CPU T4500 @ 2.30GHz\0")); 229 EXPECT_EQ("Xeon 2.66GHz", 230 normalize_brand_string(" Intel(R) Xeon(TM) CPU 2.66GHz\0")); 231 EXPECT_EQ("Xeon 2.80GHz", 232 normalize_brand_string(" Intel(R) Xeon(TM) CPU 2.80GHz\0")); 233 EXPECT_EQ("Xeon 3.06GHz", 234 normalize_brand_string(" Intel(R) Xeon(TM) CPU 3.06GHz\0")); 235 EXPECT_EQ("Xeon 3.20GHz", 236 normalize_brand_string(" Intel(R) Xeon(TM) CPU 3.20GHz\0")); 237 EXPECT_EQ("Xeon 3.40GHz", 238 normalize_brand_string(" Intel(R) Xeon(TM) CPU 3.40GHz\0")); 239 EXPECT_EQ("Xeon D-1540", 240 normalize_brand_string("Intel(R) Xeon(R) CPU D-1540 @ 2.00GHz\0\0\0\0\0\0\0\0\0\0\0")); 241 EXPECT_EQ("Xeon E3-1230 v2", 242 normalize_brand_string(" Intel(R) Xeon(R) CPU E3-1230 V2 @ 3.30GHz\0")); 243 EXPECT_EQ("Xeon E3-1245 v3", 244 normalize_brand_string("Intel(R) Xeon(R) CPU E3-1245 v3 @ 3.40GHz\0\0\0\0\0\0\0")); 245 EXPECT_EQ("Xeon E5-2660 v3", 246 normalize_brand_string("Intel(R) Xeon(R) CPU E5-2660 v3 @ 2.60GHz\0\0\0\0\0\0\0")); 247 EXPECT_EQ("Xeon E5-2696 v4", 248 normalize_brand_string("Intel(R) Xeon(R) CPU E5-2696 v4 @ 2.20GHz\0\0\0\0\0\0\0")); 249 EXPECT_EQ("Xeon E5-2697 v2", 250 normalize_brand_string(" Intel(R) Xeon(R) CPU E5-2697 v2 @ 2.70GHz\0")); 251 EXPECT_EQ("Xeon E5-2697 v4", 252 normalize_brand_string("Intel(R) Xeon(R) CPU E5-2697 v4 @ 2.30GHz\0\0\0\0\0\0\0")); 253 EXPECT_EQ("Xeon E5-2699 v3", 254 normalize_brand_string("Intel(R) Xeon(R) CPU E5-2699 v3 @ 2.30GHz\0\0\0\0\0\0\0")); 255 EXPECT_EQ("Xeon E5462", 256 normalize_brand_string("Intel(R) Xeon(R) CPU E5462 @ 2.80GHz\0")); 257 EXPECT_EQ("Xeon E7-4870", 258 normalize_brand_string(" Intel(R) Xeon(R) CPU E7- 4870 @ 2.40GHz\0")); 259 EXPECT_EQ("Xeon E7-8870", 260 normalize_brand_string(" Intel(R) Xeon(R) CPU E7- 8870 @ 2.40GHz\0")); 261 EXPECT_EQ("Xeon E7450", 262 normalize_brand_string("Intel(R) Xeon(R) CPU E7450 @ 2.40GHz\0")); 263 EXPECT_EQ("Xeon E7520", 264 normalize_brand_string("Intel(R) Xeon(R) CPU E7520 @ 1.87GHz\0")); 265 EXPECT_EQ("Xeon Gold 6130", 266 normalize_brand_string("Intel(R) Xeon(R) Gold 6130 CPU @ 2.10GHz\0\0\0\0\0\0\0\0")); 267 EXPECT_EQ("Xeon Gold 6154", 268 normalize_brand_string("Intel(R) Xeon(R) Gold 6154 CPU @ 3.00GHz\0\0\0\0\0\0\0\0")); 269 EXPECT_EQ("Xeon L5320", 270 normalize_brand_string("Intel(R) Xeon(R) CPU L5320 @ 1.86GHz\0")); 271 EXPECT_EQ("Xeon Phi 7210", 272 normalize_brand_string("Intel(R) Xeon Phi(TM) CPU 7210 @ 1.30GHz\0\0\0\0\0\0\0\0")); 273 EXPECT_EQ("Xeon Platinum 8180", 274 normalize_brand_string("Intel(R) Xeon(R) Platinum 8180 CPU @ 2.50GHz\0\0\0\0")); 275 EXPECT_EQ("Xeon X3210", 276 normalize_brand_string("Intel(R) Xeon(R) CPU X3210 @ 2.13GHz\0")); 277 EXPECT_EQ("Xeon X3323", 278 normalize_brand_string("Intel(R) Xeon(R) CPU X3323 @ 2.50GHz\0")); 279 EXPECT_EQ("Xeon X5667", 280 normalize_brand_string("Intel(R) Xeon(R) CPU X5667 @ 3.07GHz\0")); 281 EXPECT_EQ("Xeon X6550", 282 normalize_brand_string("Intel(R) Xeon(R) CPU X6550 @ 2.00GHz\0")); 283 } 284 285 TEST(BRAND_STRING, intel_android) { 286 EXPECT_EQ("Atom N2600", 287 normalize_brand_string("Intel(R) Atom(TM) CPU N2600 @ 1.60GHz\0\0\0\0\0\0\0\0\0")); 288 EXPECT_EQ("Atom Sofia3GR", 289 normalize_brand_string("Intel(R) Atom(TM) CPU Sofia3GR\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0")); 290 EXPECT_EQ("Atom Z2420", 291 normalize_brand_string("Intel(R) Atom(TM) CPU Z2420 @ 1.20GHz\0\0\0\0\0\0\0\0\0\0")); 292 EXPECT_EQ("Atom Z2460", 293 normalize_brand_string("Intel(R) Atom(TM) CPU Z2460 @ 1.60GHz\0\0\0\0\0\0\0\0\0\0")); 294 EXPECT_EQ("Atom Z2480", 295 normalize_brand_string("Intel(R) Atom(TM) CPU Z2480 @ 2.00GHz\0\0\0\0\0\0\0\0\0\0")); 296 EXPECT_EQ("Atom Z2520", 297 normalize_brand_string("Intel(R) Atom(TM) CPU Z2520 @ 1.20GHz\0\0\0\0\0\0\0\0\0\0")); 298 EXPECT_EQ("Atom Z2560", 299 normalize_brand_string("Intel(R) Atom(TM) CPU Z2560 @ 1.60GHz\0\0\0\0\0\0\0\0\0\0")); 300 EXPECT_EQ("Atom Z2580", 301 normalize_brand_string("Intel(R) Atom(TM) CPU Z2580 @ 2.00GHz\0\0\0\0\0\0\0\0\0\0")); 302 EXPECT_EQ("Atom Z3460", 303 normalize_brand_string("Intel(R) Atom(TM) CPU Z3460 @ 1.06GHz\0\0\0\0\0\0\0\0\0")); 304 EXPECT_EQ("Atom Z3480", 305 normalize_brand_string("Intel(R) Atom(TM) CPU Z3480 @ 1.33GHz\0\0\0\0\0\0\0\0\0")); 306 EXPECT_EQ("Atom Z3530", 307 normalize_brand_string("Intel(R) Atom(TM) CPU Z3530 @ 1.33GHz\0\0\0\0\0\0\0\0\0\0\0")); 308 EXPECT_EQ("Atom Z3530", 309 normalize_brand_string("Intel(R) Atom(TM) CPU Z3530 @ 1.33GHz\0\0\0\0\0\0\0\0\0\0")); 310 EXPECT_EQ("Atom Z3530", 311 normalize_brand_string("Intel(R) Atom(TM) CPU Z3530 @ 1.33GHz\0\0\0\0\0\0\0\0\0")); 312 EXPECT_EQ("Atom Z3560", 313 normalize_brand_string("Intel(R) Atom(TM) CPU Z3560 @ 1.00GHz\0\0\0\0\0\0\0\0\0")); 314 EXPECT_EQ("Atom Z3560", 315 normalize_brand_string("Intel(R) Atom(TM) CPU Z3560 @ 1.83GHz\0\0\0\0\0\0\0\0\0\0")); 316 EXPECT_EQ("Atom Z3560", 317 normalize_brand_string("Intel(R) Atom(TM) CPU Z3560 @ 1.83GHz\0\0\0\0\0\0\0\0\0\0\0")); 318 EXPECT_EQ("Atom Z3580", 319 normalize_brand_string("Intel(R) Atom(TM) CPU Z3580 @ 1.33GHz\0\0\0\0\0\0\0\0\0")); 320 EXPECT_EQ("Atom Z3580", 321 normalize_brand_string("Intel(R) Atom(TM) CPU Z3580 @ 2.33GHz\0\0\0\0\0\0\0\0\0\0")); 322 EXPECT_EQ("Atom Z3590", 323 normalize_brand_string("Intel(R) Atom(TM) CPU Z3590 @ 1.33GHz\0\0\0\0\0\0\0\0\0")); 324 EXPECT_EQ("Atom Z3735D", 325 normalize_brand_string("Intel(R) Atom(TM) CPU Z3735D @ 1.33GHz\0\0\0\0\0\0\0\0\0")); 326 EXPECT_EQ("Atom Z3735E", 327 normalize_brand_string("Intel(R) Atom(TM) CPU Z3735E @ 1.33GHz\0\0\0\0\0\0\0\0\0")); 328 EXPECT_EQ("Atom Z3735F", 329 normalize_brand_string("Intel(R) Atom(TM) CPU Z3735F @ 1.33GHz\0\0\0\0\0\0\0\0\0")); 330 EXPECT_EQ("Atom Z3735G", 331 normalize_brand_string("Intel(R) Atom(TM) CPU Z3735G @ 1.33GHz\0\0\0\0\0\0\0\0\0")); 332 EXPECT_EQ("Atom Z3736F", 333 normalize_brand_string("Intel(R) Atom(TM) CPU Z3736F @ 1.33GHz\0\0\0\0\0\0\0\0\0")); 334 EXPECT_EQ("Atom Z3736G", 335 normalize_brand_string("Intel(R) Atom(TM) CPU Z3736G @ 1.33GHz\0\0\0\0\0\0\0\0\0")); 336 EXPECT_EQ("Atom Z3745", 337 normalize_brand_string("Intel(R) Atom(TM) CPU Z3745 @ 1.33GHz\0\0\0\0\0\0\0\0\0")); 338 EXPECT_EQ("Atom x5-Z8300", 339 normalize_brand_string("Intel(R) Atom(TM) x5-Z8300 CPU @ 1.44GHz\0\0\0\0\0\0\0")); 340 EXPECT_EQ("Atom x5-Z8350", 341 normalize_brand_string("Intel(R) Atom(TM) x5-Z8350 CPU @ 1.44GHz\0\0\0\0\0\0\0")); 342 EXPECT_EQ("Atom x5-Z8500", 343 normalize_brand_string("Intel(R) Atom(TM) x5-Z8500 CPU @ 1.44GHz\0\0\0\0\0\0\0")); 344 EXPECT_EQ("Atom x5-Z8550", 345 normalize_brand_string("Intel(R) Atom(TM) x5-Z8550 CPU @ 1.44GHz\0\0\0\0\0\0\0")); 346 EXPECT_EQ("Atom x7-Z8700", 347 normalize_brand_string("Intel(R) Atom(TM) x7-Z8700 CPU @ 1.60GHz\0\0\0\0\0\0\0")); 348 EXPECT_EQ("Atom x7-Z8750", 349 normalize_brand_string("Intel(R) Atom(TM) x7-Z8750 CPU @ 1.60GHz\0\0\0\0\0\0\0")); 350 EXPECT_EQ("Celeron 847", 351 normalize_brand_string("Intel(R) Celeron(R) CPU 847 @ 1.10GHz\0\0\0\0\0\0\0\0\0\0\0")); 352 EXPECT_EQ("Celeron N3060", 353 normalize_brand_string("Intel(R) Celeron(R) CPU N3060 @ 1.60GHz\0\0\0\0\0\0\0")); 354 EXPECT_EQ("Celeron N3160", 355 normalize_brand_string("Intel(R) Celeron(R) CPU N3160 @ 1.60GHz\0\0\0\0\0\0\0")); 356 EXPECT_EQ("Core i3-2100", 357 normalize_brand_string("Intel(R) Core(TM) i3-2100 CPU @ 3.10GHz\0\0\0\0\0\0\0\0\0")); 358 EXPECT_EQ("Core i3-2120", 359 normalize_brand_string("Intel(R) Core(TM) i3-2120 CPU @ 3.30GHz\0\0\0\0\0\0\0\0\0")); 360 EXPECT_EQ("Core i3-3110M", 361 normalize_brand_string("Intel(R) Core(TM) i3-3110M CPU @ 2.40GHz\0\0\0\0\0\0\0\0")); 362 EXPECT_EQ("Core i3-3217U", 363 normalize_brand_string("Intel(R) Core(TM) i3-3217U CPU @ 1.80GHz\0\0\0\0\0\0\0\0")); 364 EXPECT_EQ("Core i3-3220", 365 normalize_brand_string("Intel(R) Core(TM) i3-3220 CPU @ 3.30GHz\0\0\0\0\0\0\0\0\0")); 366 EXPECT_EQ("Core i3-4005U", 367 normalize_brand_string("Intel(R) Core(TM) i3-4005U CPU @ 1.70GHz\0\0\0\0\0\0\0\0")); 368 EXPECT_EQ("Core i3-5005U", 369 normalize_brand_string("Intel(R) Core(TM) i3-5005U CPU @ 2.00GHz\0\0\0\0\0\0\0\0")); 370 EXPECT_EQ("Core i5-2467M", 371 normalize_brand_string("Intel(R) Core(TM) i5-2467M CPU @ 1.60GHz\0\0\0\0\0\0\0\0")); 372 EXPECT_EQ("Core i5-3210M", 373 normalize_brand_string("Intel(R) Core(TM) i5-3210M CPU @ 2.50GHz\0\0\0\0\0\0\0\0")); 374 EXPECT_EQ("Core i5-3230M", 375 normalize_brand_string("Intel(R) Core(TM) i5-3230M CPU @ 2.60GHz\0\0\0\0\0\0\0\0")); 376 EXPECT_EQ("Core i5-3470", 377 normalize_brand_string("Intel(R) Core(TM) i5-3470 CPU @ 3.20GHz\0\0\0\0\0\0\0\0\0")); 378 EXPECT_EQ("Core i5-4210U", 379 normalize_brand_string("Intel(R) Core(TM) i5-4210U CPU @ 1.70GHz\0\0\0\0\0\0\0\0")); 380 EXPECT_EQ("Core i5-4460", 381 normalize_brand_string("Intel(R) Core(TM) i5-4460 CPU @ 3.20GHz\0\0\0\0\0\0\0\0")); 382 EXPECT_EQ("Core i5-5200U", 383 normalize_brand_string("Intel(R) Core(TM) i5-5200U CPU @ 2.20GHz\0\0\0\0\0\0\0\0")); 384 EXPECT_EQ("Core i5-6200U", 385 normalize_brand_string("Intel(R) Core(TM) i5-6200U CPU @ 2.30GHz\0\0\0\0\0\0\0\0")); 386 EXPECT_EQ("Core i5-6400", 387 normalize_brand_string("Intel(R) Core(TM) i5-6400 CPU @ 2.70GHz\0\0\0\0\0\0\0\0\0")); 388 EXPECT_EQ("Core i7-4790", 389 normalize_brand_string("Intel(R) Core(TM) i7-4790 CPU @ 3.60GHz\0\0\0\0\0\0\0\0\0")); 390 } 391 392 TEST(BRAND_STRING, amd) { 393 EXPECT_EQ("", 394 normalize_brand_string("AMD Processor model unknown\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0")); 395 EXPECT_EQ("", 396 normalize_brand_string("AMD Engineering Sample\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0")); 397 EXPECT_EQ("A10-4600M", 398 normalize_brand_string("AMD A10-4600M APU with Radeon(tm) HD Graphics \0")); 399 EXPECT_EQ("A10-5800K", 400 normalize_brand_string("AMD A10-5800K APU with Radeon(tm) HD Graphics \0")); 401 EXPECT_EQ("A10-6800K", 402 normalize_brand_string("AMD A10-6800K APU with Radeon(tm) HD Graphics \0")); 403 EXPECT_EQ("A10-7850K", 404 normalize_brand_string("AMD A10-7850K APU with Radeon(TM) R7 Graphics \0")); 405 EXPECT_EQ("A12-9700P", 406 normalize_brand_string("AMD A12-9700P RADEON R7, 10 COMPUTE CORES 4C+6G\0")); 407 EXPECT_EQ("A12-9800", 408 normalize_brand_string("AMD A12-9800 RADEON R7, 12 COMPUTE CORES 4C+8G \0")); 409 EXPECT_EQ("A4-5000", 410 normalize_brand_string("AMD A4-5000 APU with Radeon(TM) HD Graphics \0")); 411 EXPECT_EQ("A6-6310", 412 normalize_brand_string("AMD A6-6310 APU with AMD Radeon R4 Graphics \0")); 413 EXPECT_EQ("A8-3850", 414 normalize_brand_string("AMD A8-3850 APU with Radeon(tm) HD Graphics\0\0\0\0\0")); 415 EXPECT_EQ("A8-6410", 416 normalize_brand_string("AMD A8-6410 APU with AMD Radeon R5 Graphics \0")); 417 EXPECT_EQ("A8-7670K", 418 normalize_brand_string("AMD A8-7670K Radeon R7, 10 Compute Cores 4C+6G \0")); 419 EXPECT_EQ("A9-9410", 420 normalize_brand_string("AMD A9-9410 RADEON R5, 5 COMPUTE CORES 2C+3G \0")); 421 EXPECT_EQ("Athlon", 422 normalize_brand_string("AMD Athlon(tm) Processor\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0")); 423 EXPECT_EQ("Athlon 5350", 424 normalize_brand_string("AMD Athlon(tm) 5350 APU with Radeon(tm) R3 \0")); 425 EXPECT_EQ("Athlon 64 2800+", 426 normalize_brand_string("AMD Athlon(tm) 64 Processor 2800+\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0")); 427 EXPECT_EQ("Athlon 64 3200+", 428 normalize_brand_string("AMD Athlon(tm) 64 Processor 3200+\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0")); 429 EXPECT_EQ("Athlon 64 X2 3800+", 430 normalize_brand_string("AMD Athlon(tm) 64 X2 Dual Core Processor 3800+\0\0")); 431 EXPECT_EQ("Athlon 64 X2 4000+", 432 normalize_brand_string("AMD Athlon(tm) 64 X2 Dual Core Processor 4000+\0\0")); 433 EXPECT_EQ("Athlon 64 X2 6000+", 434 normalize_brand_string("AMD Athlon(tm) 64 X2 Dual Core Processor 6000+\0\0")); 435 EXPECT_EQ("Athlon 64 X2 6400+", 436 normalize_brand_string("AMD Athlon(tm) 64 X2 Dual Core Processor 6400+\0\0")); 437 EXPECT_EQ("Athlon 7750", 438 normalize_brand_string("AMD Athlon(tm) 7750 Dual-Core Processor\0\0\0\0\0\0\0\0\0")); 439 EXPECT_EQ("Athlon II X2 245", 440 normalize_brand_string("AMD Athlon(tm) II X2 245 Processor\0\0\0\0\0\0\0\0\0\0\0\0\0\0")); 441 EXPECT_EQ("Athlon II X4 620", 442 normalize_brand_string("AMD Athlon(tm) II X4 620 Processor\0\0\0\0\0\0\0\0\0\0\0\0\0\0")); 443 EXPECT_EQ("Athlon XP", 444 normalize_brand_string("Athlon XP (Palomin?00+\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0")); 445 EXPECT_EQ("Athlon XP 2200+", 446 normalize_brand_string("AMD Athlon(tm) XP 2200+\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0")); 447 EXPECT_EQ("Athlon XP 3200+", 448 normalize_brand_string("AMD Athlon(tm) XP 3200+\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0")); 449 EXPECT_EQ("C-50", 450 normalize_brand_string("AMD C-50 Processor\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0")); 451 EXPECT_EQ("Duron", 452 normalize_brand_string("AMD Duron(tm) processor\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0")); 453 EXPECT_EQ("E-350", 454 normalize_brand_string("AMD E-350 Processor\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0")); 455 EXPECT_EQ("E-450", 456 normalize_brand_string("AMD E-450 APU with Radeon(tm) HD Graphics\0\0\0\0\0\0\0")); 457 EXPECT_EQ("E2-3000M", 458 normalize_brand_string("AMD E2-3000M APU with Radeon(tm) HD Graphics\0\0\0\0")); 459 EXPECT_EQ("FX-6100", 460 normalize_brand_string("AMD FX(tm)-6100 Six-Core Processor \0")); 461 EXPECT_EQ("FX-8150", 462 normalize_brand_string("AMD FX(tm)-8150 Eight-Core Processor \0")); 463 EXPECT_EQ("FX-8350", 464 normalize_brand_string("AMD FX(tm)-8350 Eight-Core Processor \0")); 465 EXPECT_EQ("FX-8800P", 466 normalize_brand_string("AMD FX-8800P Radeon R7, 12 Compute Cores 4C+8G \0")); 467 EXPECT_EQ("G-T56N", 468 normalize_brand_string("AMD G-T56N Processor\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0")); 469 EXPECT_EQ("GX-212JC", 470 normalize_brand_string("AMD GX-212JC SOC with Radeon(TM) R2E Graphics \0")); 471 EXPECT_EQ("Geode", 472 normalize_brand_string("Geode(TM) Integrated Processor by AMD PCS\0\0\0\0\0\0\0")); 473 EXPECT_EQ("K5", 474 normalize_brand_string("AMD-K5(tm) Processor\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0")); 475 EXPECT_EQ("K6", 476 normalize_brand_string("AMD-K6tm w/ multimedia extensions\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0")); 477 EXPECT_EQ("K6 3D", 478 normalize_brand_string("AMD-K6(tm) 3D processor\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0")); 479 EXPECT_EQ("K6 3D+", 480 normalize_brand_string("AMD-K6(tm) 3D+ Processor\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0")); 481 EXPECT_EQ("K6-III", 482 normalize_brand_string("AMD-K6(tm)-III Processor\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0")); 483 EXPECT_EQ("K7", 484 normalize_brand_string("AMD-K7(tm) Processor\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0")); 485 EXPECT_EQ("Opteron 2210 HE", 486 normalize_brand_string("Dual-Core AMD Opteron(tm) Processor 2210 HE\0\0\0\0\0")); 487 EXPECT_EQ("Opteron 2344 HE", 488 normalize_brand_string("Quad-Core AMD Opteron(tm) Processor 2344 HE\0\0\0\0\0")); 489 EXPECT_EQ("Opteron 2347 HE", 490 normalize_brand_string("Quad-Core AMD Opteron(tm) Processor 2347 HE\0\0\0\0\0")); 491 EXPECT_EQ("Opteron 2378", 492 normalize_brand_string("Quad-Core AMD Opteron(tm) Processor 2378\0\0\0\0\0\0\0\0")); 493 EXPECT_EQ("Opteron 240 HE", 494 normalize_brand_string("AMD Opteron(tm) Processor 240 HE\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0")); 495 EXPECT_EQ("Opteron 2431", 496 normalize_brand_string("Six-Core AMD Opteron(tm) Processor 2431\0\0\0\0\0\0\0\0\0")); 497 EXPECT_EQ("Opteron 248", 498 normalize_brand_string("AMD Opteron(tm) Processor 248\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0")); 499 EXPECT_EQ("Opteron 4176 HE", 500 normalize_brand_string("AMD Opteron(tm) Processor 4176 HE\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0")); 501 EXPECT_EQ("Opteron 6180 SE", 502 normalize_brand_string("AMD Opteron(tm) Processor 6180 SE\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0")); 503 EXPECT_EQ("Opteron 6274", 504 normalize_brand_string("AMD Opteron(TM) Processor 6274 \0")); 505 EXPECT_EQ("Opteron 8220 SE", 506 normalize_brand_string("Dual-Core AMD Opteron(tm) Processor 8220 SE\0\0\0\0\0")); 507 EXPECT_EQ("Phenom 9500", 508 normalize_brand_string("AMD Phenom(tm) 9500 Quad-Core Processor\0\0\0\0\0\0\0\0\0")); 509 EXPECT_EQ("Phenom II 42 TWKR Black Edition", 510 normalize_brand_string("AMD Phenom(tm) II 42 TWKR Black Edition\0\0\0\0\0\0\0\0\0")); 511 EXPECT_EQ("Phenom II X2 550", 512 normalize_brand_string("AMD Phenom(tm) II X2 550 Processor\0\0\0\0\0\0\0\0\0\0\0\0\0\0")); 513 EXPECT_EQ("Phenom II X4 940", 514 normalize_brand_string("AMD Phenom(tm) II X4 940 Processor\0\0\0\0\0\0\0\0\0\0\0\0\0\0")); 515 EXPECT_EQ("Phenom II X4 955", 516 normalize_brand_string("AMD Phenom(tm) II X4 955 Processor\0\0\0\0\0\0\0\0\0\0\0\0\0\0")); 517 EXPECT_EQ("Phenom II X4 965", 518 normalize_brand_string("AMD Phenom(tm) II X4 965 Processor\0\0\0\0\0\0\0\0\0\0\0\0\0\0")); 519 EXPECT_EQ("Phenom II X6 1055T", 520 normalize_brand_string("AMD Phenom(tm) II X6 1055T Processor\0\0\0\0\0\0\0\0\0\0\0\0")); 521 EXPECT_EQ("Ryzen 5 1500X", 522 normalize_brand_string("AMD Ryzen 5 1500X Quad-Core Processor \0")); 523 EXPECT_EQ("Ryzen 7 1700X", 524 normalize_brand_string("AMD Ryzen 7 1700X Eight-Core Processor \0")); 525 EXPECT_EQ("Ryzen 7 1800X", 526 normalize_brand_string("AMD Ryzen 7 1800X Eight-Core Processor \0")); 527 EXPECT_EQ("Ryzen Threadripper 1950X", 528 normalize_brand_string("AMD Ryzen Threadripper 1950X 16-Core Processor \0")); 529 EXPECT_EQ("Sempron 140", 530 normalize_brand_string("AMD Sempron(tm) 140 Processor\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0")); 531 EXPECT_EQ("Sempron 2600+", 532 normalize_brand_string("AMD Sempron(tm) Processor 2600+\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0")); 533 EXPECT_EQ("Sempron 2800+", 534 normalize_brand_string("AMD Sempron(tm) Processor 2800+\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0")); 535 EXPECT_EQ("Sempron 3000+", 536 normalize_brand_string("AMD Sempron(tm) Processor 3000+\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0")); 537 EXPECT_EQ("Turion RM-70", 538 normalize_brand_string("AMD Turion Dual-Core RM-70\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0")); 539 EXPECT_EQ("Turion X2 Ultra ZM-82", 540 normalize_brand_string("AMD Turion(tm) X2 Ultra Dual-Core Mobile ZM-82\0\0")); 541 } 542 543 TEST(BRAND_STRING, via) { 544 EXPECT_EQ("C3 Ezra", 545 normalize_brand_string("VIA C3 Ezra\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0")); 546 EXPECT_EQ("C7-M 1200MHz", 547 normalize_brand_string(" VIA C7-M Processor 1200MHz\0")); 548 EXPECT_EQ("CNA 1800MHz", 549 normalize_brand_string(" VIA CNA processor 1800MHz ")); 550 EXPECT_EQ("CNA 2667MHz", 551 normalize_brand_string(" VIA CNA processor 2667MHz ")); 552 EXPECT_EQ("Eden X4 C4250", 553 normalize_brand_string(" VIA Eden X4 C4250@1.2+GHz\0")); 554 EXPECT_EQ("Esther 1500MHz", 555 normalize_brand_string(" VIA Esther processor 1500MHz\0")); 556 EXPECT_EQ("Ezra", 557 normalize_brand_string("VIA Ezra\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0")); 558 EXPECT_EQ("L4700", 559 normalize_brand_string(" VIA QuadCore L4700 @ 1.2+ GHz\0")); 560 EXPECT_EQ("Nano 1800MHz", 561 normalize_brand_string(" VIA Nano processor @1800MHz\0")); 562 EXPECT_EQ("Nano L2200", 563 normalize_brand_string(" VIA Nano processor L2200@1600MHz\0")); 564 EXPECT_EQ("Nano L3050", 565 normalize_brand_string(" VIA Nano L3050@1800MHz\0")); 566 EXPECT_EQ("Nehemiah", 567 normalize_brand_string("VIA Nehemiah\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0")); 568 EXPECT_EQ("Samuel", 569 normalize_brand_string("VIA Samuel\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0")); 570 EXPECT_EQ("Samuel 2", 571 normalize_brand_string("VIA Samuel 2\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0")); 572 EXPECT_EQ("Samuel M", 573 normalize_brand_string("VIA Samuel\0\0M\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0")); 574 } 575 576 TEST(BRAND_STRING, transmeta) { 577 EXPECT_EQ("Crusoe TM5800", 578 normalize_brand_string("Transmeta(tm) Crusoe(tm) Processor TM5800\0\0\0\0\0\0\0")); 579 EXPECT_EQ("Efficeon TM8000", 580 normalize_brand_string("Transmeta Efficeon(tm) Processor TM8000\0\0\0\0\0\0\0\0\0")); 581 } 582 583 TEST(BRAND_STRING, other) { 584 EXPECT_EQ("", 585 normalize_brand_string("\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0")); 586 EXPECT_EQ("", 587 normalize_brand_string("Quad-Core Processor (up to 1.4GHz) \0")); 588 EXPECT_EQ("Geode", 589 normalize_brand_string("Geode(TM) Integrated Processor by National Semi\0")); 590 EXPECT_EQ("MediaGX", 591 normalize_brand_string("Cyrix MediaGXtm MMXtm Enhanced\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0")); 592 EXPECT_EQ("WinChip 2-3D", 593 normalize_brand_string("IDT WinChip 2-3D\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0")); 594 } 595