X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=tests%2Ftest-json.c;h=43cb9faa28d909eb2459000a4661257f178407aa;hb=f5ca49d849c9526f7aabbca1a6d171d4132f7ea3;hp=24bc745354138cacd349f1bc60fd41cb94c5eb48;hpb=1600fa6853872e16130366351a2c14f6fa8b547c;p=sliver-openvswitch.git diff --git a/tests/test-json.c b/tests/test-json.c index 24bc74535..43cb9faa2 100644 --- a/tests/test-json.c +++ b/tests/test-json.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2009, 2010, 2013 Nicira, Inc. + * Copyright (c) 2009, 2010, 2014 Nicira, Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -24,7 +24,7 @@ #include #include "util.h" - +#include "ovstest.h" /* --pretty: If set, the JSON output is pretty-printed, instead of printed as * compactly as possible. */ static int pretty = 0; @@ -42,7 +42,6 @@ print_and_free_json(struct json *json) ok = false; } else { char *s = json_to_string(json, JSSF_SORT | (pretty ? JSSF_PRETTY : 0)); - ovs_assert(pretty || json_serialized_length(json) == strlen(s)); puts(s); free(s); ok = true; @@ -104,8 +103,8 @@ parse_multiple(FILE *stream) return ok; } -int -main(int argc, char *argv[]) +static void +test_json_main(int argc, char *argv[]) { const char *input_file; FILE *stream; @@ -155,5 +154,7 @@ main(int argc, char *argv[]) fclose(stream); - return !ok; + exit(!ok); } + +OVSTEST_REGISTER("test-json", test_json_main);