void test_memcached_increment(void) { uint64_t intval; grn_test_memcached_assert( memcached_increment_with_initial(memc, "incr", 4, 1, 30, 0, &intval)); gcut_assert_equal_uint64(30, intval); grn_test_memcached_assert( memcached_increment_with_initial(memc, "incr", 4, 3, 0, 0, &intval)); gcut_assert_equal_uint64(33, intval); fflush(stderr); }
void test_memcached_increment(void) { uint32_t flags; uint64_t intval; memcached_return rc; rc = memcached_increment_with_initial(memc, "incr", 4, 1, 30, 0, &intval); cut_assert_equal_int(MEMCACHED_SUCCESS, rc); cut_assert_true(intval == 30); rc = memcached_increment_with_initial(memc, "incr", 4, 3, 0, 0, &intval); cut_assert_equal_int(MEMCACHED_SUCCESS, rc); cut_assert_true(intval == 33); fflush(stderr); }
/* wrapper of set command */ static int memc_init_inc(memcached_st *memc, char *key, uint64_t offset, uint64_t initial, uint64_t *value) { memcached_return_t rc; rc = memcached_increment_with_initial(memc, key, key_len, offset, initial, (time_t) 0, value); if (rc != MEMCACHED_SUCCESS) { return 1; } return 0; }
void test_memcached_decrement(void) { uint64_t intval; grn_test_memcached_assert( memcached_increment_with_initial(memc, "decr", 4, 30, 99, 0, &intval)); gcut_assert_equal_uint64(99, intval); grn_test_memcached_assert( memcached_decrement_with_initial(memc, "decr", 4, 17, 0, 0, &intval)); gcut_assert_equal_uint64(82, intval); }
void test_memcached_decrement(void) { uint32_t flags; uint64_t intval; memcached_return rc; rc = memcached_increment_with_initial(memc, "decr", 4, 30, 99, 0, &intval); cut_assert_equal_int(MEMCACHED_SUCCESS, rc); cut_assert_true(intval == 99); rc = memcached_decrement_with_initial(memc, "decr", 4, 17, 0, 0, &intval); cut_assert_equal_int(MEMCACHED_SUCCESS, rc); cut_assert_true(intval == 82); }