# HG changeset patch # User John W. Eaton # Date 1310855276 14400 # Node ID 9ce9e1e2d2c8de389914e978f27eac2f7c1700ce # Parent 29d4b27e485dec11c2effe1b7479a1002a359964 codesprint: new tests for toplev.cc * toplev.cc (Fsystem, Foctave_config_info): New tests. diff -r 29d4b27e485d -r 9ce9e1e2d2c8 src/toplev.cc --- a/src/toplev.cc Sat Jul 16 15:25:08 2011 -0700 +++ b/src/toplev.cc Sat Jul 16 18:27:56 2011 -0400 @@ -1001,6 +1001,20 @@ DEFALIAS (shell_cmd, system); +/* +%!error (system ()); +%!error (system (1, 2, 3)); +%!test +%! if (ispc ()) +%! cmd = "dir"; +%! else +%! cmd = "ls"; +%! endif +%! [status, output] = system (cmd); +%! assert (ischar (output)); +%! assert (! isempty (output)); +*/ + // FIXME -- this should really be static, but that causes // problems on some systems. std::list octave_atexit_functions; @@ -1439,6 +1453,15 @@ return retval; } +/* +%!error octave_config_info (1, 2); +%!assert (ischar (octave_config_info ("version"))); +%!test +%! x = octave_config_info (); +%! assert (isstruct (x)); +%! assert (! isempty (x)); +*/ + #if defined (__GNUG__) && defined (DEBUG_NEW_DELETE) int debug_new_delete = 0;