summaryrefslogtreecommitdiff
path: root/tests/test-list.c
diff options
context:
space:
mode:
authorBen Pfaff <blp@nicira.com>2010-09-17 10:33:10 -0700
committerBen Pfaff <blp@nicira.com>2010-10-01 10:25:29 -0700
commit4e8e4213a815a30216e855a805a8bcd5b8c5a886 (patch)
tree38dbb503be4f22ae804f3e5f83459c975d83886a /tests/test-list.c
parentadf7cfd851c3d9d6f1ad74653cbd2fecce8c3ba9 (diff)
downloadopenvswitch-4e8e4213a815a30216e855a805a8bcd5b8c5a886.tar.gz
Switch many macros from using CONTAINER_OF to using OBJECT_CONTAINING.
These macros require one fewer argument by switching, which makes code that uses them shorter and more readable.
Diffstat (limited to 'tests/test-list.c')
-rw-r--r--tests/test-list.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/tests/test-list.c b/tests/test-list.c
index 0efdbfce4..5e62e0c00 100644
--- a/tests/test-list.c
+++ b/tests/test-list.c
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2008, 2009 Nicira Networks.
+ * Copyright (c) 2008, 2009, 2010 Nicira Networks.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -55,7 +55,7 @@ check_list(struct list *list, const int values[], size_t n)
size_t i;
i = 0;
- LIST_FOR_EACH (e, struct element, node, list) {
+ LIST_FOR_EACH (e, node, list) {
assert(i < n);
assert(e->value == values[i]);
i++;
@@ -64,7 +64,7 @@ check_list(struct list *list, const int values[], size_t n)
assert(i == n);
i = 0;
- LIST_FOR_EACH_REVERSE (e, struct element, node, list) {
+ LIST_FOR_EACH_REVERSE (e, node, list) {
assert(i < n);
assert(e->value == values[n - i - 1]);
i++;
@@ -84,7 +84,7 @@ print_list(const char *name, struct list *list)
struct element *e;
printf("%s:", name);
- LIST_FOR_EACH (e, struct element, node, list) {
+ LIST_FOR_EACH (e, node, list) {
printf(" %d", e->value);
}
printf("\n");
@@ -131,7 +131,7 @@ test_list_for_each_safe(void)
i = 0;
values_idx = 0;
n_remaining = n;
- LIST_FOR_EACH_SAFE (e, next, struct element, node, &list) {
+ LIST_FOR_EACH_SAFE (e, next, node, &list) {
assert(i < n);
if (pattern & (1ul << i)) {
list_remove(&e->node);