if (bCatch)
{
- wchar_t szError[bsiz];
- os_swprintf(szError, bsiz, _W("%s: An error occured in '%s' subroutine.\n").c_str(), "daskr", "ddaskr");
+ char sError[bsiz];
+ os_sprintf(sError, "%ls: An error occured in '%ls' subroutine.\n", L"daskr", L"ddaskr");
+ wchar_t* szError = to_wide_string(sError);
os << szError;
throw ast::InternalError(os.str());
+ FREE(szError);
}
return types::Function::Error;
if (bCatch)
{
- wchar_t szError[bsiz];
- os_swprintf(szError, bsiz, _W("%s: An error occured in '%s' subroutine.\n").c_str(), "dasrt", "ddasrt");
+ char sError[bsiz];
+ os_sprintf(sError, "%ls: An error occured in '%ls' subroutine.\n", L"dasrt", L"ddasrt");
+ wchar_t* szError = to_wide_string(sError);
os << szError;
throw ast::InternalError(os.str());
+ FREE(szError);
}
return types::Function::Error;
if (bCatch)
{
- wchar_t szError[bsiz];
- os_swprintf(szError, bsiz, _W("%s: An error occured in '%s' subroutine.\n").c_str(), "dassl", "dassl");
+ char sError[bsiz];
+ os_sprintf(sError, "%ls: An error occured in '%ls' subroutine.\n", L"dassl", L"dassl");
+ wchar_t* szError = to_wide_string(sError);
os << szError;
throw ast::InternalError(os.str());
+ FREE(szError);
}
return types::Function::Error;
if (bCatch)
{
- wchar_t szError[bsiz];
- os_swprintf(szError, bsiz, _W("%s: An error occured in '%s' subroutine.\n").c_str(), "intg", "dqags");
+ char sError[bsiz];
+ os_sprintf(sError, "%ls: An error occured in '%ls' subroutine.\n", L"intg", L"dqags");
+ wchar_t* szError = to_wide_string(sError);
os << szError;
throw ast::InternalError(os.str());
+ FREE(szError);
}
if (ier)
if (bCatch)
{
- wchar_t szError[bsiz];
- os_swprintf(szError, bsiz, _W("%s: An error occured in '%s' subroutine.\n").c_str(), "ode", strMeth.c_str());
+ char sError[bsiz];
+ os_sprintf(sError, "%ls: An error occured in '%s' subroutine.\n", L"ode", strMeth.c_str());
+ wchar_t* szError = to_wide_string(sError);
os << szError;
throw ast::InternalError(os.str());
+ FREE(szError);
}
return types::Function::Error;
if (bCatch)
{
- wchar_t szError[bsiz];
- os_swprintf(szError, bsiz, _W("%s: An error occured in '%s' subroutine.\n").c_str(), "ode", strMeth.c_str());
+ char sError[bsiz];
+ os_sprintf(sError, "%ls: An error occured in '%s' subroutine.\n", L"ode", strMeth.c_str());
+ wchar_t* szError = to_wide_string(sError);
os << szError;
throw ast::InternalError(os.str());
+ FREE(szError);
}
return types::Function::Error;
t0 = 0;
t = linspace(0, 10, 100);
refMsg = [msprintf(_("%s: Wrong type for output argument #%d: Real matrix expected.\n"), "f", 1);
- msprintf(_("%s: An error occured in ''%s'' subroutine."), "ode", "lsoda")];
+msprintf(_("%ls: An error occured in ''%s'' subroutine."), "ode", "lsoda")];
assert_checkerror("y = ode(zeros(1, 1), t0, t, f);", refMsg);
assert_checkerror("y = ode(zeros(1, 2), t0, t, f);", refMsg);
assert_checkerror("y = ode(zeros(1, 3), t0, t, f);", refMsg);
t = linspace(0, 10, 100);
refMsg = [msprintf(_("%s: Wrong type for output argument #%d: Real matrix expected.\n"), "f", 1);
-msprintf(_("%s: An error occured in ''%s'' subroutine."), "ode", "lsoda")];
+msprintf(_("%ls: An error occured in ''%s'' subroutine."), "ode", "lsoda")];
assert_checkerror("y = ode(zeros(1, 1), t0, t, f);", refMsg);
assert_checkerror("y = ode(zeros(1, 2), t0, t, f);", refMsg);
assert_checkerror("y = ode(zeros(1, 3), t0, t, f);", refMsg);
// end
endfunction
t=0:0.01:40;
-refMsg = [msprintf(_("Invalid index."));
- msprintf(_("%s: An error occured in ''%s'' subroutine.\n"), "ode", "lsrgk")];
+refMsg = [msprintf(_("Invalid index.\n"));
+msprintf(_("%ls: An error occured in ''%s'' subroutine.\n"), "ode", "lsrgk")];
assert_checkerror("res=ode(""rk"",[x0;y0;v0;teta0;],t0,t,right)", refMsg);
t=0:0.01:40;
-refMsg = [msprintf(_("Invalid index."));
-msprintf(_("%s: An error occured in ''%s'' subroutine.\n"), "ode", "lsrgk")];
+refMsg = [msprintf(_("Invalid index.\n"));
+msprintf(_("%ls: An error occured in ''%s'' subroutine.\n"), "ode", "lsrgk")];
assert_checkerror("res=ode(""rk"",[x0;y0;v0;teta0;],t0,t,right)", refMsg);
deff("y = f(x)", "y = sin(x) ./ x");
// This function is going to be evaluated by intg at the midpoint of the interval [-1; 1], so it will produce a "Division by zero" error.
refMsg = [msprintf(_("Division by zero...\n"));
- msprintf(_("%s: An error occured in ''%s'' subroutine."), "intg", "dqags")];
+msprintf(_("%ls: An error occured in ''%ls'' subroutine."), "intg", "dqags")];
assert_checkerror("intg(-1, 1, f)", refMsg);
deff("y = g(x)", "y = b");
// In any evaluation point, 'b' is unknown so the function will yield an error.
deff("y = f(x)", "y = sin(x) ./ x");
// This function is going to be evaluated by intg at the midpoint of the interval [-1; 1], so it will produce a "Division by zero" error.
refMsg = [msprintf(_("Division by zero...\n"));
-msprintf(_("%s: An error occured in ''%s'' subroutine."), "intg", "dqags")];
+msprintf(_("%ls: An error occured in ''%ls'' subroutine."), "intg", "dqags")];
assert_checkerror("intg(-1, 1, f)", refMsg);
deff("y = g(x)", "y = b");
// The evaluation function purposely lacks the output argument 'ires'
deff("ydot = f1(t, y, ydot)", "ydot = y^2 - y*sin(t) + cos(t)")
refMsg = [msprintf(_("%s: Wrong number of output argument(s): %d expected.\n"), "f1", 2);
- msprintf(_("%s: An error occured in ''%s'' subroutine.\n"), "dassl", "dassl")];
+msprintf(_("%ls: An error occured in ''%ls'' subroutine.\n"), "dassl", "dassl")];
assert_checkerror("y = dae(y0, t0, t, f1);", refMsg);
// The evaluation function purposely lacks the input argument 'ydot'
deff("[ydot,ires] = f2(t, y)", "ydot = y^2 - y*sin(t) + cos(t)");
refMsg = [msprintf(_("Wrong number of input arguments."));
- msprintf(_("%s: An error occured in ''%s'' subroutine.\n"), "dassl", "dassl")];
+msprintf(_("%ls: An error occured in ''%ls'' subroutine.\n"), "dassl", "dassl")];
assert_checkerror("y = dae(y0, t0, t, f2);", refMsg);
// ----------------------------------
// Without initial yprime computation
// The evaluation function purposely lacks the output argument 'ires'
refMsg = [msprintf(_("%s: Wrong number of output argument(s): %d expected.\n"), "f1", 2);
- msprintf(_("%s: An error occured in ''%s'' subroutine.\n"), "dassl", "dassl")];
+msprintf(_("%ls: An error occured in ''%ls'' subroutine.\n"), "dassl", "dassl")];
assert_checkerror("y = dae([y0; 0], t0, t, f1);", refMsg);
// The evaluation function purposely lacks the input argument 'ydot'
refMsg = [msprintf(_("Wrong number of input arguments."));
- msprintf(_("%s: An error occured in ''%s'' subroutine.\n"), "dassl", "dassl")];
+msprintf(_("%ls: An error occured in ''%ls'' subroutine.\n"), "dassl", "dassl")];
assert_checkerror("y = dae([y0; 0], t0, t, f2);", refMsg);
// ==================================================================
// DASRT
// With initial yprime computation
// The evaluation function purposely lacks the output argument 'ires'
refMsg = [msprintf(_("%s: Wrong number of output argument(s): %d expected.\n"), "f1", 2);
- msprintf(_("%s: An error occured in ''%s'' subroutine.\n"), "dasrt", "ddasrt")];
+msprintf(_("%ls: An error occured in ''%ls'' subroutine.\n"), "dasrt", "ddasrt")];
assert_checkerror("[y, r] = dae(""root"", y0, t0, t, f1, 1, g);", refMsg);
// The evaluation function purposely lacks the input argument 'ydot'
refMsg = [msprintf(_("Wrong number of input arguments."));
- msprintf(_("%s: An error occured in ''%s'' subroutine.\n"), "dasrt", "ddasrt")];
+msprintf(_("%ls: An error occured in ''%ls'' subroutine.\n"), "dasrt", "ddasrt")];
assert_checkerror("[y, r] = dae(""root"", y0, t0, t, f2, 1, g);", refMsg);
// ----------------------------------
// Without initial yprime computation
// The evaluation function purposely lacks the output argument 'ires'
refMsg = [msprintf(_("%s: Wrong number of output argument(s): %d expected.\n"), "f1", 2);
- msprintf(_("%s: An error occured in ''%s'' subroutine.\n"), "dasrt", "ddasrt")];
+msprintf(_("%ls: An error occured in ''%ls'' subroutine.\n"), "dasrt", "ddasrt")];
assert_checkerror("[y, r] = dae(""root"", [y0; 0], t0, t, f1, 1, g);", refMsg);
// The evaluation function purposely lacks the input argument 'ydot'
refMsg = [msprintf(_("Wrong number of input arguments."));
- msprintf(_("%s: An error occured in ''%s'' subroutine.\n"), "dasrt", "ddasrt")];
+msprintf(_("%ls: An error occured in ''%ls'' subroutine.\n"), "dasrt", "ddasrt")];
assert_checkerror("[y, r] = dae(""root"", [y0; 0], t0, t, f2, 1, g);", refMsg);
// ==================================================================
// DASKR
// With initial yprime computation
// The evaluation function purposely lacks the output argument 'ires'
refMsg = [msprintf(_("%s: Wrong number of output argument(s): %d expected.\n"), "f1", 2);
- msprintf(_("%s: An error occured in ''%s'' subroutine.\n"), "daskr", "ddaskr")];
+msprintf(_("%ls: An error occured in ''%ls'' subroutine.\n"), "daskr", "ddaskr")];
assert_checkerror("[y, r] = dae(""root2"", y0, t0, t, f1, 1, g);", refMsg);
// The evaluation function purposely lacks the input argument 'ydot'
refMsg = [msprintf(_("Wrong number of input arguments."));
- msprintf(_("%s: An error occured in ''%s'' subroutine.\n"), "daskr", "ddaskr")];
+msprintf(_("%ls: An error occured in ''%ls'' subroutine.\n"), "daskr", "ddaskr")];
assert_checkerror("[y, r] = dae(""root2"", y0, t0, t, f2, 1, g);", refMsg);
// ----------------------------------
// Without initial yprime computation
// The evaluation function purposely lacks the output argument 'ires'
refMsg = [msprintf(_("%s: Wrong size for output argument #%d: A matrix of size %d expected.\n"), "g", 1, 1);
- msprintf(_("%s: An error occured in ''%s'' subroutine.\n"), "daskr", "ddaskr")];
+msprintf(_("%ls: An error occured in ''%ls'' subroutine.\n"), "daskr", "ddaskr")];
assert_checkerror("[y, r] = dae(""root2"", [y0; 0], t0, t, f1, 1, g);", refMsg);
// The evaluation function purposely lacks the input argument 'ydot'
assert_checkerror("[y, r] = dae(""root2"", [y0; 0], t0, t, f2, 1, g);", refMsg);
deff("ydot = f1(t, y, ydot)", "ydot = y^2 - y*sin(t) + cos(t)")
refMsg = [msprintf(_("%s: Wrong number of output argument(s): %d expected.\n"), "f1", 2);
-msprintf(_("%s: An error occured in ''%s'' subroutine.\n"), "dassl", "dassl")];
+msprintf(_("%ls: An error occured in ''%ls'' subroutine.\n"), "dassl", "dassl")];
assert_checkerror("y = dae(y0, t0, t, f1);", refMsg);
deff("[ydot,ires] = f2(t, y)", "ydot = y^2 - y*sin(t) + cos(t)");
refMsg = [msprintf(_("Wrong number of input arguments."));
-msprintf(_("%s: An error occured in ''%s'' subroutine.\n"), "dassl", "dassl")];
+msprintf(_("%ls: An error occured in ''%ls'' subroutine.\n"), "dassl", "dassl")];
assert_checkerror("y = dae(y0, t0, t, f2);", refMsg);
// ----------------------------------
// The evaluation function purposely lacks the output argument 'ires'
refMsg = [msprintf(_("%s: Wrong number of output argument(s): %d expected.\n"), "f1", 2);
-msprintf(_("%s: An error occured in ''%s'' subroutine.\n"), "dassl", "dassl")];
+msprintf(_("%ls: An error occured in ''%ls'' subroutine.\n"), "dassl", "dassl")];
assert_checkerror("y = dae([y0; 0], t0, t, f1);", refMsg);
// The evaluation function purposely lacks the input argument 'ydot'
refMsg = [msprintf(_("Wrong number of input arguments."));
-msprintf(_("%s: An error occured in ''%s'' subroutine.\n"), "dassl", "dassl")];
+msprintf(_("%ls: An error occured in ''%ls'' subroutine.\n"), "dassl", "dassl")];
assert_checkerror("y = dae([y0; 0], t0, t, f2);", refMsg);
// The evaluation function purposely lacks the output argument 'ires'
refMsg = [msprintf(_("%s: Wrong number of output argument(s): %d expected.\n"), "f1", 2);
-msprintf(_("%s: An error occured in ''%s'' subroutine.\n"), "dasrt", "ddasrt")];
+msprintf(_("%ls: An error occured in ''%ls'' subroutine.\n"), "dasrt", "ddasrt")];
assert_checkerror("[y, r] = dae(""root"", y0, t0, t, f1, 1, g);", refMsg);
// The evaluation function purposely lacks the input argument 'ydot'
refMsg = [msprintf(_("Wrong number of input arguments."));
-msprintf(_("%s: An error occured in ''%s'' subroutine.\n"), "dasrt", "ddasrt")];
+msprintf(_("%ls: An error occured in ''%ls'' subroutine.\n"), "dasrt", "ddasrt")];
assert_checkerror("[y, r] = dae(""root"", y0, t0, t, f2, 1, g);", refMsg);
// ----------------------------------
// The evaluation function purposely lacks the output argument 'ires'
refMsg = [msprintf(_("%s: Wrong number of output argument(s): %d expected.\n"), "f1", 2);
-msprintf(_("%s: An error occured in ''%s'' subroutine.\n"), "dasrt", "ddasrt")];
+msprintf(_("%ls: An error occured in ''%ls'' subroutine.\n"), "dasrt", "ddasrt")];
assert_checkerror("[y, r] = dae(""root"", [y0; 0], t0, t, f1, 1, g);", refMsg);
// The evaluation function purposely lacks the input argument 'ydot'
refMsg = [msprintf(_("Wrong number of input arguments."));
-msprintf(_("%s: An error occured in ''%s'' subroutine.\n"), "dasrt", "ddasrt")];
+msprintf(_("%ls: An error occured in ''%ls'' subroutine.\n"), "dasrt", "ddasrt")];
assert_checkerror("[y, r] = dae(""root"", [y0; 0], t0, t, f2, 1, g);", refMsg);
// The evaluation function purposely lacks the output argument 'ires'
refMsg = [msprintf(_("%s: Wrong number of output argument(s): %d expected.\n"), "f1", 2);
-msprintf(_("%s: An error occured in ''%s'' subroutine.\n"), "daskr", "ddaskr")];
+msprintf(_("%ls: An error occured in ''%ls'' subroutine.\n"), "daskr", "ddaskr")];
assert_checkerror("[y, r] = dae(""root2"", y0, t0, t, f1, 1, g);", refMsg);
// The evaluation function purposely lacks the input argument 'ydot'
refMsg = [msprintf(_("Wrong number of input arguments."));
-msprintf(_("%s: An error occured in ''%s'' subroutine.\n"), "daskr", "ddaskr")];
+msprintf(_("%ls: An error occured in ''%ls'' subroutine.\n"), "daskr", "ddaskr")];
assert_checkerror("[y, r] = dae(""root2"", y0, t0, t, f2, 1, g);", refMsg);
// ----------------------------------
// The evaluation function purposely lacks the output argument 'ires'
refMsg = [msprintf(_("%s: Wrong size for output argument #%d: A matrix of size %d expected.\n"), "g", 1, 1);
-msprintf(_("%s: An error occured in ''%s'' subroutine.\n"), "daskr", "ddaskr")];
+msprintf(_("%ls: An error occured in ''%ls'' subroutine.\n"), "daskr", "ddaskr")];
assert_checkerror("[y, r] = dae(""root2"", [y0; 0], t0, t, f1, 1, g);", refMsg);
// The evaluation function purposely lacks the input argument 'ydot'