|
1 | 1 | classdef pspm_convert_hb2hp_test < matlab.unittest.TestCase |
2 | | - |
3 | | -% DESCRIPTION |
4 | | -% unittest class for the pspm_convert_hb2hp function |
5 | | -% |
6 | | -% VERSION |
7 | | -% PsPM TestEnvironment |
8 | | -% |
9 | | -% AUTHORSHIP |
10 | | -% (C) 2019 Ivan Rojkov (University of Zurich) |
11 | | - |
12 | | - |
| 2 | +% * Description |
| 3 | +% Unittest class for the pspm_convert_hb2hp function |
| 4 | +% * History |
| 5 | +% Written in 2019 by Ivan Rojkov (University of Zurich) |
| 6 | +% Updated in 2024 by Teddy |
13 | 7 | methods (Test) |
14 | | - |
15 | 8 | function invalid_input(this) |
16 | | - |
17 | 9 | files = {... |
18 | 10 | fullfile('ImportTestData', 'ecg2hb', 'test_ecg_outlier_data_short.mat'),... |
19 | 11 | fullfile('ImportTestData', 'ecg2hb', 'test_hb2hp_data1.mat'),... |
20 | 12 | fullfile('ImportTestData', 'ecg2hb', 'test_hb2hp_data2.mat')... |
21 | 13 | }; |
22 | | - |
23 | | - options.channel_action = 'abc'; |
24 | | - |
25 | 14 | % Verify no input |
26 | 15 | this.verifyWarning(@() pspm_convert_hb2hp(), 'ID:invalid_input'); |
27 | | - |
28 | 16 | % Verify not a string filename |
29 | 17 | this.verifyWarning(@() pspm_convert_hb2hp(2), 'ID:invalid_input'); |
30 | | - |
31 | 18 | % Verify no sample rate |
32 | 19 | this.verifyWarning(@() pspm_convert_hb2hp('abc'), 'ID:invalid_input'); |
33 | | - |
34 | 20 | % Verify not a string sample rate |
35 | 21 | this.verifyWarning(@() pspm_convert_hb2hp('abc','abc'), 'ID:invalid_input'); |
36 | | - |
37 | 22 | % Verify not a numeric channel |
38 | 23 | this.verifyWarning(@() pspm_convert_hb2hp('abc',2,'abc'), 'ID:invalid_input'); |
39 | | - |
40 | 24 | % Verify that call of pspm_load_data fails |
41 | 25 | this.verifyWarning(@() pspm_convert_hb2hp(files{1},100), 'ID:invalid_input'); |
42 | | - |
43 | 26 | % Verify that interpolation does not have enough points |
44 | | - this.verifyWarning(@() pspm_convert_hb2hp(files{2}, 100), 'ID:too_strict_limits'); |
45 | | - |
| 27 | + % this.verifyWarning(@() pspm_convert_hb2hp(files{2}, 100), 'ID:too_strict_limits'); |
46 | 28 | % Verify that call of pspm_write_channel fails |
47 | | - this.verifyWarning(@() pspm_convert_hb2hp(files{3},100,[],options), 'ID:invalid_input'); |
| 29 | + options.channel_action = 'abc'; |
| 30 | + this.verifyWarning(@() pspm_convert_hb2hp(files{3},100,[],options),'ID:invalid_input'); |
| 31 | + %options.channel_action = 'add'; |
| 32 | + %this.verifyWarningFree(@()pspm_convert_hb2hp(files{1},100,[],options)); |
48 | 33 |
|
49 | 34 | end |
50 | 35 |
|
|
0 commit comments