X-Git-Url: http://git.liburcu.org/?a=blobdiff_plain;f=tests%2Ftest_uatomic.c;h=3faae661f4bb1382de593d17f26f6462b088dd33;hb=7d5dc80de0522da1b8bc3656646ea39c15481594;hp=37f95a6d849699f7756676a09f0fee78803f4054;hpb=985b35b18796edab591775098fef83a50a1e55ce;p=urcu.git diff --git a/tests/test_uatomic.c b/tests/test_uatomic.c index 37f95a6..3faae66 100644 --- a/tests/test_uatomic.c +++ b/tests/test_uatomic.c @@ -1,6 +1,28 @@ +/* + * test_uatomic.c + * + * Userspace RCU library - test atomic operations + * + * Copyright February 2009 - Mathieu Desnoyers + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + */ + #include #include -#include +#include struct testvals { unsigned char c; @@ -41,6 +63,8 @@ do { \ v = uatomic_sub_return(ptr, 1); \ assert(v == 121); \ assert(uatomic_read(ptr) == 121); \ + uatomic_and(ptr, 129); \ + assert(uatomic_read(ptr) == 1); \ } while (0) int main(int argc, char **argv)