X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=tests%2Ftest-atomic.c;h=b1a5d9da4642f0b9f2ef1f8f8acf3969db380dfd;hb=aaea735bb6dad1b37941bd2de4b61a58af55bcde;hp=bc00df13977bb285b3112a3bbcf056e9c96c8bc3;hpb=c5f81b20da9bbf0ac406a88718597a4e84729a98;p=sliver-openvswitch.git diff --git a/tests/test-atomic.c b/tests/test-atomic.c index bc00df139..b1a5d9da4 100644 --- a/tests/test-atomic.c +++ b/tests/test-atomic.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013 Nicira, Inc. + * Copyright (c) 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. @@ -18,6 +18,7 @@ #include "ovs-atomic.h" #include "util.h" +#include "ovstest.h" #define TEST_ATOMIC_TYPE(ATOMIC_TYPE, BASE_TYPE) \ { \ @@ -59,8 +60,6 @@ ovs_assert(orig == 2); \ atomic_read(&x, &value); \ ovs_assert(value == 8); \ - \ - atomic_destroy(&x); \ } static void @@ -73,8 +72,9 @@ test_atomic_flag(void) ovs_assert(atomic_flag_test_and_set(&flag) == false); } -int -main(void) + +static void +test_atomic_main(int argc OVS_UNUSED, char *argv[] OVS_UNUSED) { TEST_ATOMIC_TYPE(atomic_char, char); TEST_ATOMIC_TYPE(atomic_uchar, unsigned char); @@ -103,6 +103,6 @@ main(void) TEST_ATOMIC_TYPE(atomic_int64_t, int64_t); test_atomic_flag(); - - return 0; } + +OVSTEST_REGISTER("test-atomic", test_atomic_main);