X-Git-Url: https://git.m6w6.name/?a=blobdiff_plain;f=tests%2Fplus.cpp;h=7ede21564c93d00eb07c7ce2fec097a8a5ed258a;hb=dcd5061e6bc6e591ad9986e9360a4657f8dbf7f1;hp=b8bd89a18eda7536c51dd200907214a723d93b93;hpb=76869574486dceca688e05b7028d8b88485a36a0;p=awesomized%2Flibmemcached diff --git a/tests/plus.cpp b/tests/plus.cpp index b8bd89a1..7ede2156 100644 --- a/tests/plus.cpp +++ b/tests/plus.cpp @@ -1,7 +1,7 @@ /* C++ interface test */ -#include "libmemcached/memcached.h" +#include "libmemcached/memcached.hpp" #include #include @@ -17,6 +17,7 @@ #include "test.h" #include +#include using namespace std; using namespace memcache; @@ -63,7 +64,20 @@ test_return basic_test(memcached_st *memc) assert((memcmp(&test_value[0], &value[0], test_value.size()) == 0)); - return TEST_SUCCESS; + /* + * Simple test of the exceptions here...this should throw an exception + * saying that the key is empty. + */ + try + { + foo.set("", value, 0, 0); + } + catch (Error &err) + { + return TEST_SUCCESS; + } + + return TEST_FAILURE; } test_return increment_test(memcached_st *memc)