~ubuntu-branches/ubuntu/utopic/coreutils/utopic-proposed

« back to all changes in this revision

Viewing changes to gnulib-tests/test-getcwd.c

  • Committer: Package Import Robot
  • Author(s): Colin Watson
  • Date: 2012-11-28 03:03:42 UTC
  • mfrom: (8.3.4 sid)
  • Revision ID: package-import@ubuntu.com-20121128030342-21zanj8354gas5gr
Tags: 8.20-3ubuntu1
* Resynchronise with Debian.  Remaining changes:
  - Make 'uname -i -p' return the real processor/hardware, instead of
    unknown.
  - Build-depend on gettext:any instead of on gettext, so that apt-get can
    properly resolve build-dependencies on the tool when cross-building.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/* -*- buffer-read-only: t -*- vi: set ro: */
2
 
/* DO NOT EDIT! GENERATED AUTOMATICALLY! */
3
1
/* Test of getcwd() function.
4
 
   Copyright (C) 2009-2011 Free Software Foundation, Inc.
 
2
   Copyright (C) 2009-2012 Free Software Foundation, Inc.
5
3
 
6
4
   This program is free software: you can redistribute it and/or modify
7
5
   it under the terms of the GNU General Public License as published by
136
134
  size_t n_chdirs = 0;
137
135
 
138
136
  if (cwd == NULL)
139
 
    return 10;
 
137
    return 1;
140
138
 
141
139
  cwd_len = initial_cwd_len = strlen (cwd);
142
140
 
154
152
      if (mkdir (DIR_NAME, S_IRWXU) < 0 || chdir (DIR_NAME) < 0)
155
153
        {
156
154
          if (! (errno == ERANGE || errno == ENAMETOOLONG || errno == ENOENT))
157
 
            fail = 20;
 
155
            fail = 2;
158
156
          break;
159
157
        }
160
158
 
163
161
          c = getcwd (buf, PATH_MAX);
164
162
          if (!c && errno == ENOENT)
165
163
            {
166
 
              fail = 11;
167
 
              break;
168
 
            }
169
 
          if (c || ! (errno == ERANGE || errno == ENAMETOOLONG))
170
 
            {
171
 
              fail = 21;
 
164
              fail = 3;
 
165
              break;
 
166
            }
 
167
          if (c)
 
168
            {
 
169
              fail = 4;
 
170
              break;
 
171
            }
 
172
          if (! (errno == ERANGE || errno == ENAMETOOLONG))
 
173
            {
 
174
              fail = 5;
172
175
              break;
173
176
            }
174
177
        }
183
186
              if (! (errno == ERANGE || errno == ENOENT
184
187
                     || errno == ENAMETOOLONG))
185
188
                {
186
 
                  fail = 22;
 
189
                  fail = 6;
187
190
                  break;
188
191
                }
189
192
              if (AT_FDCWD || errno == ERANGE || errno == ENOENT)
190
193
                {
191
 
                  fail = 12;
 
194
                  fail = 7;
192
195
                  break;
193
196
                }
194
197
            }
196
199
 
197
200
      if (c && strlen (c) != cwd_len)
198
201
        {
199
 
          fail = 23;
 
202
          fail = 8;
200
203
          break;
201
204
        }
202
205
      ++n_chdirs;
226
229
int
227
230
main (int argc, char **argv)
228
231
{
229
 
  return test_abort_bug () + test_long_name ();
 
232
  return test_abort_bug () * 10 + test_long_name ();
230
233
}