[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH v2 5/5] cmocka: examples: Fix assert macros usage


On Thursday 12 February 2015 14:11:41 Krzysztof Opasiak wrote:
> Replace used macros with more suitable
> for given context.

Pushed to master! Thanks ...

> Signed-off-by: Krzysztof Opasiak <k.opasiak@xxxxxxxxxxx>
> ---
>  example/calculator_test.c |   13 +++----------
>  1 file changed, 3 insertions(+), 10 deletions(-)
> 
> diff --git a/example/calculator_test.c b/example/calculator_test.c
> index a2dd21d..ab8cad8 100644
> --- a/example/calculator_test.c
> +++ b/example/calculator_test.c
> @@ -159,10 +159,7 @@ static void
> test_find_operator_function_by_string_null_string(void **state) { static
> void test_find_operator_function_by_string_valid_null_functions(void
> **state) { (void) state; /* unused */
> 
> -  assert_int_equal(
> -          cast_ptr_to_largest_integral_type(
> -              find_operator_function_by_string(0, NULL, "test")),
> -          0);
> +	assert_null(find_operator_function_by_string(0, NULL, "test"));
>  }
> 
>  /* Ensure find_operator_function_by_string() returns NULL when searching
> for @@ -176,12 +173,8 @@ static void
> test_find_operator_function_by_string_not_found(void **state) {
> 
>          (void) state; /* unused */
> 
> -    assert_int_equal(
> -            cast_ptr_to_largest_integral_type(
> -               
> find_operator_function_by_string(array_length(operator_functions), -       
>                                          operator_functions, -             
>                                    "test")),
> -            0);
> +	assert_null(find_operator_function_by_string(
> +	        array_length(operator_functions), operator_functions, "test"));
>  }
> 
>  /* Ensure find_operator_function_by_string() returns the correct function
> when

-- 
Andreas Schneider                   GPG-ID: CC014E3D
www.cryptomilk.org                asn@xxxxxxxxxxxxxx


References:
[PATCH v2 0/5] cmocka: Make casting macros publicKrzysztof Opasiak <k.opasiak@xxxxxxxxxxx>
[PATCH v2 5/5] cmocka: examples: Fix assert macros usageKrzysztof Opasiak <k.opasiak@xxxxxxxxxxx>