diff mbox

validation: shm: abort on null pointer

Message ID 1425581300-24335-1-git-send-email-mike.holmes@linaro.org
State Accepted
Commit a7bda31a17a7eae12b15776d9b6220a658a1b4a3
Headers show

Commit Message

Mike Holmes March 5, 2015, 6:48 p.m. UTC
CU_ASSERT does not exit, use CU_ASSERT_FATAL to ensure the pointer
is not used

Signed-off-by: Mike Holmes <mike.holmes@linaro.org>
---
 test/validation/odp_shm.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Bill Fischofer March 5, 2015, 7:32 p.m. UTC | #1
On Thu, Mar 5, 2015 at 12:48 PM, Mike Holmes <mike.holmes@linaro.org> wrote:

> CU_ASSERT does not exit, use CU_ASSERT_FATAL to ensure the pointer
> is not used
>
> Signed-off-by: Mike Holmes <mike.holmes@linaro.org>
>

Reviewed-by: Bill Fischofer <bill.fischofer@linaro.org>


> ---
>  test/validation/odp_shm.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/test/validation/odp_shm.c b/test/validation/odp_shm.c
> index 39dd8f0..1ad00ba 100644
> --- a/test/validation/odp_shm.c
> +++ b/test/validation/odp_shm.c
> @@ -61,7 +61,7 @@ static void test_odp_shm_sunnyday(void)
>         CU_ASSERT(ODP_SHM_INVALID != shm);
>
>         test_shared_data = odp_shm_addr(shm);
> -       CU_ASSERT(NULL != test_shared_data);
> +       CU_ASSERT_FATAL(NULL != test_shared_data);
>         test_shared_data->foo = TEST_SHARE_FOO;
>         test_shared_data->bar = TEST_SHARE_BAR;
>
> --
> 2.1.0
>
>
> _______________________________________________
> lng-odp mailing list
> lng-odp@lists.linaro.org
> http://lists.linaro.org/mailman/listinfo/lng-odp
>
Maxim Uvarov March 6, 2015, 10:27 a.m. UTC | #2
Merged,
Maxim.

On 03/05/15 22:32, Bill Fischofer wrote:
>
>
> On Thu, Mar 5, 2015 at 12:48 PM, Mike Holmes <mike.holmes@linaro.org 
> <mailto:mike.holmes@linaro.org>> wrote:
>
>     CU_ASSERT does not exit, use CU_ASSERT_FATAL to ensure the pointer
>     is not used
>
>     Signed-off-by: Mike Holmes <mike.holmes@linaro.org
>     <mailto:mike.holmes@linaro.org>>
>
>
> Reviewed-by: Bill Fischofer <bill.fischofer@linaro.org 
> <mailto:bill.fischofer@linaro.org>>
>
>     ---
>      test/validation/odp_shm.c | 2 +-
>      1 file changed, 1 insertion(+), 1 deletion(-)
>
>     diff --git a/test/validation/odp_shm.c b/test/validation/odp_shm.c
>     index 39dd8f0..1ad00ba 100644
>     --- a/test/validation/odp_shm.c
>     +++ b/test/validation/odp_shm.c
>     @@ -61,7 +61,7 @@ static void test_odp_shm_sunnyday(void)
>             CU_ASSERT(ODP_SHM_INVALID != shm);
>
>             test_shared_data = odp_shm_addr(shm);
>     -       CU_ASSERT(NULL != test_shared_data);
>     +       CU_ASSERT_FATAL(NULL != test_shared_data);
>             test_shared_data->foo = TEST_SHARE_FOO;
>             test_shared_data->bar = TEST_SHARE_BAR;
>
>     --
>     2.1.0
>
>
>     _______________________________________________
>     lng-odp mailing list
>     lng-odp@lists.linaro.org <mailto:lng-odp@lists.linaro.org>
>     http://lists.linaro.org/mailman/listinfo/lng-odp
>
>
>
>
> _______________________________________________
> lng-odp mailing list
> lng-odp@lists.linaro.org
> http://lists.linaro.org/mailman/listinfo/lng-odp
diff mbox

Patch

diff --git a/test/validation/odp_shm.c b/test/validation/odp_shm.c
index 39dd8f0..1ad00ba 100644
--- a/test/validation/odp_shm.c
+++ b/test/validation/odp_shm.c
@@ -61,7 +61,7 @@  static void test_odp_shm_sunnyday(void)
 	CU_ASSERT(ODP_SHM_INVALID != shm);
 
 	test_shared_data = odp_shm_addr(shm);
-	CU_ASSERT(NULL != test_shared_data);
+	CU_ASSERT_FATAL(NULL != test_shared_data);
 	test_shared_data->foo = TEST_SHARE_FOO;
 	test_shared_data->bar = TEST_SHARE_BAR;