summaryrefslogtreecommitdiff
path: root/json-c/src/tests/test_locale.c
diff options
context:
space:
mode:
authorMichał Cichoń <michcic@gmail.com>2015-08-25 19:56:24 +0200
committerMichał Cichoń <michcic@gmail.com>2015-08-25 19:56:24 +0200
commit682f23e7bb4a52bedf46eff5c4859e1308eda124 (patch)
tree30ad4f37b434ecdfb5edc36dfbaf7fc924e53c0e /json-c/src/tests/test_locale.c
parent8b41fc907bcd27d24c895062ae8a61b305fc2d46 (diff)
downloadpianobar-windows-build-682f23e7bb4a52bedf46eff5c4859e1308eda124.tar.gz
pianobar-windows-build-682f23e7bb4a52bedf46eff5c4859e1308eda124.tar.bz2
pianobar-windows-build-682f23e7bb4a52bedf46eff5c4859e1308eda124.zip
Update build ref
Diffstat (limited to 'json-c/src/tests/test_locale.c')
-rw-r--r--json-c/src/tests/test_locale.c31
1 files changed, 31 insertions, 0 deletions
diff --git a/json-c/src/tests/test_locale.c b/json-c/src/tests/test_locale.c
new file mode 100644
index 0000000..7924bca
--- /dev/null
+++ b/json-c/src/tests/test_locale.c
@@ -0,0 +1,31 @@
+#include <stdio.h>
+#include <stdlib.h>
+#include <stddef.h>
+#include <string.h>
+#include <assert.h>
+
+#include "config.h"
+#include "json.h"
+#include "json_tokener.h"
+
+#ifdef HAVE_LOCALE_H
+#include <locale.h>
+#endif /* HAVE_LOCALE_H */
+
+int main(int argc, char **argv)
+{
+ json_object *new_obj;
+#ifdef HAVE_SETLOCALE
+ setlocale(LC_NUMERIC, "de_DE");
+#else
+ printf("No locale\n");
+#endif
+
+ MC_SET_DEBUG(1);
+
+ new_obj = json_tokener_parse("[1.2,3.4,123456.78,5.0,2.3e10]");
+ printf("new_obj.to_string()=%s\n", json_object_to_json_string(new_obj));
+ printf("new_obj.to_string()=%s\n", json_object_to_json_string_ext(new_obj,JSON_C_TO_STRING_NOZERO));
+ json_object_put(new_obj);
+}
+