diff libinterp/dldfcn/chol.cc @ 20711:7b608fadc663

Make error messages more specific about the variable and problem encountered. * besselj.cc, bitfcns.cc, colloc.cc, daspk.cc, dasrt.cc, dassl.cc, data.cc, dirfns.cc, ellipj.cc, error.cc, gl-render.cc, graphics.cc, graphics.in.h, load-path.cc, lsode.cc, lu.cc, luinc.cc, oct-hist.cc, oct-obj.cc, octave-link.cc, quad.cc, rand.cc, symtab.cc, sysdep.cc, toplev.cc, utils.cc, variables.cc, __init_fltk__.cc, chol.cc, fftw.cc, ov-cell.cc, ov-ch-mat.cc, ov-class.cc, ov-classdef.cc, ov-cx-mat.cc, ov-fcn-inline.cc, ov-struct.cc, ov-usr-fcn.cc, CMatrix.cc, dMatrix.cc, fCMatrix.cc, fMatrix.cc, lo-specfun.cc, curl.m, divergence.m, __fltk_file_filter__.m, __uiobject_split_args__.m, uigetfile.m, doc.m, imshow.m, rref.m, subspace.m, edit.m, fileattrib.m, open.m, substruct.m, annotation.m, axis.m, caxis.m, datetick.m, hidden.m, legend.m, whitebg.m, colorbar.m, __add_datasource__.m, __ezplot__.m, __pie__.m, __plt_get_axis_arg__.m, pan.m, __print_parse_opts__.m, rotate3d.m, subplot.m, zoom.m, compan.m, addpref.m, getpref.m, setpref.m, powerset.m, bicg.m, bicgstab.m, cgs.m, qmr.m, spaugment.m, pascal.m, moment.m, cstrcat.m, system.tst: Make error messages more specific about the variable and problem encountered.
author Rik <rik@octave.org>
date Wed, 18 Nov 2015 10:40:26 -0800
parents 68e3a747ca02
children c2d9556d51d0
line wrap: on
line diff
--- a/libinterp/dldfcn/chol.cc	Tue Nov 17 22:04:42 2015 +0100
+++ b/libinterp/dldfcn/chol.cc	Wed Nov 18 10:40:26 2015 -0800
@@ -162,16 +162,16 @@
   int n = 1;
   while (n < nargin)
     {
-      std::string tmp = args(n++).xstring_value ("chol: expecting trailing string arguments");
+      std::string tmp = args(n++).xstring_value ("chol: optional arguments must be strings");
 
-      if (tmp.compare ("vector") == 0)
+      if (tmp == "vector")
         vecout = true;
-      else if (tmp.compare ("lower") == 0)
+      else if (tmp == "lower")
         LLt = true;
-      else if (tmp.compare ("upper") == 0)
+      else if (tmp == "upper")
         LLt = false;
       else
-        error ("chol: unexpected second or third input");
+        error ("chol: optional argument must be one of \"vector\", \"lower\", or \"upper\"");
     }
 
   octave_value arg = args(0);
@@ -339,8 +339,8 @@
 %!error chol ()
 %!error <matrix must be positive definite> chol ([1, 2; 3, 4])
 %!error <requires square matrix> chol ([1, 2; 3, 4; 5, 6])
-%!error <expecting trailing string arguments> chol (1, 2)
-%!error <unexpected second or third input> chol (1, "foobar")
+%!error <optional arguments must be strings> chol (1, 2)
+%!error <optional argument must be one of "vector", "lower"> chol (1, "foobar")
 */
 
 DEFUN_DLD (cholinv, args, ,