From be4e3d6fbcc06c0c020bd39a6063a3ae23195d27 Mon Sep 17 00:00:00 2001 From: Sebastian Huber Date: Thu, 15 Jul 2010 13:36:25 +0000 Subject: 2010-07-15 Sebastian Huber * malloctest/init.c: Added test for rtems_heap_allocate_aligned_with_boundary(). --- testsuites/libtests/ChangeLog | 5 +++++ testsuites/libtests/malloctest/init.c | 17 ++++++++++++++++- 2 files changed, 21 insertions(+), 1 deletion(-) (limited to 'testsuites/libtests') diff --git a/testsuites/libtests/ChangeLog b/testsuites/libtests/ChangeLog index 0c54099423..40c6a85307 100644 --- a/testsuites/libtests/ChangeLog +++ b/testsuites/libtests/ChangeLog @@ -1,3 +1,8 @@ +2010-07-15 Sebastian Huber + + * malloctest/init.c: Added test for + rtems_heap_allocate_aligned_with_boundary(). + 2010-07-14 Joel Sherrill * Makefile.am, configure.ac: Add new test to exercise devFS_Show(). diff --git a/testsuites/libtests/malloctest/init.c b/testsuites/libtests/malloctest/init.c index 4b88f3b03f..e0cb60be01 100644 --- a/testsuites/libtests/malloctest/init.c +++ b/testsuites/libtests/malloctest/init.c @@ -14,7 +14,7 @@ * COPYRIGHT (c) 1989-2009. * On-Line Applications Research Corporation (OAR). * - * Copyright (c) 2009 embedded brains GmbH. + * Copyright (c) 2009, 2010 embedded brains GmbH. * * The license and distribution terms for this file may be * found in the file LICENSE in this distribution or at @@ -1023,6 +1023,20 @@ static void test_protected_heap_info(void) rtems_test_assert( rc == false ); } +static void test_rtems_heap_allocate_aligned_with_boundary(void) +{ + void *p = NULL; + + p = rtems_heap_allocate_aligned_with_boundary(1, 1, 1); + rtems_test_assert( p != NULL ); + free(p); + + _Thread_Disable_dispatch(); + p = rtems_heap_allocate_aligned_with_boundary(1, 1, 1); + _Thread_Enable_dispatch(); + rtems_test_assert( p == NULL ); +} + /* * A simple test of posix_memalign */ @@ -1108,6 +1122,7 @@ rtems_task Init( test_heap_extend(); test_heap_info(); test_protected_heap_info(); + test_rtems_heap_allocate_aligned_with_boundary(); test_posix_memalign(); -- cgit v1.2.3