blob: 836b012740493739b9b03ccdd528db88a379bc37 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
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;
}
|