X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=tests%2Ftest-json.c;h=43cb9faa28d909eb2459000a4661257f178407aa;hb=003ce655b7116d18c86a74c50391e54990346931;hp=28b0edf19e0088a3d8a907aa9da942ef9bb8fb0e;hpb=5562d6f55e762ea6783a9f6032e85ccb2824773f;p=sliver-openvswitch.git diff --git a/tests/test-json.c b/tests/test-json.c index 28b0edf19..43cb9faa2 100644 --- a/tests/test-json.c +++ b/tests/test-json.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2009 Nicira Networks. + * 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; @@ -103,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; @@ -152,5 +152,9 @@ main(int argc, char *argv[]) ok = print_and_free_json(json_from_stream(stream)); } - return !ok; + fclose(stream); + + exit(!ok); } + +OVSTEST_REGISTER("test-json", test_json_main);