projects
/
m6w6
/
libmemcached
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
|
github
raw
|
patch
|
inline
| side by side (parent:
ab40ca3
)
Added simple exception test to the C++ test case file.
author
Padraig O'Sullivan
<osullivan.padraig@gmail.com>
Wed, 5 Aug 2009 02:21:41 +0000
(22:21 -0400)
committer
Padraig O'Sullivan
<osullivan.padraig@gmail.com>
Wed, 5 Aug 2009 02:21:41 +0000
(22:21 -0400)
tests/plus.cpp
patch
|
blob
|
history
diff --git
a/tests/plus.cpp
b/tests/plus.cpp
index 6b43164433cfeafa8741918b66af8d02e3d3ee5d..7ede21564c93d00eb07c7ce2fec097a8a5ed258a 100644
(file)
--- a/
tests/plus.cpp
+++ b/
tests/plus.cpp
@@
-17,6
+17,7
@@
#include "test.h"
#include <string>
#include "test.h"
#include <string>
+#include <iostream>
using namespace std;
using namespace memcache;
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));
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)
}
test_return increment_test(memcached_st *memc)