Skip to content

Commit 3f86470

Browse files
committed
update defaults for number of workers... MATLAB=CAPITALISM
1 parent 5cdc39b commit 3f86470

File tree

4 files changed

+50
-1
lines changed

4 files changed

+50
-1
lines changed

tests/tests_batches/sub-01_T1w_seg8.mat

Whitespace-only changes.
Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
function test_suite = test_setBachRename %#ok<*STOUT>
2+
%
3+
% (C) Copyright 2022 CPP_SPM developers
4+
5+
try % assignment of 'localfunctions' is necessary in Matlab >= 2016
6+
test_functions = localfunctions(); %#ok<*NASGU>
7+
catch % no problem; early Matlab versions can use initTestSuite fine
8+
end
9+
10+
initTestSuite;
11+
12+
end
13+
14+
function test_setBachRename_basic()
15+
16+
% GIVEN
17+
filename = 'sub-01_T1w_seg8.mat';
18+
setUp(filename)
19+
20+
matlabbatch = {};
21+
files = {fullfile(pwd, filename)};
22+
moveTo = {pwd};
23+
patternReplace = struct('pattern', '_T1w_seg8.mat', ...
24+
'repl', '_label-T1w_segparam.mat');
25+
26+
% WHEN
27+
matlabbatch = setBachRename(matlabbatch, files, moveTo, patternReplace);
28+
29+
spm_jobman('run', matlabbatch)
30+
31+
% THEN
32+
expectedFile = 'sub-01_label-T1w_segparam.mat';
33+
assert(exist(fullfile(pwd, expectedFile), 'file'));
34+
35+
cleanUp(expectedFile);
36+
37+
end
38+
39+
function setUp(filename)
40+
41+
system(sprintf('touch %s', filename));
42+
43+
end
44+
45+
function cleanUp(filename)
46+
47+
delete(fullfile(pwd, filename))
48+
49+
end

tests/tests_batches/tmp.mat

616 Bytes
Binary file not shown.

tests/utils/defaultOptions.m

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@
5252
expectedOptions.result.Steps = returnDefaultResultsStructure();
5353

5454
expectedOptions.parallelize.do = false;
55-
expectedOptions.parallelize.nbWorkers = 3;
55+
expectedOptions.parallelize.nbWorkers = 2;
5656
expectedOptions.parallelize.killOnExit = false;
5757

5858
if nargin > 0

0 commit comments

Comments
 (0)