X-Git-Url: https://git.lttng.org/?a=blobdiff_plain;f=tests%2Fbenchmark%2Ftest_urcu_hash.h;h=530a68bcd1b04c304c9c0ec06e712446d41278f9;hb=ce29b37132cef1c1c758e0862ac701e9bb756d29;hp=dfb8116a1fd2651ebcc6f565d3d9826beb86ce62;hpb=0614a2e61ccbf150cc51d4fd3073b285983417c5;p=userspace-rcu.git diff --git a/tests/benchmark/test_urcu_hash.h b/tests/benchmark/test_urcu_hash.h index dfb8116..530a68b 100644 --- a/tests/benchmark/test_urcu_hash.h +++ b/tests/benchmark/test_urcu_hash.h @@ -1,26 +1,12 @@ +// SPDX-FileCopyrightText: 2009-2012 Mathieu Desnoyers +// +// SPDX-License-Identifier: GPL-2.0-or-later + #ifndef _TEST_URCU_HASH_H #define _TEST_URCU_HASH_H /* - * test_urcu_hash.h - * * Userspace RCU library - test program - * - * Copyright 2009-2012 - 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 @@ -31,10 +17,10 @@ #include #include #include -#include #include #include +#include #include #include #include "thread-id.h" @@ -304,7 +290,7 @@ unsigned long test_hash_mix(const void *_key, size_t length, unsigned long seed) { unsigned int key = (unsigned int) _key; - assert(length == sizeof(unsigned int)); + urcu_posix_assert(length == sizeof(unsigned int)); return hash_u32(&key, 1, seed); } #else @@ -320,7 +306,7 @@ unsigned long test_hash_mix(const void *_key, size_t length, unsigned long seed) uint32_t v32[2]; } key; - assert(length == sizeof(unsigned long)); + urcu_posix_assert(length == sizeof(unsigned long)); v.v64 = (uint64_t) seed; key.v64 = (uint64_t) _key; hashword2(key.v32, 2, &v.v32[0], &v.v32[1]); @@ -345,7 +331,7 @@ unsigned long test_hash(const void *_key, size_t length, } else { unsigned long v; - assert(length == sizeof(unsigned long)); + urcu_posix_assert(length == sizeof(unsigned long)); v = (unsigned long) _key; return v % nr_hash_chains; } @@ -367,7 +353,7 @@ static inline void cds_lfht_test_lookup(struct cds_lfht *ht, void *key, size_t key_len, struct cds_lfht_iter *iter) { - assert(key_len == sizeof(unsigned long)); + urcu_posix_assert(key_len == sizeof(unsigned long)); cds_lfht_lookup(ht, test_hash(key, key_len, TEST_HASH_SEED), test_match, key, iter);