120 auto zone = thread->zone();
121 auto const map =
new (zone)
141 intptr_t
first()
const {
return first_; }
142 intptr_t
second()
const {
return second_; }
145 return (first_ == other.first_) && (second_ == other.second_);
149 return (first_ != other.first_) || (second_ != other.second_);
167 EXPECT(it.Next() ==
nullptr);
193TEST_CASE(DirectChainedHashMapIteratorWithCollisionInLastBucket) {
194 intptr_t
values[] = {65, 325, 329, 73, 396, 207, 215, 93, 227, 39,
195 431, 112, 176, 313, 188, 317, 61, 127, 447};
204 auto it =
map.GetIterator();
205 for (
auto*
p = it.Next();
p !=
nullptr;
p = it.Next()) {
209 for (intptr_t v :
values) {
222 for (
bool is_visited : visited) {
228 auto zone = thread->zone();
230 const char*
const kConst1 =
"test";
231 const char*
const kConst2 =
"test 2";
233 char*
const str1 =
OS::SCreate(zone,
"%s", kConst1);
234 char*
const str2 =
OS::SCreate(zone,
"%s", kConst2);
235 char*
const str3 =
OS::SCreate(zone,
"%s", kConst1);
238 EXPECT_NE(str1, str3);
239 EXPECT_STREQ(str1, str3);
245 EXPECT_NOTNULL(
set->Lookup(str1));
246 EXPECT_NULLPTR(
set->Lookup(str2));
247 EXPECT_NOTNULL(
set->Lookup(str3));
250 EXPECT_NOTNULL(
set->Lookup(str1));
251 EXPECT_NOTNULL(
set->Lookup(str2));
252 EXPECT_NOTNULL(
set->Lookup(str3));
255 EXPECT_NULLPTR(
set->Lookup(str1));
256 EXPECT_NOTNULL(
set->Lookup(str2));
257 EXPECT_NULLPTR(
set->Lookup(str3));
265 const char*
const kConst1 =
"test";
266 const char*
const kConst2 =
"test 2";
268 char*
const str1 =
OS::SCreate(
nullptr,
"%s", kConst1);
269 char*
const str2 =
OS::SCreate(
nullptr,
"%s", kConst2);
270 char*
const str3 =
OS::SCreate(
nullptr,
"%s", kConst1);
273 EXPECT_NE(str1, str3);
274 EXPECT_STREQ(str1, str3);
276 const intptr_t i1 = 1;
277 const intptr_t i2 = 2;
282 map.Insert({str1, i1});
283 EXPECT_NOTNULL(
map.Lookup(str1));
284 EXPECT_EQ(i1,
map.LookupValue(str1));
285 EXPECT_NULLPTR(
map.Lookup(str2));
286 EXPECT_NOTNULL(
map.Lookup(str3));
287 EXPECT_EQ(i1,
map.LookupValue(str3));
289 map.Insert({str2, i2});
290 EXPECT_NOTNULL(
map.Lookup(str1));
291 EXPECT_EQ(i1,
map.LookupValue(str1));
292 EXPECT_NOTNULL(
map.Lookup(str2));
293 EXPECT_EQ(i2,
map.LookupValue(str2));
294 EXPECT_NOTNULL(
map.Lookup(str3));
295 EXPECT_EQ(i1,
map.LookupValue(str3));
298 EXPECT_NULLPTR(
map.Lookup(str1));
299 EXPECT_NOTNULL(
map.Lookup(str2));
300 EXPECT_EQ(i2,
map.LookupValue(str2));
301 EXPECT_NULLPTR(
map.Lookup(str3));
313 const char*
const kConst1 =
"test";
314 const char*
const kConst2 =
"test 2";
322 EXPECT_NE(str1, str3);
323 EXPECT_NE(str1, str4);
324 EXPECT_NE(str3, str4);
325 EXPECT_STREQ(str1, str3);
326 EXPECT_STREQ(str1, str4);
336 EXPECT_NOTNULL(
map.Lookup(str1));
337 EXPECT_EQ(p1.value,
map.LookupValue(str1));
338 EXPECT_NULLPTR(
map.Lookup(str2));
339 EXPECT_NOTNULL(
map.Lookup(str3));
340 EXPECT_EQ(p1.value,
map.LookupValue(str3));
341 EXPECT_NOTNULL(
map.Lookup(str4));
342 EXPECT_EQ(p1.value,
map.LookupValue(str4));
345 EXPECT_NOTNULL(
map.Lookup(str1));
346 EXPECT_EQ(p1.value,
map.LookupValue(str1));
347 EXPECT_NOTNULL(
map.Lookup(str2));
348 EXPECT_EQ(p2.value,
map.LookupValue(str2));
349 EXPECT_NOTNULL(
map.Lookup(str3));
350 EXPECT_EQ(p1.value,
map.LookupValue(str3));
351 EXPECT_NOTNULL(
map.Lookup(str4));
352 EXPECT_EQ(p1.value,
map.LookupValue(str4));
356 EXPECT_NOTNULL(
map.Lookup(str1));
357 EXPECT_EQ(p3.value,
map.LookupValue(str1));
358 EXPECT_NOTNULL(
map.Lookup(str2));
359 EXPECT_EQ(p2.value,
map.LookupValue(str2));
360 EXPECT_NOTNULL(
map.Lookup(str3));
361 EXPECT_EQ(p3.value,
map.LookupValue(str3));
362 EXPECT_NOTNULL(
map.Lookup(str4));
363 EXPECT_EQ(p3.value,
map.LookupValue(str4));
367 EXPECT_NULLPTR(
map.Lookup(str1));
368 EXPECT_NOTNULL(
map.Lookup(str2));
369 EXPECT_EQ(p2.value,
map.LookupValue(str2));
370 EXPECT_NULLPTR(
map.Lookup(str3));
371 EXPECT_NULLPTR(
map.Lookup(str4));
379 EXPECT_EQ(str1, p1.key);
380 EXPECT_EQ(1, p1.value);
381 EXPECT_EQ(str2, p2.key);
382 EXPECT_EQ(2, p2.value);
383 EXPECT_EQ(str3, p3.key);
384 EXPECT_EQ(3, p3.value);
KeyValueTrait::Value LookupValue(typename KeyValueTrait::Key key) const
bool operator!=(const IntptrPair &other)
bool operator==(const IntptrPair &other)
IntptrPair(intptr_t first, intptr_t second)
static char * SCreate(Zone *zone, const char *format,...) PRINTF_ATTRIBUTE(2
bool Equals(const TestValue &other)
TEST_CASE(DirectoryCurrent)
uint32_t FinalizeHash(uint32_t hash, intptr_t hashbits=kBitsPerInt32)
DEF_SWITCHES_START aot vmservice shared library Name of the *so containing AOT compiled Dart assets for launching the service isolate vm snapshot The VM snapshot data that will be memory mapped as read only SnapshotAssetPath must be present isolate snapshot The isolate snapshot data that will be memory mapped as read only SnapshotAssetPath must be present cache dir Path to the cache directory This is different from the persistent_cache_path in embedder which is used for Skia shader cache icu native lib Path to the library file that exports the ICU data vm service The hostname IP address on which the Dart VM Service should be served If not set
SI auto map(std::index_sequence< I... >, Fn &&fn, const Args &... args) -> skvx::Vec< sizeof...(I), decltype(fn(args[0]...))>
#define ARRAY_SIZE(array)