Back to home page

LXR

 
 

    


File indexing completed on 2025-05-11 08:24:35

0001 #include <rtems/test.h>
0002 #include <errno.h>
0003 
0004 T_TEST_CASE(test_eno)
0005 {
0006     T_eno(ENOMEM, ENOMEM);
0007     T_eno(ENOMEM, ERANGE);
0008     T_quiet_eno(ENOMEM, ENOMEM);
0009     T_quiet_eno(ENOMEM, ERANGE);
0010     T_assert_eno(ENOMEM, ENOMEM);
0011     T_assert_eno(ENOMEM, ERANGE);
0012 }
0013 
0014 T_TEST_CASE(test_eno_success)
0015 {
0016     T_eno_success(0);
0017     T_eno_success(ENOMEM);
0018     T_quiet_eno_success(0);
0019     T_quiet_eno_success(ENOMEM);
0020     T_assert_eno_success(0);
0021     T_assert_eno_success(ENOMEM);
0022 }
0023 
0024 #include "t-self-test.h"
0025 
0026 T_TEST_OUTPUT(test_eno,
0027 "B:test_eno\n"
0028 "P:0:0:UI1:test-eno.c:6\n"
0029 "F:1:0:UI1:test-eno.c:7:ENOMEM == ERANGE\n"
0030 "F:*:0:UI1:test-eno.c:9:ENOMEM == ERANGE\n"
0031 "P:2:0:UI1:test-eno.c:10\n"
0032 "F:3:0:UI1:test-eno.c:11:ENOMEM == ERANGE\n"
0033 "E:test_eno:N:4:F:3:D:0.001000\n");
0034 
0035 T_TEST_OUTPUT(test_eno_success,
0036 "B:test_eno_success\n"
0037 "P:0:0:UI1:test-eno.c:16\n"
0038 "F:1:0:UI1:test-eno.c:17:ENOMEM == 0\n"
0039 "F:*:0:UI1:test-eno.c:19:ENOMEM == 0\n"
0040 "P:2:0:UI1:test-eno.c:20\n"
0041 "F:3:0:UI1:test-eno.c:21:ENOMEM == 0\n"
0042 "E:test_eno_success:N:4:F:3:D:0.001000\n");
0043 
0044 /*
0045  * The license is at the end of the file to be able to use the test code and
0046  * output in examples in the documentation.  This is also the reason for the
0047  * dual licensing.  The license for RTEMS documentation is CC-BY-SA-4.0.
0048  */
0049 
0050 /*
0051  * SPDX-License-Identifier: BSD-2-Clause OR CC-BY-SA-4.0
0052  *
0053  * Copyright (C) 2018, 2019 embedded brains GmbH & Co. KG
0054  *
0055  * Redistribution and use in source and binary forms, with or without
0056  * modification, are permitted provided that the following conditions
0057  * are met:
0058  * 1. Redistributions of source code must retain the above copyright
0059  *    notice, this list of conditions and the following disclaimer.
0060  * 2. Redistributions in binary form must reproduce the above copyright
0061  *    notice, this list of conditions and the following disclaimer in the
0062  *    documentation and/or other materials provided with the distribution.
0063  *
0064  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
0065  * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
0066  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
0067  * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
0068  * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
0069  * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
0070  * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
0071  * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
0072  * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
0073  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
0074  * POSSIBILITY OF SUCH DAMAGE.
0075  *
0076  * ALTERNATIVELY, this software may be distributed under the terms of the
0077  * Creative Commons Attribution-ShareAlike 4.0 International Public License as
0078  * published by Creative Commons, PO Box 1866, Mountain View, CA 94042
0079  * (https://creativecommons.org/licenses/by-sa/4.0/legalcode).
0080  */