From dc1236862e42640bc2d901b0e92bd66068168f4f Mon Sep 17 00:00:00 2001 From: Padraig O'Sullivan Date: Tue, 4 Aug 2009 22:21:41 -0400 Subject: [PATCH] Added simple exception test to the C++ test case file. --- tests/plus.cpp | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) 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) -- 2.30.2