diff options
author | Giovanni Di Sirio <gdisirio@gmail.com> | 2016-03-19 11:22:24 +0000 |
---|---|---|
committer | Giovanni Di Sirio <gdisirio@gmail.com> | 2016-03-19 11:22:24 +0000 |
commit | 590c27ea84385d15797224785e80d2a003df8997 (patch) | |
tree | 89e4ac27b2d8a6915a0d1bb7786c83f48cb7e0ab /test/nil/source | |
parent | d29098e7f64c4d15b5414447937bfd09f142f758 (diff) | |
download | ChibiOS-590c27ea84385d15797224785e80d2a003df8997.tar.gz ChibiOS-590c27ea84385d15797224785e80d2a003df8997.tar.bz2 ChibiOS-590c27ea84385d15797224785e80d2a003df8997.zip |
git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@9138 35acf78f-673a-0410-8e92-d51de3d6d3f4
Diffstat (limited to 'test/nil/source')
-rw-r--r-- | test/nil/source/test/test_root.c | 30 | ||||
-rw-r--r-- | test/nil/source/test/test_root.h | 29 | ||||
-rw-r--r-- | test/nil/source/test/test_sequence_001.c | 28 | ||||
-rw-r--r-- | test/nil/source/test/test_sequence_001.h | 28 | ||||
-rw-r--r-- | test/nil/source/test/test_sequence_002.c | 28 | ||||
-rw-r--r-- | test/nil/source/test/test_sequence_002.h | 28 | ||||
-rw-r--r-- | test/nil/source/test/test_sequence_003.c | 28 | ||||
-rw-r--r-- | test/nil/source/test/test_sequence_003.h | 28 | ||||
-rw-r--r-- | test/nil/source/test/test_sequence_004.c | 28 | ||||
-rw-r--r-- | test/nil/source/test/test_sequence_004.h | 28 | ||||
-rw-r--r-- | test/nil/source/test/test_sequence_005.c | 58 | ||||
-rw-r--r-- | test/nil/source/test/test_sequence_005.h | 28 | ||||
-rw-r--r-- | test/nil/source/test/test_sequence_006.c | 90 | ||||
-rw-r--r-- | test/nil/source/test/test_sequence_006.h | 17 |
14 files changed, 308 insertions, 168 deletions
diff --git a/test/nil/source/test/test_root.c b/test/nil/source/test/test_root.c index 1516898c5..72a98172e 100644 --- a/test/nil/source/test/test_root.c +++ b/test/nil/source/test/test_root.c @@ -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
};
diff --git a/test/nil/source/test/test_root.h b/test/nil/source/test/test_root.h index ee0c42d0b..242091b3d 100644 --- a/test/nil/source/test/test_root.h +++ b/test/nil/source/test/test_root.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. */
/**
@@ -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. */
diff --git a/test/nil/source/test/test_sequence_001.c b/test/nil/source/test/test_sequence_001.c index 4be1c4785..8073ac10f 100644 --- a/test/nil/source/test/test_sequence_001.c +++ b/test/nil/source/test/test_sequence_001.c @@ -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"
diff --git a/test/nil/source/test/test_sequence_001.h b/test/nil/source/test/test_sequence_001.h index 83ef96518..7a71cfc00 100644 --- a/test/nil/source/test/test_sequence_001.h +++ b/test/nil/source/test/test_sequence_001.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[];
diff --git a/test/nil/source/test/test_sequence_002.c b/test/nil/source/test/test_sequence_002.c index bd626683b..0656d04f0 100644 --- a/test/nil/source/test/test_sequence_002.c +++ b/test/nil/source/test/test_sequence_002.c @@ -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"
diff --git a/test/nil/source/test/test_sequence_002.h b/test/nil/source/test/test_sequence_002.h index bd7b6c764..fdf3a8148 100644 --- a/test/nil/source/test/test_sequence_002.h +++ b/test/nil/source/test/test_sequence_002.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[];
diff --git a/test/nil/source/test/test_sequence_003.c b/test/nil/source/test/test_sequence_003.c index b58bd3b69..b527dec06 100644 --- a/test/nil/source/test/test_sequence_003.c +++ b/test/nil/source/test/test_sequence_003.c @@ -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"
diff --git a/test/nil/source/test/test_sequence_003.h b/test/nil/source/test/test_sequence_003.h index 587acc5de..71ce5cd65 100644 --- a/test/nil/source/test/test_sequence_003.h +++ b/test/nil/source/test/test_sequence_003.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[];
diff --git a/test/nil/source/test/test_sequence_004.c b/test/nil/source/test/test_sequence_004.c index 6cf37b289..2035849bd 100644 --- a/test/nil/source/test/test_sequence_004.c +++ b/test/nil/source/test/test_sequence_004.c @@ -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"
diff --git a/test/nil/source/test/test_sequence_004.h b/test/nil/source/test/test_sequence_004.h index 3ecaa4259..caa3a601c 100644 --- a/test/nil/source/test/test_sequence_004.h +++ b/test/nil/source/test/test_sequence_004.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[];
diff --git a/test/nil/source/test/test_sequence_005.c b/test/nil/source/test/test_sequence_005.c index fa3fc8eab..e75a36252 100644 --- a/test/nil/source/test/test_sequence_005.c +++ b/test/nil/source/test/test_sequence_005.c @@ -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
};
diff --git a/test/nil/source/test/test_sequence_005.h b/test/nil/source/test/test_sequence_005.h index 4cb8e1db0..b65d62ace 100644 --- a/test/nil/source/test/test_sequence_005.h +++ b/test/nil/source/test/test_sequence_005.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_005[];
diff --git a/test/nil/source/test/test_sequence_006.c b/test/nil/source/test/test_sequence_006.c new file mode 100644 index 000000000..fe3e2aaf6 --- /dev/null +++ b/test/nil/source/test/test_sequence_006.c @@ -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
+};
diff --git a/test/nil/source/test/test_sequence_006.h b/test/nil/source/test/test_sequence_006.h new file mode 100644 index 000000000..026d07577 --- /dev/null +++ b/test/nil/source/test/test_sequence_006.h @@ -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[];
|