ovsdb-server: Fix a reference count leak bug
[cascardo/ovs.git] / tests / test-json.c
index c7c01c8..692013e 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2009, 2010 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.
  */
 
 #include <config.h>
-
+#undef NDEBUG
 #include "json.h"
-
 #include <ctype.h>
 #include <errno.h>
 #include <getopt.h>
 #include <stdio.h>
-
+#include "ovstest.h"
 #include "util.h"
 
 /* --pretty: If set, the JSON output is pretty-printed, instead of printed as
@@ -103,8 +102,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;
@@ -154,5 +153,7 @@ main(int argc, char *argv[])
 
     fclose(stream);
 
-    return !ok;
+    exit(!ok);
 }
+
+OVSTEST_REGISTER("test-json", test_json_main);