/*
- * 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.
#include "ovs-atomic.h"
#include "util.h"
+#include "ovstest.h"
#define TEST_ATOMIC_TYPE(ATOMIC_TYPE, BASE_TYPE) \
{ \
ovs_assert(orig == 2); \
atomic_read(&x, &value); \
ovs_assert(value == 8); \
- \
- atomic_destroy(&x); \
}
static 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);
TEST_ATOMIC_TYPE(atomic_int64_t, int64_t);
test_atomic_flag();
-
- return 0;
}
+
+OVSTEST_REGISTER("test-atomic", test_atomic_main);