Lines Matching defs:valid
355 int valid;
361 valid = hashmap_remove_and_put(m, "invalid key", "new key", NULL);
362 assert_se(valid == -ENOENT);
364 valid = hashmap_put(m, "key 1", (void*) (const char *) "val 1");
365 assert_se(valid == 1);
367 valid = hashmap_remove_and_put(NULL, "key 1", "key 2", (void*) (const char *) "val 2");
368 assert_se(valid == -ENOENT);
370 valid = hashmap_remove_and_put(m, "key 1", "key 2", (void*) (const char *) "val 2");
371 assert_se(valid == 0);
377 valid = hashmap_put(m, "key 3", (void*) (const char *) "val 3");
378 assert_se(valid == 1);
379 valid = hashmap_remove_and_put(m, "key 3", "key 2", (void*) (const char *) "val 2");
380 assert_se(valid == -EEXIST);
385 int valid;
395 valid = hashmap_remove_and_replace(m, key1, key2, NULL);
396 assert_se(valid == -ENOENT);
398 valid = hashmap_put(m, key1, key1);
399 assert_se(valid == 1);
401 valid = hashmap_remove_and_replace(NULL, key1, key2, key2);
402 assert_se(valid == -ENOENT);
404 valid = hashmap_remove_and_replace(m, key1, key2, key2);
405 assert_se(valid == 0);
411 valid = hashmap_put(m, key3, key3);
412 assert_se(valid == 1);
413 valid = hashmap_remove_and_replace(m, key3, key2, key2);
414 assert_se(valid == 0);
427 valid = hashmap_remove_and_replace(m, UINT_TO_PTR(10*i + 1),
430 assert_se(valid == 0);