summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorllooyd <llooyd@e775cfb5-b74b-0410-aad5-5bebe4a96390>2008-04-25 20:30:07 +0000
committerllooyd <llooyd@e775cfb5-b74b-0410-aad5-5bebe4a96390>2008-04-25 20:30:07 +0000
commit8c004284cf747a1dcf5045e649da882aad268f2d (patch)
tree3e50349f536298a7d6f1913b8268480f4260b8ed /test
parent1e31767de1fd86bde641030b3e8a1157fff04f89 (diff)
downloadyajl-8c004284cf747a1dcf5045e649da882aad268f2d.tar.gz
introduction of yajl_number callback to allow clients to handle arbitrary
precision numbers in JSON data. git-svn-id: http://yajl-c.googlecode.com/svn/trunk@102 e775cfb5-b74b-0410-aad5-5bebe4a96390
Diffstat (limited to 'test')
-rw-r--r--test/cases/integers.json3
-rw-r--r--test/cases/integers.json.gold6
-rw-r--r--test/yajl_test.c5
3 files changed, 8 insertions, 6 deletions
diff --git a/test/cases/integers.json b/test/cases/integers.json
index ca1393a..a4bbd7a 100644
--- a/test/cases/integers.json
+++ b/test/cases/integers.json
@@ -1,3 +1,4 @@
[ 1,2,3,4,5,6,7,
123456789 , -123456789,
- 9223372036854775807, -9223372036854775807 ]
+ 2147483647, -2147483647,
+ 2147483648 ]
diff --git a/test/cases/integers.json.gold b/test/cases/integers.json.gold
index f44b283..7341a2d 100644
--- a/test/cases/integers.json.gold
+++ b/test/cases/integers.json.gold
@@ -8,6 +8,6 @@ integer: 6
integer: 7
integer: 123456789
integer: -123456789
-integer: 9223372036854775807
-integer: -9223372036854775807
-array close ']'
+integer: 2147483647
+integer: -2147483647
+parse error: integer overflow
diff --git a/test/yajl_test.c b/test/yajl_test.c
index a98b906..667f822 100644
--- a/test/yajl_test.c
+++ b/test/yajl_test.c
@@ -51,9 +51,9 @@ int test_yajl_boolean(void * ctx, int boolVal)
return 1;
}
-int test_yajl_integer(void *ctx, long long integerVal)
+int test_yajl_integer(void *ctx, long integerVal)
{
- printf("integer: %lld\n", integerVal);
+ printf("integer: %ld\n", integerVal);
return 1;
}
@@ -113,6 +113,7 @@ static yajl_callbacks callbacks = {
test_yajl_boolean,
test_yajl_integer,
test_yajl_double,
+ NULL,
test_yajl_string,
test_yajl_start_map,
test_yajl_map_key,