summaryrefslogtreecommitdiff
path: root/libstdc++-v3/testsuite/19_diagnostics/headers/system_error/errc_std_c++0x.cc
blob: 2e33f041ead6167ec94f69ee1090a345966c2a13 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
// { dg-do compile { target c++11 } }

// Copyright (C) 2007-2023 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library.  This library is free
// software; you can redistribute it and/or modify it under the
// terms of the GNU General Public License as published by the
// Free Software Foundation; either version 3, or (at your option)
// any later version.

// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
// GNU General Public License for more details.

// You should have received a copy of the GNU General Public License along
// with this library; see the file COPYING3.  If not see
// <http://www.gnu.org/licenses/>.

#include <system_error>

#define TEST_ERRC(x) errc x(errc::x); (void)x

void test01()
{
  using std::errc;

  TEST_ERRC(address_family_not_supported);
  TEST_ERRC(address_in_use);
  TEST_ERRC(address_not_available);
  TEST_ERRC(already_connected);
  TEST_ERRC(argument_list_too_long);
  TEST_ERRC(argument_out_of_domain);
  TEST_ERRC(bad_address);
  TEST_ERRC(bad_file_descriptor);

#ifdef EBADMSG
  TEST_ERRC(bad_message);
#endif

  TEST_ERRC(broken_pipe);
  TEST_ERRC(connection_aborted);
  TEST_ERRC(connection_already_in_progress);
  TEST_ERRC(connection_refused);
  TEST_ERRC(connection_reset);
  TEST_ERRC(cross_device_link);
  TEST_ERRC(destination_address_required);
  TEST_ERRC(device_or_resource_busy);
  TEST_ERRC(directory_not_empty);
  TEST_ERRC(executable_format_error);
  TEST_ERRC(file_exists);
  TEST_ERRC(file_too_large);
  TEST_ERRC(filename_too_long);
  TEST_ERRC(function_not_supported);
  TEST_ERRC(host_unreachable);

#ifdef EIDRM
  TEST_ERRC(identifier_removed);
#endif

  TEST_ERRC(illegal_byte_sequence);
  TEST_ERRC(inappropriate_io_control_operation);
  TEST_ERRC(interrupted);
  TEST_ERRC(invalid_argument);
  TEST_ERRC(invalid_seek);
  TEST_ERRC(io_error);
  TEST_ERRC(is_a_directory);
  TEST_ERRC(message_size);
  TEST_ERRC(network_down);
  TEST_ERRC(network_reset);
  TEST_ERRC(network_unreachable);
  TEST_ERRC(no_buffer_space);

#ifdef ECHILD
  TEST_ERRC(no_child_process);
#endif

#ifdef ENOLINK
  TEST_ERRC(no_link);
#endif

  TEST_ERRC(no_lock_available);

#ifdef ENODATA
  TEST_ERRC(no_message_available);
#endif

#ifdef ENOMSG
  TEST_ERRC(no_message);
#endif
  TEST_ERRC(no_protocol_option);

#ifdef ENOSPC
  TEST_ERRC(no_space_on_device);
#endif

#ifdef ENOSR
  TEST_ERRC(no_stream_resources);
#endif

  TEST_ERRC(no_such_device_or_address);
  TEST_ERRC(no_such_device);
  TEST_ERRC(no_such_file_or_directory);
  TEST_ERRC(no_such_process);
  TEST_ERRC(not_a_directory);
  TEST_ERRC(not_a_socket);

#ifdef ENOSTR
  TEST_ERRC(not_a_stream);
#endif

  TEST_ERRC(not_connected);
  TEST_ERRC(not_enough_memory);

#ifdef ENOTSUP
  TEST_ERRC(not_supported);
#endif

#ifdef ECANCELED
  TEST_ERRC(operation_canceled);
#endif

  TEST_ERRC(operation_in_progress);

#ifdef EPERM
  TEST_ERRC(operation_not_permitted);
#endif

  TEST_ERRC(operation_not_supported);

#ifdef EWOULDBLOCK
  TEST_ERRC(operation_would_block);
#endif

#ifdef EOWNERDEAD
  TEST_ERRC(owner_dead);
#endif

  TEST_ERRC(permission_denied);

#ifdef EPROTO
  TEST_ERRC(protocol_error);
#endif

  TEST_ERRC(protocol_not_supported);
  TEST_ERRC(read_only_file_system);
  TEST_ERRC(resource_deadlock_would_occur);
  TEST_ERRC(resource_unavailable_try_again);
  TEST_ERRC(result_out_of_range);

#ifdef ENOTRECOVERABLE
  TEST_ERRC(state_not_recoverable);
#endif

#ifdef ETIME
  TEST_ERRC(stream_timeout);
#endif

#ifdef ETXTBSY
  TEST_ERRC(text_file_busy);
#endif

#ifdef ETIMEDOUT
  TEST_ERRC(timed_out);
#endif

  TEST_ERRC(too_many_files_open_in_system);
  TEST_ERRC(too_many_files_open);
  TEST_ERRC(too_many_links);
  TEST_ERRC(too_many_symbolic_link_levels);

#ifdef EOVERFLOW
  TEST_ERRC(value_too_large);
#endif

  TEST_ERRC(wrong_protocol_type);
}