<!--#
Test type 1: JSON serialization
TechEmpower Web Framework Benchmarks
-->
<!--#declaration
#ifdef AS_cpoll_cppsp_DO
#undef AS_cpoll_cppsp_DO
#endif
#ifdef AS_cpoll_cppsp_DO
#  include <json/json.h>
#else
static UString* pkey;
static UString* pvalue;
#endif

static void usp_init_json()
{
   U_TRACE(5, "::usp_init_json()")

#ifndef AS_cpoll_cppsp_DO
   U_NEW(UString, pkey,   U_STRING_FROM_CONSTANT("message"));
   U_NEW(UString, pvalue, U_STRING_FROM_CONSTANT("Hello, World!"));
#endif
}

#ifdef DEBUG
static void usp_end_json()
{
   U_TRACE(5, "::usp_end_json()")

#ifndef AS_cpoll_cppsp_DO
   delete pkey;
   delete pvalue;
#endif
}
#endif
-->
<!--#header
Content-Type: application/json
-->
<!--#code
#ifndef AS_cpoll_cppsp_DO
UValue::stringify(*UClientImage_Base::wbuffer, UValue(*pkey, *pvalue));
#else
json_object* hello = json_object_new_object();
json_object_object_add(hello, "message", json_object_new_string("Hello, World!"));
const char* hello_str = json_object_to_json_string(hello);
USP_PUTS_STRING(hello_str);
json_object_put(hello);
#endif
-->
