git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@9138 35acf78f-673a-0410-8e92-d51de3d6d3f4
This commit is contained in:
parent
d29098e7f6
commit
590c27ea84
|
@ -9,6 +9,23 @@
|
|||
<instance locked="false" id="org.chibios.spc5.components.platform.generic" />
|
||||
<instance locked="false" id="org.chibios.spc5.components.chibios_unitary_tests_engine">
|
||||
<description>
|
||||
<copyright>
|
||||
<value><![CDATA[/*
|
||||
ChibiOS - Copyright (C) 2006..2016 Giovanni Di Sirio
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/]]></value>
|
||||
</copyright>
|
||||
<introduction>
|
||||
<value>Test suite for ChibiOS/NIL. The purpose of this suite is to perform unit tests on the NIL modules and to converge to 100% code coverage through successive improvements.</value>
|
||||
</introduction>
|
||||
|
@ -930,8 +947,8 @@ test_assert(msg1 == MSG_TIMEOUT, "wrong wake-up message");]]></value>
|
|||
<value><![CDATA[#define MEMORY_POOL_SIZE 4
|
||||
|
||||
static uint32_t objects[MEMORY_POOL_SIZE];
|
||||
static MEMORYPOOL_DECL(mp1, sizeof (uint32_t), NULL);
|
||||
static GUARDEDMEMORYPOOL_DECL(gmp1, sizeof (uint32_t));
|
||||
static MEMORYPOOL_DECL(mp1, sizeof (uint32_t), NULL);
|
||||
static GUARDEDMEMORYPOOL_DECL(gmp1, sizeof (uint32_t));
|
||||
|
||||
static void *null_provider(size_t size, unsigned align) {
|
||||
|
||||
|
@ -950,7 +967,7 @@ static void *null_provider(size_t size, unsigned align) {
|
|||
<value>The memory pool functionality is tested by loading and empting it, all conditions are tested.</value>
|
||||
</description>
|
||||
<condition>
|
||||
<value />
|
||||
<value>CH_CFG_USE_MEMPOOLS</value>
|
||||
</condition>
|
||||
<various_code>
|
||||
<setup_code>
|
||||
|
@ -1055,7 +1072,7 @@ test_assert(chPoolAlloc(&mp1) == NULL, "provider returned memory");]]></value>
|
|||
<value>The memory pool functionality is tested by loading and empting it, all conditions are tested.</value>
|
||||
</description>
|
||||
<condition>
|
||||
<value />
|
||||
<value>(CH_CFG_USE_MEMPOOLS && CH_CFG_USE_SEMAPHORES)</value>
|
||||
</condition>
|
||||
<various_code>
|
||||
<setup_code>
|
||||
|
@ -1148,7 +1165,7 @@ test_assert(chPoolAlloc(&mp1) == NULL, "provider returned memory");]]></value>
|
|||
<value>The timeout features for the Guarded Memory Pools is tested.</value>
|
||||
</description>
|
||||
<condition>
|
||||
<value />
|
||||
<value>(CH_CFG_USE_MEMPOOLS && CH_CFG_USE_SEMAPHORES)</value>
|
||||
</condition>
|
||||
<various_code>
|
||||
<setup_code>
|
||||
|
@ -1177,6 +1194,45 @@ test_assert(chPoolAlloc(&mp1) == NULL, "provider returned memory");]]></value>
|
|||
</case>
|
||||
</cases>
|
||||
</sequence>
|
||||
<sequence>
|
||||
<type index="0">
|
||||
<value>Internal Tests</value>
|
||||
</type>
|
||||
<brief>
|
||||
<value>Memory Heaps.</value>
|
||||
</brief>
|
||||
<description>
|
||||
<value>This sequence tests the ChibiOS/NIL functionalities related to memory heaps.</value>
|
||||
</description>
|
||||
<shared_code>
|
||||
<value />
|
||||
</shared_code>
|
||||
<cases>
|
||||
<case>
|
||||
<brief>
|
||||
<value>Allocation and fragmentation.</value>
|
||||
</brief>
|
||||
<description>
|
||||
<value>Series of allocations/deallocations are performed in carefully designed sequences in order to stimulate all the possible code paths inside the allocator. The test expects to find the heap back to the initial status after each sequence.</value>
|
||||
</description>
|
||||
<condition>
|
||||
<value>CH_CFG_USE_HEAP</value>
|
||||
</condition>
|
||||
<various_code>
|
||||
<setup_code>
|
||||
<value><![CDATA[chHeapObjectInit(&test_heap, test.buffer, sizeof(union test_buffers));]]></value>
|
||||
</setup_code>
|
||||
<teardown_code>
|
||||
<value />
|
||||
</teardown_code>
|
||||
<local_variables>
|
||||
<value />
|
||||
</local_variables>
|
||||
</various_code>
|
||||
<steps />
|
||||
</case>
|
||||
</cases>
|
||||
</sequence>
|
||||
</sequences>
|
||||
</instance>
|
||||
</instances>
|
||||
|
|
|
@ -1,28 +1,5 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<SPC5-Patch version="1.0.0">
|
||||
<!--It is your patch repository, do not break your XML File.-->
|
||||
<files>
|
||||
<file componentId="org.chibios.spc5.components.chibios_unitary_tests_engine" version="1.0.0.qualifier" path="component/lib/include/ch_test.h" user="false">
|
||||
<diff><![CDATA[--- components/chibios_unit_tests_engine_component/lib/include/ch_test.h
|
||||
+++ components/chibios_unit_tests_engine_component/lib/include/ch_test.h
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
- ChibiOS - Copyright (C) 2006..2015 Giovanni Di Sirio
|
||||
+ ChibiOS - Copyright (C) 2006..2016 Giovanni Di Sirio
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.]]></diff>
|
||||
</file>
|
||||
<file componentId="org.chibios.spc5.components.chibios_unitary_tests_engine" version="1.0.0.qualifier" path="component/lib/src/ch_test.c" user="false">
|
||||
<diff><![CDATA[--- components/chibios_unit_tests_engine_component/lib/src/ch_test.c
|
||||
+++ components/chibios_unit_tests_engine_component/lib/src/ch_test.c
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
- ChibiOS - Copyright (C) 2006..2015 Giovanni Di Sirio
|
||||
+ ChibiOS - Copyright (C) 2006..2016 Giovanni Di Sirio
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.]]></diff>
|
||||
</file>
|
||||
</files>
|
||||
<files />
|
||||
</SPC5-Patch>
|
||||
|
|
|
@ -1,17 +1,17 @@
|
|||
/*
|
||||
ChibiOS - Copyright (C) 2006..2016 Giovanni Di Sirio
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
/*
|
||||
ChibiOS - Copyright (C) 2006..2016 Giovanni Di Sirio
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
/**
|
||||
|
@ -26,6 +26,7 @@
|
|||
* - @subpage test_sequence_003
|
||||
* - @subpage test_sequence_004
|
||||
* - @subpage test_sequence_005
|
||||
* - @subpage test_sequence_006
|
||||
* .
|
||||
*/
|
||||
|
||||
|
@ -54,6 +55,7 @@ const testcase_t * const *test_suite[] = {
|
|||
test_sequence_003,
|
||||
test_sequence_004,
|
||||
test_sequence_005,
|
||||
test_sequence_006,
|
||||
NULL
|
||||
};
|
||||
|
||||
|
|
|
@ -1,17 +1,17 @@
|
|||
/*
|
||||
ChibiOS - Copyright (C) 2006..2015 Giovanni Di Sirio
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
/*
|
||||
ChibiOS - Copyright (C) 2006..2016 Giovanni Di Sirio
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
/**
|
||||
|
@ -30,6 +30,7 @@
|
|||
#include "test_sequence_003.h"
|
||||
#include "test_sequence_004.h"
|
||||
#include "test_sequence_005.h"
|
||||
#include "test_sequence_006.h"
|
||||
|
||||
/*===========================================================================*/
|
||||
/* External declarations. */
|
||||
|
|
|
@ -1,17 +1,17 @@
|
|||
/*
|
||||
ChibiOS - Copyright (C) 2006..2015 Giovanni Di Sirio
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
/*
|
||||
ChibiOS - Copyright (C) 2006..2016 Giovanni Di Sirio
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
#include "hal.h"
|
||||
|
|
|
@ -1,17 +1,17 @@
|
|||
/*
|
||||
ChibiOS - Copyright (C) 2006..2015 Giovanni Di Sirio
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
/*
|
||||
ChibiOS - Copyright (C) 2006..2016 Giovanni Di Sirio
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
extern const testcase_t * const test_sequence_001[];
|
||||
|
|
|
@ -1,17 +1,17 @@
|
|||
/*
|
||||
ChibiOS - Copyright (C) 2006..2015 Giovanni Di Sirio
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
/*
|
||||
ChibiOS - Copyright (C) 2006..2016 Giovanni Di Sirio
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
#include "hal.h"
|
||||
|
|
|
@ -1,17 +1,17 @@
|
|||
/*
|
||||
ChibiOS - Copyright (C) 2006..2015 Giovanni Di Sirio
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
/*
|
||||
ChibiOS - Copyright (C) 2006..2016 Giovanni Di Sirio
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
extern const testcase_t * const test_sequence_002[];
|
||||
|
|
|
@ -1,17 +1,17 @@
|
|||
/*
|
||||
ChibiOS - Copyright (C) 2006..2015 Giovanni Di Sirio
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
/*
|
||||
ChibiOS - Copyright (C) 2006..2016 Giovanni Di Sirio
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
#include "hal.h"
|
||||
|
|
|
@ -1,17 +1,17 @@
|
|||
/*
|
||||
ChibiOS - Copyright (C) 2006..2015 Giovanni Di Sirio
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
/*
|
||||
ChibiOS - Copyright (C) 2006..2016 Giovanni Di Sirio
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
extern const testcase_t * const test_sequence_003[];
|
||||
|
|
|
@ -1,17 +1,17 @@
|
|||
/*
|
||||
ChibiOS - Copyright (C) 2006..2015 Giovanni Di Sirio
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
/*
|
||||
ChibiOS - Copyright (C) 2006..2016 Giovanni Di Sirio
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
#include "hal.h"
|
||||
|
|
|
@ -1,17 +1,17 @@
|
|||
/*
|
||||
ChibiOS - Copyright (C) 2006..2015 Giovanni Di Sirio
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
/*
|
||||
ChibiOS - Copyright (C) 2006..2016 Giovanni Di Sirio
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
extern const testcase_t * const test_sequence_004[];
|
||||
|
|
|
@ -1,17 +1,17 @@
|
|||
/*
|
||||
ChibiOS - Copyright (C) 2006..2015 Giovanni Di Sirio
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
/*
|
||||
ChibiOS - Copyright (C) 2006..2016 Giovanni Di Sirio
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
#include "hal.h"
|
||||
|
@ -56,6 +56,7 @@ static void *null_provider(size_t size, unsigned align) {
|
|||
* Test cases.
|
||||
****************************************************************************/
|
||||
|
||||
#if CH_CFG_USE_MEMPOOLS || defined(__DOXYGEN__)
|
||||
/**
|
||||
* @page test_005_001 Loading and empting a memory pool
|
||||
*
|
||||
|
@ -63,6 +64,12 @@ static void *null_provider(size_t size, unsigned align) {
|
|||
* The memory pool functionality is tested by loading and empting it,
|
||||
* all conditions are tested.
|
||||
*
|
||||
* <h2>Conditions</h2>
|
||||
* This test is only executed if the following preprocessor condition
|
||||
* evaluates to true:
|
||||
* - CH_CFG_USE_MEMPOOLS
|
||||
* .
|
||||
*
|
||||
* <h2>Test Steps</h2>
|
||||
* - Adding the objects to the pool using chPoolLoadArray().
|
||||
* - Emptying the pool using chPoolAlloc().
|
||||
|
@ -136,7 +143,9 @@ static const testcase_t test_005_001 = {
|
|||
NULL,
|
||||
test_005_001_execute
|
||||
};
|
||||
#endif /* CH_CFG_USE_MEMPOOLS */
|
||||
|
||||
#if (CH_CFG_USE_MEMPOOLS && CH_CFG_USE_SEMAPHORES) || defined(__DOXYGEN__)
|
||||
/**
|
||||
* @page test_005_002 Loading and empting a guarded memory pool without waiting
|
||||
*
|
||||
|
@ -144,6 +153,12 @@ static const testcase_t test_005_001 = {
|
|||
* The memory pool functionality is tested by loading and empting it,
|
||||
* all conditions are tested.
|
||||
*
|
||||
* <h2>Conditions</h2>
|
||||
* This test is only executed if the following preprocessor condition
|
||||
* evaluates to true:
|
||||
* - (CH_CFG_USE_MEMPOOLS && CH_CFG_USE_SEMAPHORES)
|
||||
* .
|
||||
*
|
||||
* <h2>Test Steps</h2>
|
||||
* - Adding the objects to the pool using chGuardedPoolLoadArray().
|
||||
* - Emptying the pool using chGuardedPoolAllocTimeout().
|
||||
|
@ -207,13 +222,21 @@ static const testcase_t test_005_002 = {
|
|||
NULL,
|
||||
test_005_002_execute
|
||||
};
|
||||
#endif /* (CH_CFG_USE_MEMPOOLS && CH_CFG_USE_SEMAPHORES) */
|
||||
|
||||
#if (CH_CFG_USE_MEMPOOLS && CH_CFG_USE_SEMAPHORES) || defined(__DOXYGEN__)
|
||||
/**
|
||||
* @page test_005_003 Guarded Memory Pools timeout
|
||||
*
|
||||
* <h2>Description</h2>
|
||||
* The timeout features for the Guarded Memory Pools is tested.
|
||||
*
|
||||
* <h2>Conditions</h2>
|
||||
* This test is only executed if the following preprocessor condition
|
||||
* evaluates to true:
|
||||
* - (CH_CFG_USE_MEMPOOLS && CH_CFG_USE_SEMAPHORES)
|
||||
* .
|
||||
*
|
||||
* <h2>Test Steps</h2>
|
||||
* - Trying to allocate with 100mS timeout, must fail because the pool
|
||||
* is empty.
|
||||
|
@ -240,6 +263,7 @@ static const testcase_t test_005_003 = {
|
|||
NULL,
|
||||
test_005_003_execute
|
||||
};
|
||||
#endif /* (CH_CFG_USE_MEMPOOLS && CH_CFG_USE_SEMAPHORES) */
|
||||
|
||||
/****************************************************************************
|
||||
* Exported data.
|
||||
|
@ -249,8 +273,14 @@ static const testcase_t test_005_003 = {
|
|||
* @brief Memory Pools.
|
||||
*/
|
||||
const testcase_t * const test_sequence_005[] = {
|
||||
#if CH_CFG_USE_MEMPOOLS || defined(__DOXYGEN__)
|
||||
&test_005_001,
|
||||
#endif
|
||||
#if (CH_CFG_USE_MEMPOOLS && CH_CFG_USE_SEMAPHORES) || defined(__DOXYGEN__)
|
||||
&test_005_002,
|
||||
#endif
|
||||
#if (CH_CFG_USE_MEMPOOLS && CH_CFG_USE_SEMAPHORES) || defined(__DOXYGEN__)
|
||||
&test_005_003,
|
||||
#endif
|
||||
NULL
|
||||
};
|
||||
|
|
|
@ -1,17 +1,17 @@
|
|||
/*
|
||||
ChibiOS - Copyright (C) 2006..2015 Giovanni Di Sirio
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
/*
|
||||
ChibiOS - Copyright (C) 2006..2016 Giovanni Di Sirio
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
extern const testcase_t * const test_sequence_005[];
|
||||
|
|
|
@ -0,0 +1,90 @@
|
|||
/*
|
||||
ChibiOS - Copyright (C) 2006..2016 Giovanni Di Sirio
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
#include "hal.h"
|
||||
#include "ch_test.h"
|
||||
#include "test_root.h"
|
||||
|
||||
/**
|
||||
* @page test_sequence_006 Memory Heaps
|
||||
*
|
||||
* File: @ref test_sequence_006.c
|
||||
*
|
||||
* <h2>Description</h2>
|
||||
* This sequence tests the ChibiOS/NIL functionalities related to
|
||||
* memory heaps.
|
||||
*
|
||||
* <h2>Test Cases</h2>
|
||||
* - @subpage test_006_001
|
||||
* .
|
||||
*/
|
||||
|
||||
/****************************************************************************
|
||||
* Shared code.
|
||||
****************************************************************************/
|
||||
|
||||
|
||||
/****************************************************************************
|
||||
* Test cases.
|
||||
****************************************************************************/
|
||||
|
||||
#if CH_CFG_USE_HEAP || defined(__DOXYGEN__)
|
||||
/**
|
||||
* @page test_006_001 Allocation and fragmentation
|
||||
*
|
||||
* <h2>Description</h2>
|
||||
* Series of allocations/deallocations are performed in carefully
|
||||
* designed sequences in order to stimulate all the possible code paths
|
||||
* inside the allocator. The test expects to find the heap back to the
|
||||
* initial status after each sequence.
|
||||
*
|
||||
* <h2>Conditions</h2>
|
||||
* This test is only executed if the following preprocessor condition
|
||||
* evaluates to true:
|
||||
* - CH_CFG_USE_HEAP
|
||||
* .
|
||||
*
|
||||
* <h2>Test Steps</h2>
|
||||
*/
|
||||
|
||||
static void test_006_001_setup(void) {
|
||||
chHeapObjectInit(&test_heap, test.buffer, sizeof(union test_buffers));
|
||||
}
|
||||
|
||||
static void test_006_001_execute(void) {
|
||||
}
|
||||
|
||||
static const testcase_t test_006_001 = {
|
||||
"Allocation and fragmentation",
|
||||
test_006_001_setup,
|
||||
NULL,
|
||||
test_006_001_execute
|
||||
};
|
||||
#endif /* CH_CFG_USE_HEAP */
|
||||
|
||||
/****************************************************************************
|
||||
* Exported data.
|
||||
****************************************************************************/
|
||||
|
||||
/**
|
||||
* @brief Memory Heaps.
|
||||
*/
|
||||
const testcase_t * const test_sequence_006[] = {
|
||||
#if CH_CFG_USE_HEAP || defined(__DOXYGEN__)
|
||||
&test_006_001,
|
||||
#endif
|
||||
NULL
|
||||
};
|
|
@ -0,0 +1,17 @@
|
|||
/*
|
||||
ChibiOS - Copyright (C) 2006..2016 Giovanni Di Sirio
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
extern const testcase_t * const test_sequence_006[];
|
|
@ -5,7 +5,8 @@ TESTSRC = ${CHIBIOS}/test/lib/ch_test.c \
|
|||
${CHIBIOS}/test/nil/source/test/test_sequence_002.c \
|
||||
${CHIBIOS}/test/nil/source/test/test_sequence_003.c \
|
||||
${CHIBIOS}/test/nil/source/test/test_sequence_004.c \
|
||||
${CHIBIOS}/test/nil/source/test/test_sequence_005.c
|
||||
${CHIBIOS}/test/nil/source/test/test_sequence_005.c \
|
||||
${CHIBIOS}/test/nil/source/test/test_sequence_006.c
|
||||
|
||||
# Required include directories
|
||||
TESTINC = ${CHIBIOS}/test/lib \
|
||||
|
|
Loading…
Reference in New Issue