tests: Expand 'bundle with many ports' test.
[cascardo/ovs.git] / tests / test-bundle.c
index c7331eb..4f6eb0c 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (c) 2011, 2012, 2013 Nicira, Inc.
+/* Copyright (c) 2011, 2012, 2013, 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 "bundle.h"
-
 #include <math.h>
 #include <stdlib.h>
-
 #include "flow.h"
 #include "ofp-actions.h"
 #include "ofpbuf.h"
-
+#include "ovstest.h"
 #include "util.h"
 
 #define N_FLOWS  50000
@@ -78,7 +76,7 @@ parse_bundle_actions(char *actions)
         ovs_fatal(0, "%s", error);
     }
 
-    action = ofpbuf_data(&ofpacts);
+    action = ofpacts.data;
     bundle = ofpact_get_BUNDLE(xmemdup(action, action->len));
     ofpbuf_uninit(&ofpacts);
 
@@ -104,8 +102,8 @@ mask_str(uint8_t mask, size_t n_bits)
     return str;
 }
 
-int
-main(int argc, char *argv[])
+static void
+test_bundle_main(int argc, char *argv[])
 {
     bool ok = true;
     struct ofpact_bundle *bundle;
@@ -264,5 +262,7 @@ main(int argc, char *argv[])
 
     free(bundle);
     free(flows);
-    return ok ? 0 : 1;
+    exit(ok ? 0 : 1);
 }
+
+OVSTEST_REGISTER("test-bundle", test_bundle_main);