diff options
Diffstat (limited to 'lib')
-rw-r--r-- | lib/bitops_test.c | 6 | ||||
-rw-r--r-- | lib/buffer_test.c | 8 | ||||
-rw-r--r-- | lib/checksum_test.c | 4 | ||||
-rw-r--r-- | lib/event_test.c | 2 | ||||
-rw-r--r-- | lib/fletcher16_test.c | 4 | ||||
-rw-r--r-- | lib/hash_test.c | 18 | ||||
-rw-r--r-- | lib/heap_test.c | 10 | ||||
-rw-r--r-- | lib/ip_test.c | 4 | ||||
-rw-r--r-- | lib/lists_test.c | 12 | ||||
-rw-r--r-- | lib/mac_test.c | 10 | ||||
-rw-r--r-- | lib/patmatch_test.c | 2 | ||||
-rw-r--r-- | lib/printf_test.c | 2 | ||||
-rw-r--r-- | lib/slist_test.c | 16 |
13 files changed, 49 insertions, 49 deletions
diff --git a/lib/bitops_test.c b/lib/bitops_test.c index bd02fccc..f816b9d1 100644 --- a/lib/bitops_test.c +++ b/lib/bitops_test.c @@ -28,7 +28,7 @@ t_mkmask(void) bt_assert_msg(compute == expect, "u32_mkmask(%d) = 0x%08X, expected 0x%08X", i, compute, expect); } - return BT_SUCCESS; + return 1; } static int @@ -78,7 +78,7 @@ t_masklen(void) for (i = 0; i <= MAX_NUM; i++) check_mask(bt_random()); - return BT_SUCCESS; + return 1; } static void @@ -107,7 +107,7 @@ t_log2(void) for (i = 1; i < MAX_NUM; i++) check_log2(((u32) bt_random()) % 0x0fffffff); - return BT_SUCCESS; + return 1; } int diff --git a/lib/buffer_test.c b/lib/buffer_test.c index 38e540b7..55179e82 100644 --- a/lib/buffer_test.c +++ b/lib/buffer_test.c @@ -69,7 +69,7 @@ t_buffer_push(void) BUFFER_PUSH(buf) = expected[i]; is_buffer_as_expected(&buf); - return BT_SUCCESS; + return 1; } static int @@ -97,7 +97,7 @@ t_buffer_pop(void) BUFFER_PUSH(buf) = expected[i]; is_buffer_as_expected(&buf); - return BT_SUCCESS; + return 1; } static int @@ -114,7 +114,7 @@ t_buffer_resize(void) is_buffer_as_expected(&buf); bt_assert(buf.size >= MAX_NUM); - return BT_SUCCESS; + return 1; } static int @@ -130,7 +130,7 @@ t_buffer_flush(void) BUFFER_FLUSH(buf); bt_assert(buf.used == 0); - return BT_SUCCESS; + return 1; } int diff --git a/lib/checksum_test.c b/lib/checksum_test.c index ae5a7f31..7e5658eb 100644 --- a/lib/checksum_test.c +++ b/lib/checksum_test.c @@ -60,7 +60,7 @@ t_calculate(void) bt_assert(sum_calculated == sum_expected); - return BT_SUCCESS; + return 1; } static int @@ -78,7 +78,7 @@ t_verify(void) bt_assert(ipsum_verify(a, sizeof(a), NULL)); - return BT_SUCCESS; + return 1; } diff --git a/lib/event_test.c b/lib/event_test.c index 1997344d..92172389 100644 --- a/lib/event_test.c +++ b/lib/event_test.c @@ -73,7 +73,7 @@ t_ev_run_list(void) for (i = 1; i < MAX_NUM; i++) bt_assert(event_check_points[i]); - return BT_SUCCESS; + return 1; } int diff --git a/lib/fletcher16_test.c b/lib/fletcher16_test.c index 3e036900..1020e6ec 100644 --- a/lib/fletcher16_test.c +++ b/lib/fletcher16_test.c @@ -55,7 +55,7 @@ test_fletcher16(void *out_, const void *in_, const void *expected_out_) fletcher16_update(&ctxt, in, strlen(in)); put_u16(out, fletcher16_compute(&ctxt)); - return (*out == *expected_out) ? BT_SUCCESS : BT_FAILURE; + return *out == *expected_out; } static int @@ -72,7 +72,7 @@ test_fletcher16_checksum(void *out_, const void *in_, const void *expected_out_) fletcher16_update(&ctxt, in, len); put_u16(out, fletcher16_final(&ctxt, len, len)); - return (*out == *expected_out) ? BT_SUCCESS : BT_FAILURE; + return *out == *expected_out; } static int diff --git a/lib/hash_test.c b/lib/hash_test.c index 07607f6e..59beb7c0 100644 --- a/lib/hash_test.c +++ b/lib/hash_test.c @@ -129,7 +129,7 @@ t_insert_find(void) fill_hash(); validate_filled_hash(); - return BT_SUCCESS; + return 1; } static int @@ -148,7 +148,7 @@ t_insert_find_random(void) validate_filled_hash(); - return BT_SUCCESS; + return 1; } static int @@ -168,7 +168,7 @@ t_insert2_find(void) validate_filled_hash(); - return BT_SUCCESS; + return 1; } static int @@ -191,7 +191,7 @@ t_walk(void) for (i = 0; i < MAX_NUM; i++) bt_assert(check[i] == 1); - return BT_SUCCESS; + return 1; } static int @@ -208,7 +208,7 @@ t_walk_delsafe_delete(void) validate_empty_hash(); - return BT_SUCCESS; + return 1; } static int @@ -225,7 +225,7 @@ t_walk_delsafe_remove(void) validate_empty_hash(); - return BT_SUCCESS; + return 1; } static int @@ -242,7 +242,7 @@ t_walk_delsafe_delete2(void) validate_empty_hash(); - return BT_SUCCESS; + return 1; } static int @@ -259,7 +259,7 @@ t_walk_delsafe_remove2(void) validate_empty_hash(); - return BT_SUCCESS; + return 1; } static int @@ -283,7 +283,7 @@ t_walk_filter(void) for (i = 0; i < MAX_NUM; i++) bt_assert(check[i] == 1); - return BT_SUCCESS; + return 1; } int diff --git a/lib/heap_test.c b/lib/heap_test.c index 40c9dd83..c04a0450 100644 --- a/lib/heap_test.c +++ b/lib/heap_test.c @@ -82,7 +82,7 @@ t_heap_insert(void) bt_assert(is_heap_valid(heap, num)); } - return BT_SUCCESS; + return 1; } static int @@ -110,7 +110,7 @@ t_heap_increase_decrease(void) bt_assert(is_heap_valid(heap, num)); } - return BT_SUCCESS; + return 1; } static int @@ -128,7 +128,7 @@ t_heap_delete(void) bt_assert(is_heap_valid(heap, num)); } - return BT_SUCCESS; + return 1; } static int @@ -139,7 +139,7 @@ t_heap_0(void) t_heap_increase_decrease(); t_heap_delete(); - return (heap[0] == SPECIAL_KEY) ? BT_SUCCESS : BT_FAILURE; + return heap[0] == SPECIAL_KEY; } static int @@ -168,7 +168,7 @@ t_heap_insert_random(void) bt_abort_msg("Did not find a number %d in heap.", expected[i]); } - return BT_SUCCESS; + return 1; } int diff --git a/lib/ip_test.c b/lib/ip_test.c index 81b4897e..fd70c957 100644 --- a/lib/ip_test.c +++ b/lib/ip_test.c @@ -31,7 +31,7 @@ test_ipa_pton(void *out_, const void *in_, const void *expected_out_) /* ip_addr == ip6_addr */ } - return ipa_equal(*out, *expected_out) ? BT_SUCCESS : BT_FAILURE; + return ipa_equal(*out, *expected_out); } static int @@ -105,7 +105,7 @@ test_ipa_ntop(void *out_, const void *in_, const void *expected_out_) ip6_ntop(ipa_to_ip6(*in), out); int result = strncmp(out, expected_out, ipa_is_ip4(*in) ? IP4_MAX_TEXT_LENGTH : IP6_MAX_TEXT_LENGTH) == 0; - return result ? BT_SUCCESS : BT_FAILURE; + return result; } static int diff --git a/lib/lists_test.c b/lib/lists_test.c index 56cc8427..f26a88e2 100644 --- a/lib/lists_test.c +++ b/lib/lists_test.c @@ -111,7 +111,7 @@ t_add_tail(void) show_list(); bt_assert(is_filled_list_well_linked()); - return BT_SUCCESS; + return 1; } static int @@ -135,7 +135,7 @@ t_add_head(void) show_list(); bt_assert(is_filled_list_well_linked()); - return BT_SUCCESS; + return 1; } static void @@ -166,7 +166,7 @@ t_insert_node(void) bt_debug("\n"); bt_assert(is_filled_list_well_linked()); - return BT_SUCCESS; + return 1; } static void @@ -218,7 +218,7 @@ t_remove_node(void) rem_node(&nodes[i]); bt_assert(is_empty_list_well_unlinked()); - return BT_SUCCESS; + return 1; } static int @@ -247,7 +247,7 @@ t_replace_node(void) bt_assert(tail.next == NODE &l.null); bt_assert(nodes[MAX_NUM-2].next == &tail); - return BT_SUCCESS; + return 1; } static int @@ -268,7 +268,7 @@ t_add_tail_list(void) bt_assert(nodes2[0].prev == &nodes[MAX_NUM-1]); bt_assert(l.tail == &nodes2[MAX_NUM-1]); - return BT_SUCCESS; + return 1; } int diff --git a/lib/mac_test.c b/lib/mac_test.c index 8522f95e..806fe3e4 100644 --- a/lib/mac_test.c +++ b/lib/mac_test.c @@ -28,7 +28,7 @@ test_##name(void *out_, const void *in_, const void *expected_out_) \ uint len = mac_type_length(id); \ bt_bytes_to_hex(out, out_bin, len); \ \ - return strncmp(out, expected_out, 2*len+1) == 0 ? BT_SUCCESS : BT_FAILURE; \ + return strncmp(out, expected_out, 2*len+1) == 0; \ } define_test_hash_fn(md5, ALG_MD5) @@ -283,8 +283,8 @@ test_##name##_hmac(void *out_, const void *in_, const void *expected_out_) \ \ uint len = mac_type_length(id); \ bt_bytes_to_hex(out, out_bin, len); \ - \ - return strncmp(out, expected_out, 2*len+1) == 0 ? BT_SUCCESS : BT_FAILURE; \ + \ + return strncmp(out, expected_out, 2*len+1) == 0; \ } define_test_hmac_fn(md5, ALG_HMAC_MD5) @@ -1092,7 +1092,7 @@ t_sha256_concating(void) int are_hash_a_b_equal = (strncmp(hash_a, hash_b, sizeof(hash_a)) == 0); bt_assert_msg(are_hash_a_b_equal, "Hashes A: %s, B: %s should be same", hash_a, hash_b); - return BT_SUCCESS; + return 1; } @@ -1130,7 +1130,7 @@ t_sha512_concating(void) int are_hash_a_b_equal = (strncmp(hash_a, hash_b, sizeof(hash_a)) == 0); bt_assert_msg(are_hash_a_b_equal, "Hashes A: %s, B: %s should be same", hash_a, hash_b); - return BT_SUCCESS; + return 1; } int diff --git a/lib/patmatch_test.c b/lib/patmatch_test.c index b2b4cb92..d65f316f 100644 --- a/lib/patmatch_test.c +++ b/lib/patmatch_test.c @@ -28,7 +28,7 @@ test_matching(void *out_, const void *in_, const void *expected_out_) *out = patmatch(in->pattern, in->data); - return (*out == *expected_out) ? BT_SUCCESS : BT_FAILURE; + return *out == *expected_out; } static void diff --git a/lib/printf_test.c b/lib/printf_test.c index 9763b7b1..3981d3da 100644 --- a/lib/printf_test.c +++ b/lib/printf_test.c @@ -56,7 +56,7 @@ t_simple(void) BSPRINTF(2, "-1", buf, "%d", -1); BSPRINTF(11, "-2147483648", buf, "%d", -2147483648); - return BT_SUCCESS; + return 1; } int diff --git a/lib/slist_test.c b/lib/slist_test.c index fd0b1ca6..069e361c 100644 --- a/lib/slist_test.c +++ b/lib/slist_test.c @@ -103,7 +103,7 @@ t_add_tail(void) bt_assert(is_filled_list_well_linked()); - return BT_SUCCESS; + return 1; } static int @@ -127,7 +127,7 @@ t_add_head(void) bt_assert(is_filled_list_well_linked()); - return BT_SUCCESS; + return 1; } static void @@ -158,7 +158,7 @@ t_insert_node(void) bt_debug("\n"); bt_assert(is_filled_list_well_linked()); - return BT_SUCCESS; + return 1; } static void @@ -211,7 +211,7 @@ t_remove_node(void) s_rem_node(&nodes[i]); bt_assert(is_empty_list_well_unlinked()); - return BT_SUCCESS; + return 1; } static int @@ -232,7 +232,7 @@ t_add_tail_list(void) bt_assert(nodes2[0].prev == &nodes[MAX_NUM-1]); bt_assert(lst.tail == &nodes2[MAX_NUM-1]); - return BT_SUCCESS; + return 1; } void @@ -290,7 +290,7 @@ t_iterator_walk(void) i++; } - return BT_SUCCESS; + return 1; } static int @@ -344,7 +344,7 @@ t_original(void) s_add_tail_list(&b, &a); dump("8 (after merge)", &b); - return BT_SUCCESS; + return 1; } static int @@ -363,7 +363,7 @@ t_safe_del_walk(void) } bt_assert(is_empty_list_well_unlinked()); - return BT_SUCCESS; + return 1; } int |