X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=tests%2Ftest-classifier.c;h=3518db0e66a9dcc267f837c631da4af601568814;hb=003ce655b7116d18c86a74c50391e54990346931;hp=4282fd4b5c34b624195babf58e9594aca15bc11e;hpb=06f81620436881449cb9a2db4f875aa00803f28d;p=sliver-openvswitch.git diff --git a/tests/test-classifier.c b/tests/test-classifier.c index 4282fd4b5..3518db0e6 100644 --- a/tests/test-classifier.c +++ b/tests/test-classifier.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2009, 2010, 2011, 2012, 2013 Nicira, Inc. + * Copyright (c) 2009, 2010, 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. @@ -36,7 +36,7 @@ #include "packets.h" #include "random.h" #include "unaligned.h" - +#include "ovstest.h" #undef NDEBUG #include @@ -1203,7 +1203,7 @@ test_miniflow(int argc OVS_UNUSED, char *argv[] OVS_UNUSED) /* Check that the flow equals its miniflow. */ assert(miniflow_get_vid(&miniflow) == vlan_tci_to_vid(flow.vlan_tci)); for (i = 0; i < FLOW_U32S; i++) { - assert(miniflow_get(&miniflow, i) == flow_u32[i]); + assert(miniflow_get_u32(&miniflow, i * 4) == flow_u32[i]); } /* Check that the miniflow equals itself. */ @@ -1340,17 +1340,18 @@ static const struct command commands[] = { /* Miniflow and minimask tests. */ {"miniflow", 0, 0, test_miniflow}, - {"minimask_has_extra", 0, 0, test_minimask_has_extra}, - {"minimask_combine", 0, 0, test_minimask_combine}, + {"minimask_has_extra", 0, 0, test_minimask_has_extra}, + {"minimask_combine", 0, 0, test_minimask_combine}, {NULL, 0, 0, NULL}, }; -int -main(int argc, char *argv[]) +static void +test_classifier_main(int argc, char *argv[]) { set_program_name(argv[0]); init_values(); run_command(argc - 1, argv + 1, commands); - return 0; } + +OVSTEST_REGISTER("test-classifier", test_classifier_main);