Commit 9b500a15 by Valera Rozuvan Committed by Alexander Kryklia

Added extra test checks for GST.

parent b8ea29c0
...@@ -270,6 +270,7 @@ define('Graph', ['logme'], function (logme) { ...@@ -270,6 +270,7 @@ define('Graph', ['logme'], function (logme) {
xrange.min = Function.apply(null, allParamNames); xrange.min = Function.apply(null, allParamNames);
} catch (err) { } catch (err) {
logme('ERROR: could not create a function from the string "' + config.plot.xrange.min + '" for xrange.min.'); logme('ERROR: could not create a function from the string "' + config.plot.xrange.min + '" for xrange.min.');
logme('Error message: "' + err.message + '"');
return false; return false;
} }
...@@ -280,6 +281,7 @@ define('Graph', ['logme'], function (logme) { ...@@ -280,6 +281,7 @@ define('Graph', ['logme'], function (logme) {
xrange.max = Function.apply(null, allParamNames); xrange.max = Function.apply(null, allParamNames);
} catch (err) { } catch (err) {
logme('ERROR: could not create a function from the string "' + config.plot.xrange.max + '" for xrange.max.'); logme('ERROR: could not create a function from the string "' + config.plot.xrange.max + '" for xrange.max.');
logme('Error message: "' + err.message + '"');
return false; return false;
} }
...@@ -447,6 +449,7 @@ define('Graph', ['logme'], function (logme) { ...@@ -447,6 +449,7 @@ define('Graph', ['logme'], function (logme) {
funcString + funcString +
'" was not converted by the Function constructor.' '" was not converted by the Function constructor.'
); );
logme('Error message: "' + err.message + '"');
paramNames.pop(); paramNames.pop();
paramNames.pop(); paramNames.pop();
...@@ -529,8 +532,22 @@ define('Graph', ['logme'], function (logme) { ...@@ -529,8 +532,22 @@ define('Graph', ['logme'], function (logme) {
// JSON. // JSON.
c1 = 0; c1 = 0;
try {
start = xrange.min.apply(window, paramValues); start = xrange.min.apply(window, paramValues);
} catch (err) {
logme('ERROR: Could not determine xrange start.');
logme('Error message: "' + err.message + '".');
return false;
}
try {
end = xrange.max.apply(window, paramValues); end = xrange.max.apply(window, paramValues);
} catch (err) {
logme('ERROR: Could not determine xrange end.');
logme('Error message: "' + err.message + '".');
return false;
}
step = (end - start) / (numPoints - 1); step = (end - start) / (numPoints - 1);
// Generate the data points. // Generate the data points.
...@@ -568,7 +585,14 @@ define('Graph', ['logme'], function (logme) { ...@@ -568,7 +585,14 @@ define('Graph', ['logme'], function (logme) {
if (c1 != numPoints) { if (c1 != numPoints) {
x = end; x = end;
paramValues.push(x); paramValues.push(x);
try {
y = functionObj.func.apply(window, paramValues); y = functionObj.func.apply(window, paramValues);
} catch (err) {
logme('ERROR: Could not generate data.');
logme('Error message: "' + err.message + '".');
return false;
}
paramValues.pop(); paramValues.pop();
dataPoints.push([x, y]); dataPoints.push([x, y]);
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment