git://git.onelab.eu
/
sliver-openvswitch.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
OXM inspired match field names.
[sliver-openvswitch.git]
/
tests
/
test-list.c
diff --git
a/tests/test-list.c
b/tests/test-list.c
index
0efdbfc
..
5074818
100644
(file)
--- 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, 2011 Nicira, Inc
.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
*
* 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;
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++;
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;
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++;
assert(i < n);
assert(e->value == values[n - i - 1]);
i++;
@@
-73,6
+73,8
@@
check_list(struct list *list, const int values[], size_t n)
assert(i == n);
assert(list_is_empty(list) == !n);
assert(i == n);
assert(list_is_empty(list) == !n);
+ assert(list_is_singleton(list) == (n == 1));
+ assert(list_is_short(list) == (n < 2));
assert(list_size(list) == n);
}
assert(list_size(list) == n);
}
@@
-84,7
+86,7
@@
print_list(const char *name, struct list *list)
struct element *e;
printf("%s:", name);
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");
printf(" %d", e->value);
}
printf("\n");
@@
-131,7
+133,7
@@
test_list_for_each_safe(void)
i = 0;
values_idx = 0;
n_remaining = n;
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);
assert(i < n);
if (pattern & (1ul << i)) {
list_remove(&e->node);