Blame tests/test2.c

Packit Service def718
#include <stdio.h>
Packit Service def718
#include <stdlib.h>
Packit Service def718
#include <stddef.h>
Packit Service def718
#include <string.h>
Packit Service def718
Packit Service def718
#include "json.h"
Packit Service def718
#include "parse_flags.h"
Packit Service def718
Packit Service def718
#ifdef TEST_FORMATTED
Packit Service def718
#define json_object_to_json_string(obj) json_object_to_json_string_ext(obj,sflags)
Packit Service def718
#else
Packit Service def718
/* no special define */
Packit Service def718
#endif
Packit Service def718
Packit Service def718
Packit Service def718
int main(int argc, char **argv)
Packit Service def718
{
Packit Service def718
	json_object *new_obj;
Packit Service def718
#ifdef TEST_FORMATTED
Packit Service def718
	int sflags = 0;
Packit Service def718
#endif
Packit Service def718
Packit Service def718
	MC_SET_DEBUG(1);
Packit Service def718
Packit Service def718
#ifdef TEST_FORMATTED
Packit Service def718
	sflags = parse_flags(argc, argv);
Packit Service def718
#endif
Packit Service def718
Packit Service def718
	new_obj = json_tokener_parse("/* more difficult test case */"
Packit Service def718
				     "{ \"glossary\": { \"title\": \"example glossary\", \"GlossDiv\": { \"title\": \"S\", \"GlossList\": [ { \"ID\": \"SGML\", \"SortAs\": \"SGML\", \"GlossTerm\": \"Standard Generalized Markup Language\", \"Acronym\": \"SGML\", \"Abbrev\": \"ISO 8879:1986\", \"GlossDef\": \"A meta-markup language, used to create markup languages such as DocBook.\", \"GlossSeeAlso\": [\"GML\", \"XML\", \"markup\"] } ] } } }");
Packit Service def718
	printf("new_obj.to_string()=%s\n", json_object_to_json_string(new_obj));
Packit Service def718
	json_object_put(new_obj);
Packit Service def718
Packit Service def718
	return EXIT_SUCCESS;
Packit Service def718
}