% Regression test function (black blox) for FreeMat v3.5
% This function is autogenerated by helpgen.
function bbtest_success = bbtest_threadstart
  bbtest_success = 1;
NumErrors = 0;
try
  a = threadnew;                         % Create the thread

catch
  NumErrors = NumErrors + 1;
end
try
  threadstart(a,'system',1,'ls -lrt /'); % Start the thread

catch
  NumErrors = NumErrors + 1;
end
try
  b = rand(100)\rand(100,1);             % Solve some equations simultaneously

catch
  NumErrors = NumErrors + 1;
end
try
  c = threadvalue(a);                    % Retrieve the file list

catch
  NumErrors = NumErrors + 1;
end
try
  size(c)                                % It is large!

catch
  NumErrors = NumErrors + 1;
end
try
  threadfree(a);

catch
  NumErrors = NumErrors + 1;
end
if (NumErrors ~= 0) bbtest_success = 0; return; end
NumErrors = 0;
try
  A = float(rand(4))

catch
  NumErrors = NumErrors + 1;
end
try
  [u,s,v] = svd(A)    % Compute the full decomposition

catch
  NumErrors = NumErrors + 1;
end
try
  sigmas = svd(A)     % Only want the singular values

catch
  NumErrors = NumErrors + 1;
end
if (NumErrors ~= 0) bbtest_success = 0; return; end
NumErrors = 0;
try
  a = threadnew;               % Create the thread

catch
  NumErrors = NumErrors + 1;
end
try
  threadstart(a,'svd',3,A);    % Start a full decomposition 

catch
  NumErrors = NumErrors + 1;
end
try
  [u1,s1,v1] = threadvalue(a); % Retrieve the function values

catch
  NumErrors = NumErrors + 1;
end
try
  threadfree(a);

catch
  NumErrors = NumErrors + 1;
end
if (NumErrors ~= 0) bbtest_success = 0; return; end
NumErrors = 0;
try
  a = threadnew;

catch
  NumErrors = NumErrors + 1;
end
try
  threadstart(a,'svd',1,A);

catch
  NumErrors = NumErrors + 1;
end
try
  sigmas = threadvalue(a);

catch
  NumErrors = NumErrors + 1;
end
try
  threadfree(a)

catch
  NumErrors = NumErrors + 1;
end
if (NumErrors ~= 0) bbtest_success = 0; return; end
