X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=tests%2Ftest-vconn.c;h=8b24bd8f42aea05100239f782c084a0ba3cb0e47;hb=003ce655b7116d18c86a74c50391e54990346931;hp=76757f4ff4f956ffb4b8faebfaa88e208ffc8702;hpb=8a777cf663fc9c6fb3789a3fecebbe615eef8b33;p=sliver-openvswitch.git diff --git a/tests/test-vconn.c b/tests/test-vconn.c index 76757f4ff..8b24bd8f4 100644 --- a/tests/test-vconn.c +++ b/tests/test-vconn.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. @@ -34,6 +34,7 @@ #include "timeval.h" #include "util.h" #include "vlog.h" +#include "ovstest.h" #undef NDEBUG #include @@ -356,7 +357,7 @@ test_send_plain_hello(int argc OVS_UNUSED, char *argv[]) hello = ofpraw_alloc_xid(OFPRAW_OFPT_HELLO, OFP10_VERSION, htonl(0x12345678), 0); - test_send_hello(type, hello->data, hello->size, 0); + test_send_hello(type, ofpbuf_data(hello), ofpbuf_size(hello), 0); ofpbuf_delete(hello); } @@ -374,7 +375,7 @@ test_send_long_hello(int argc OVS_UNUSED, char *argv[]) htonl(0x12345678), EXTRA_BYTES); ofpbuf_put_zeros(hello, EXTRA_BYTES); ofpmsg_update_length(hello); - test_send_hello(type, hello->data, hello->size, 0); + test_send_hello(type, ofpbuf_data(hello), ofpbuf_size(hello), 0); ofpbuf_delete(hello); } @@ -388,7 +389,7 @@ test_send_echo_hello(int argc OVS_UNUSED, char *argv[]) echo = ofpraw_alloc_xid(OFPRAW_OFPT_ECHO_REQUEST, OFP10_VERSION, htonl(0x12345678), 0); - test_send_hello(type, echo->data, echo->size, EPROTO); + test_send_hello(type, ofpbuf_data(echo), ofpbuf_size(echo), EPROTO); ofpbuf_delete(echo); } @@ -414,8 +415,8 @@ test_send_invalid_version_hello(int argc OVS_UNUSED, char *argv[]) hello = ofpraw_alloc_xid(OFPRAW_OFPT_HELLO, OFP10_VERSION, htonl(0x12345678), 0); - ((struct ofp_header *) hello->data)->version = 0; - test_send_hello(type, hello->data, hello->size, EPROTO); + ((struct ofp_header *) ofpbuf_data(hello))->version = 0; + test_send_hello(type, ofpbuf_data(hello), ofpbuf_size(hello), EPROTO); ofpbuf_delete(hello); } @@ -431,8 +432,8 @@ static const struct command commands[] = { {NULL, 0, 0, NULL}, }; -int -main(int argc, char *argv[]) +static void +test_vconn_main(int argc, char *argv[]) { set_program_name(argv[0]); vlog_set_levels(NULL, VLF_ANY_FACILITY, VLL_EMER); @@ -442,6 +443,6 @@ main(int argc, char *argv[]) time_alarm(10); run_command(argc - 1, argv + 1, commands); - - return 0; } + +OVSTEST_REGISTER("test-vconn", test_vconn_main);