test_sdoJSONLoad_jsonarraytest2.c
#include "SDO.h"
#include "assert.h"
// Wrapping the array into an additional JSON object OTOH
// works just fine; when the implementation's behaviour to
// add soap:encoding array attribute to the element is enabled,
// however, this will crash on shudown (but we
// disable/remove it for pmsca anyway)
void test_sdoJSONLoad_jsonarraytest2() {
SDOFACTORY df = getDataFactory();
SDOJSON jsonhlp = getJSONHelper(df);
SDOJSONDOC doc = JSONDocAlloc(jsonhlp, 0, 0, "tmp");
assert(sdoJSONLoad(doc, "{ \"test\": { \"wrapper\": [ \"a\", \"b\", \"c\" ] } }"));
char buffer[100];
sdoSave(doc, buffer, 0, 0);
//fprintf(stderr, "testsdoJSONLoad_jsonarraytest2: buffer=%s\n", buffer);
assert(!strcmp("<test><wrapper><item>a</item><item>b</item><item>c</item></wrapper></test>", buffer));
}