From: Padraig O'Sullivan Date: Wed, 5 Aug 2009 02:21:41 +0000 (-0400) Subject: Added simple exception test to the C++ test case file. X-Git-Tag: 0.34~13^2~15 X-Git-Url: https://git.m6w6.name/?a=commitdiff_plain;h=dc1236862e42640bc2d901b0e92bd66068168f4f;p=m6w6%2Flibmemcached Added simple exception test to the C++ test case file. --- diff --git a/tests/plus.cpp b/tests/plus.cpp index 6b431644..7ede2156 100644 --- a/tests/plus.cpp +++ b/tests/plus.cpp @@ -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)