X-Git-Url: https://git.m6w6.name/?a=blobdiff_plain;f=tests%2Fparser.cc;h=5a8187552638b1d35b2c25311d2372ed3abb0e02;hb=16c2fe9cc04a3f15fe56d3be2f3be19a1d731fb2;hp=8119c82bcb8a1262b987a31b21fc802e4107d232;hpb=385cc099521ab79b8ecb289cd25c46d7cf3caa5c;p=m6w6%2Flibmemcached diff --git a/tests/parser.cc b/tests/parser.cc index 8119c82b..5a818755 100644 --- a/tests/parser.cc +++ b/tests/parser.cc @@ -347,3 +347,34 @@ test_return_t memcached_parse_file_options_test(memcached_st *junk) return TEST_SUCCESS; } + +test_return_t memcached_check_options_test(memcached_st *junk) +{ + (void)junk; + + memcached_return_t rc; + + rc= memcached_check_options(STRING_WITH_LEN("--server=localhost"), NULL, 0); + test_true(rc == MEMCACHED_SUCCESS); + + rc= memcached_check_options(STRING_WITH_LEN("--dude=localhost"), NULL, 0); + test_false(rc == MEMCACHED_SUCCESS); + test_true(rc == MEMCACHED_PARSE_ERROR); + + return TEST_SUCCESS; +} + +test_return_t memcached_create_with_options_test(memcached_st *junk) +{ + (void)junk; + + memcached_st *memc_ptr; + memc_ptr= memcached_create_with_options(STRING_WITH_LEN("--server=localhost")); + test_true(memc_ptr); + memcached_free(memc_ptr); + + memc_ptr= memcached_create_with_options(STRING_WITH_LEN("--dude=localhost")); + test_false(memc_ptr); + + return TEST_SUCCESS; +}