![]() |
|
|||
File indexing completed on 2025-05-11 08:24:35
0001 #include <rtems/test.h> 0002 0003 static void 0004 destroy(T_destructor *dtor) 0005 { 0006 (void)dtor; 0007 T_step(0); 0008 } 0009 0010 T_TEST_CASE(destructor) 0011 { 0012 static T_destructor dtor; 0013 0014 T_plan(1); 0015 T_add_destructor(&dtor, destroy); 0016 } 0017 0018 #include "t-self-test.h" 0019 0020 T_TEST_OUTPUT(destructor, 0021 "B:destructor\n" 0022 "P:0:0:UI1:test-destructor.c:7\n" 0023 "E:destructor:N:1:F:0:D:0.001000\n"); 0024 0025 /* 0026 * The license is at the end of the file to be able to use the test code and 0027 * output in examples in the documentation. This is also the reason for the 0028 * dual licensing. The license for RTEMS documentation is CC-BY-SA-4.0. 0029 */ 0030 0031 /* 0032 * SPDX-License-Identifier: BSD-2-Clause OR CC-BY-SA-4.0 0033 * 0034 * Copyright (C) 2018, 2019 embedded brains GmbH & Co. KG 0035 * 0036 * Redistribution and use in source and binary forms, with or without 0037 * modification, are permitted provided that the following conditions 0038 * are met: 0039 * 1. Redistributions of source code must retain the above copyright 0040 * notice, this list of conditions and the following disclaimer. 0041 * 2. Redistributions in binary form must reproduce the above copyright 0042 * notice, this list of conditions and the following disclaimer in the 0043 * documentation and/or other materials provided with the distribution. 0044 * 0045 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 0046 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 0047 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 0048 * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE 0049 * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 0050 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 0051 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 0052 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 0053 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 0054 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 0055 * POSSIBILITY OF SUCH DAMAGE. 0056 * 0057 * ALTERNATIVELY, this software may be distributed under the terms of the 0058 * Creative Commons Attribution-ShareAlike 4.0 International Public License as 0059 * published by Creative Commons, PO Box 1866, Mountain View, CA 94042 0060 * (https://creativecommons.org/licenses/by-sa/4.0/legalcode). 0061 */
[ Source navigation ] | [ Diff markup ] | [ Identifier search ] | [ general search ] |
This page was automatically generated by the 2.3.7 LXR engine. The LXR team |
![]() ![]() |