diff options
author | Ben Pfaff <blp@nicira.com> | 2011-03-24 09:40:07 -0700 |
---|---|---|
committer | Ben Pfaff <blp@nicira.com> | 2011-04-01 15:52:19 -0700 |
commit | dc1539ae02fcb9c22b98d587b790ce8bc3a68774 (patch) | |
tree | 273f1ad653b1b7128b5780d8d1f07cd8b4bbdb12 /tests/test-list.c | |
parent | eda1f38d41be1b604229343fe14d7122eaedd4d5 (diff) |
list: New functions list_is_singleton(), list_is_short().
Diffstat (limited to 'tests/test-list.c')
-rw-r--r-- | tests/test-list.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/tests/test-list.c b/tests/test-list.c index 5e62e0c0..b4ddd02e 100644 --- a/tests/test-list.c +++ b/tests/test-list.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2008, 2009, 2010 Nicira Networks. + * Copyright (c) 2008, 2009, 2010, 2011 Nicira Networks. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -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(list_is_singleton(list) == (n == 1)); + assert(list_is_short(list) == (n < 2)); assert(list_size(list) == n); } |