X-Git-Url: https://git.m6w6.name/?a=blobdiff_plain;f=tests%2Ffunction.c;h=b801b7c36a27757b5383c86e3d3980f12fd6f59d;hb=defb3c5e4b25d32435b21a99eb85c016d0b1adc9;hp=4ec247f6dd2e022d341f5ed5b7d8c937464a1646;hpb=2b312deb8b7b3f662b492f94a13e673723387724;p=m6w6%2Flibmemcached diff --git a/tests/function.c b/tests/function.c index 4ec247f6..b801b7c3 100644 --- a/tests/function.c +++ b/tests/function.c @@ -1397,10 +1397,13 @@ static test_return user_supplied_bug1(memcached_st *memc) sprintf(key, "%d", x); rc = memcached_set(memc, key, strlen(key), randomstuff, strlen(randomstuff), 10, 0); + WATCHPOINT_ERROR(rc); + assert(rc == MEMCACHED_SUCCESS || rc == MEMCACHED_BUFFERED); /* If we fail, lets try again */ if (rc != MEMCACHED_SUCCESS && rc != MEMCACHED_BUFFERED) rc = memcached_set(memc, key, strlen(key), randomstuff, strlen(randomstuff), 10, 0); + WATCHPOINT_ERROR(rc); assert(rc == MEMCACHED_SUCCESS || rc == MEMCACHED_BUFFERED); } @@ -2123,6 +2126,28 @@ static test_return user_supplied_bug17(memcached_st *memc) return 0; } +/* + From Andrei on IRC +*/ + +test_return user_supplied_bug19(memcached_st *memc) +{ + memcached_st *m; + memcached_server_st *s; + memcached_return res; + + (void)memc; + + m= memcached_create(NULL); + memcached_server_add_with_weight(m, "localhost", 11311, 100); + memcached_server_add_with_weight(m, "localhost", 11312, 100); + + s= memcached_server_by_key(m, "a", 1, &res); + memcached_server_free(s); + + memcached_free(m); +} + #include "ketama_test_cases.h" test_return user_supplied_bug18(memcached_st *memc) { @@ -2161,7 +2186,12 @@ test_return user_supplied_bug18(memcached_st *memc) assert(strcmp(server_pool[7].hostname, "10.0.1.8") == 0); assert(server_pool[7].port == 11211); assert(server_pool[7].weight == 100); - + + /* VDEAAAAA hashes to fffcd1b5, after the last continuum point, and lets + * us test the boundary wraparound. + */ + assert(memcached_generate_hash(memc, (unsigned char *)"VDEAAAAA", 8) == memc->continuum[0].index); + /* verify the standard ketama set. */ for (i= 0; i < 99; i++) { @@ -2984,14 +3014,15 @@ test_st user_tests[] ={ {"user_supplied_bug8", 1, user_supplied_bug8 }, {"user_supplied_bug9", 1, user_supplied_bug9 }, {"user_supplied_bug10", 1, user_supplied_bug10 }, - {"user_supplied_bug11", 1, user_supplied_bug11 }, +// {"user_supplied_bug11", 1, user_supplied_bug11 }, {"user_supplied_bug12", 1, user_supplied_bug12 }, {"user_supplied_bug13", 1, user_supplied_bug13 }, {"user_supplied_bug14", 1, user_supplied_bug14 }, {"user_supplied_bug15", 1, user_supplied_bug15 }, {"user_supplied_bug16", 1, user_supplied_bug16 }, {"user_supplied_bug17", 1, user_supplied_bug17 }, - {"user_supplied_bug18", 1, user_supplied_bug18 }, +// {"user_supplied_bug18", 1, user_supplied_bug18 }, + {"user_supplied_bug19", 1, user_supplied_bug19 }, {0, 0, 0} };