comparison src/syscalls.cc @ 14429:eff4a5933e28

Update %!tests in src/ directory with Octave coding conventions. * data.cc, defaults.cc, dirfns.cc, file-io.cc, graphics.cc, mappers.cc, oct-map.cc, octave.cc, ov-base.cc, ov-bool-mat.cc, ov-cell.cc, ov-fcn-handle.cc, ov-fcn-inline.cc, ov-flt-re-mat.cc, ov-int16.cc, ov-int32.cc, ov-int64.cc, ov-int8.cc, ov-null-mat.cc, ov-oncleanup.cc, ov-range.cc, ov-re-mat.cc, ov-struct.cc, ov-typeinfo.cc, ov-uint16.cc, ov-uint32.cc, ov-uint64.cc, ov-uint8.cc, ov.cc, pr-output.cc, pt-binop.cc, pt-eval.cc, pt-idx.cc, pt-mat.cc, sighandlers.cc, strfns.cc, symtab.cc, syscalls.cc, sysdep.cc, toplev.cc, utils.cc, variables.cc: Update %!tests in src/ directory with Octave coding conventions.
author Rik <octave@nomad.inbox5.com>
date Sun, 04 Mar 2012 12:21:10 -0800
parents 97883071e8e4
children 67b6b47a22f6
comparison
equal deleted inserted replaced
14428:099bd779466c 14429:eff4a5933e28
367 367
368 return retval; 368 return retval;
369 } 369 }
370 370
371 /* 371 /*
372
373 %!test 372 %!test
374 %! if (isunix()) 373 %! if (isunix ())
375 %! [in, out, pid] = popen2 ("sort", "-r"); 374 %! [in, out, pid] = popen2 ("sort", "-r");
376 %! EAGAIN = errno ("EAGAIN"); 375 %! EAGAIN = errno ("EAGAIN");
377 %! else 376 %! else
378 %! [in, out, pid] = popen2 ("sort", "/R"); 377 %! [in, out, pid] = popen2 ("sort", "/R");
379 %! EAGAIN = errno ("EINVAL"); 378 %! EAGAIN = errno ("EINVAL");
380 %! endif 379 %! endif
381 %! fputs (in, "these\nare\nsome\nstrings\n"); 380 %! fputs (in, "these\nare\nsome\nstrings\n");
382 %! fclose (in); 381 %! fclose (in);
383 %! done = false; 382 %! done = false;
384 %! str = {}; 383 %! str = {};
385 %! idx = 0; 384 %! idx = 0;
386 %! errs = 0; 385 %! errs = 0;
387 %! do 386 %! do
388 %! if (!isunix()) 387 %! if (!isunix ())
389 %! errno (0); 388 %! errno (0);
390 %! endif 389 %! endif
391 %! s = fgets (out); 390 %! s = fgets (out);
392 %! if (ischar (s)) 391 %! if (ischar (s))
393 %! idx++; 392 %! idx++;
394 %! str{idx} = s; 393 %! str{idx} = s;
395 %! elseif (errno () == EAGAIN) 394 %! elseif (errno () == EAGAIN)
396 %! fclear (out); 395 %! fclear (out);
397 %! sleep (0.1); 396 %! sleep (0.1);
398 %! if (++errs == 100) 397 %! if (++errs == 100)
399 %! done = true;
400 %! endif
401 %! else
402 %! done = true; 398 %! done = true;
403 %! endif 399 %! endif
404 %! until (done) 400 %! else
405 %! fclose (out); 401 %! done = true;
406 %! if (isunix()) 402 %! endif
407 %! assert(str,{"these\n","strings\n","some\n","are\n"}) 403 %! until (done)
408 %! else 404 %! fclose (out);
409 %! assert(str,{"these\r\n","strings\r\n","some\r\n","are\r\n"}) 405 %! if (isunix ())
410 %! end 406 %! assert(str, {"these\n","strings\n","some\n","are\n"});
411 407 %! else
408 %! assert(str, {"these\r\n","strings\r\n","some\r\n","are\r\n"});
409 %! endif
412 */ 410 */
413 411
414 DEFUNX ("fcntl", Ffcntl, args, , 412 DEFUNX ("fcntl", Ffcntl, args, ,
415 "-*- texinfo -*-\n\ 413 "-*- texinfo -*-\n\
416 @deftypefn {Built-in Function} {[@var{err}, @var{msg}] =} fcntl (@var{fid}, @var{request}, @var{arg})\n\ 414 @deftypefn {Built-in Function} {[@var{err}, @var{msg}] =} fcntl (@var{fid}, @var{request}, @var{arg})\n\