summaryrefslogtreecommitdiff
path: root/internal_tests.c
diff options
context:
space:
mode:
Diffstat (limited to 'internal_tests.c')
-rw-r--r--internal_tests.c22
1 files changed, 22 insertions, 0 deletions
diff --git a/internal_tests.c b/internal_tests.c
new file mode 100644
index 0000000..836b012
--- /dev/null
+++ b/internal_tests.c
@@ -0,0 +1,22 @@
+/* -*- Mode: C; tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*- */
+
+#include <assert.h>
+#include <stdio.h>
+#include <stdlib.h>
+
+#include "memcached.h"
+
+int main(int argc, char **argv) {
+ unsigned long long ull;
+ assert(safe_strtoull("123", &ull));
+ assert(ull == 123);
+
+ // Empty:
+ assert(!safe_strtoull("", &ull));
+
+ // Bogus:
+ assert(!safe_strtoull("123BOGUS", &ull));
+
+ printf("OK.\n");
+ return 0;
+}