X-Git-Url: https://git.m6w6.name/?a=blobdiff_plain;f=tests%2Ffunction.c;h=fb2f4bca42cd7caff2c898f7988f6296172e2f9e;hb=b369db6ab57bc940618281a2be848542a406bb7c;hp=015fa49ca377353dd05fb17eaf040977f1efba74;hpb=948eeb667c78f158f769de8cc418e44e81048dc2;p=awesomized%2Flibmemcached diff --git a/tests/function.c b/tests/function.c index 015fa49c..fb2f4bca 100644 --- a/tests/function.c +++ b/tests/function.c @@ -2006,7 +2006,6 @@ test_return user_supplied_bug15(memcached_st *memc) /* Check the return sizes on FLAGS to make sure it stores 32bit unsigned values correctly */ test_return user_supplied_bug16(memcached_st *memc) { - uint32_t x; memcached_return rc; char *key= "mykey"; char *value; @@ -2523,6 +2522,20 @@ memcached_return set_prefix(memcached_st *memc) assert(rc == MEMCACHED_SUCCESS); assert(memcmp(value, key, 4) == 0); + /* Set to Zero, and then Set to something too large */ + { + char *long_key= "This is more then the allotted number of characters"; + rc= memcached_callback_set(memc, MEMCACHED_CALLBACK_PREFIX_KEY, NULL); + assert(rc == MEMCACHED_SUCCESS); + + value= memcached_callback_get(memc, MEMCACHED_CALLBACK_PREFIX_KEY, &rc); + assert(rc == MEMCACHED_FAILURE); + assert(value == NULL); + + rc= memcached_callback_set(memc, MEMCACHED_CALLBACK_PREFIX_KEY, long_key); + assert(rc == MEMCACHED_BAD_KEY_PROVIDED); + } + return MEMCACHED_SUCCESS; }