Skip to content

Commit ac872f3

Browse files
committed
[Matlab] Refactor nix.Block.create_data_array error
1 parent 180ddd3 commit ac872f3

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

+nix/Block.m

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@
8686
shape(2:size(shape, 2));
8787
end
8888

89-
err.identifier = 'Block:unsupportedDataType';
89+
err.identifier = 'NIXMX:UnsupportedDataType';
9090
if (~isa(datatype, 'nix.DataType'))
9191
err.message = 'Please provide a valid nix.DataType';
9292
error(err);
@@ -110,7 +110,7 @@
110110
shape = size(data, 2);
111111
end
112112

113-
err.identifier = 'Block:unsupportedDataType';
113+
err.identifier = 'NIXMX:UnsupportedDataType';
114114
if (ischar(data))
115115
err.message = 'Writing char/string DataArrays is currently not supported.';
116116
error(err);

tests/TestBlock.m

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -98,13 +98,13 @@
9898
try
9999
b.create_data_array('stringDataArray', dtype, nix.DataType.String, [1 5]);
100100
catch ME
101-
assert(strcmp(ME.identifier, 'Block:unsupportedDataType'));
101+
assert(strcmp(ME.identifier, 'NIXMX:UnsupportedDataType'));
102102
end;
103103

104104
try
105105
b.create_data_array('I will crash and burn', dtype, 'Thou shalt not work!', [1 5]);
106106
catch ME
107-
assert(strcmp(ME.identifier, 'Block:unsupportedDataType'));
107+
assert(strcmp(ME.identifier, 'NIXMX:UnsupportedDataType'));
108108
end;
109109

110110
da = b.create_data_array('floatDataArray', dtype, nix.DataType.Float, [3 3]);
@@ -153,13 +153,13 @@
153153
try
154154
b.create_data_array_from_data('stringDataArray', daType, ['a' 'b']);
155155
catch ME
156-
assert(strcmp(ME.identifier, 'Block:unsupportedDataType'));
156+
assert(strcmp(ME.identifier, 'NIXMX:UnsupportedDataType'));
157157
end;
158158

159159
try
160160
b.create_data_array_from_data('I will crash and burn', daType, {1 2 3});
161161
catch ME
162-
assert(strcmp(ME.identifier, 'Block:unsupportedDataType'));
162+
assert(strcmp(ME.identifier, 'NIXMX:UnsupportedDataType'));
163163
end;
164164

165165
assert(~isempty(b.dataArrays));

0 commit comments

Comments
 (0)