From a17e12a53c0063e36fb017b7a545d605e2c2ef8e Mon Sep 17 00:00:00 2001 From: Remi Gau Date: Sun, 2 Aug 2020 21:38:41 +0200 Subject: [PATCH 1/2] remove commented out section from travis file --- .travis.yml | 3 --- 1 file changed, 3 deletions(-) diff --git a/.travis.yml b/.travis.yml index 16d3b453..1aee0e77 100644 --- a/.travis.yml +++ b/.travis.yml @@ -36,9 +36,6 @@ before_script: jobs: include: - # - stage: "Tests" - # name: "Unit and integration Tests" - # script: octave $OCTFLAGS --eval "results = runTests; assert(all(~[results.Failed]))" - stage: "BIDS validator" name: "Create and check dataset" script: octave $OCTFLAGS --eval "test_makeRawDataset" && bids-validator `pwd`/output/rawdata/ --ignoreNiftiHeaders From 644689aafba550721353194018746a6febc19374 Mon Sep 17 00:00:00 2001 From: Remi Gau Date: Mon, 3 Aug 2020 17:06:01 +0200 Subject: [PATCH 2/2] simplify unit test for checkCFG make use of mox unit functions --- tests/test_checkCFG.m | 36 +++--------------------------------- 1 file changed, 3 insertions(+), 33 deletions(-) diff --git a/tests/test_checkCFG.m b/tests/test_checkCFG.m index f82a1171..6ac50b99 100644 --- a/tests/test_checkCFG.m +++ b/tests/test_checkCFG.m @@ -18,7 +18,7 @@ function test_checkCfgDefault() expectedStructure.testingDevice = 'pc'; %% test - checkSubFields(expectedStructure, cfg); + assertEqual(expectedStructure, cfg); end @@ -73,7 +73,7 @@ function test_checkCfgBasic() expectedStructure = orderfields(expectedStructure); %% test - checkSubFields(expectedStructure, cfg); + assertEqual(expectedStructure, cfg); end @@ -124,34 +124,4 @@ function test_checkCfgBasic() expectedCfgStructure = orderfields(expectedCfgStructure); -end - -function checkSubFields(expectedStructure, cfg) - % check that that the structures match - % if it fails it check from which subfield the error comes from - - try - - assertEqual(expectedStructure, cfg); - - catch ME - - if isstruct(expectedStructure) - - names = fieldnames(expectedStructure); - - for i = 1:numel(names) - - disp(names{i}); - testSubFields(expectedStructure.(names{i}), cfg.(names{i})); - - end - - end - - disp(expectedStructure); - disp(cfg); - - rethrow(ME); - end -end +end \ No newline at end of file