Skip to content

Commit df822ed

Browse files
authored
Merge pull request #409 from A-Baji/read-32-bit-flag
requested changes
2 parents b175f13 + 4c56853 commit df822ed

File tree

6 files changed

+37
-31
lines changed

6 files changed

+37
-31
lines changed

+dj/+internal/Settings.m

+1-1
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@
5959
if nargin == 2
6060
new_state = subsasgn(current_state, subscript, value);
6161
stateAccess('set', new_state);
62-
if strcmp(subscript(1).subs, 'use_32bit_dims')%~isempty(subscript(1).subs) && strcmp(subscript(1).subs, 'use_32bit_dims')
62+
if strcmp(subscript(1).subs, 'use_32bit_dims')
6363
ternary = @(varargin)varargin{end-varargin{1}};
6464
setenv('MYM_USE_32BIT_DIMS', ternary(value, 'true', 'false'));
6565
end

docs-parts/intro/Releases_lang1.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
3.5.0 -- TBD
1+
3.5.0 -- March 21, 2022
22
--------------------------
33
* Bugfix: Cascading delete for renamed foreign keys (#379) PR #386
44
* Minor: Add renaming the same attribute multiple times within a single projection PR #386

local-docker-compose.yaml

+1
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,7 @@ services:
8383
- /bin/bash
8484
- -c
8585
- |
86+
set -e
8687
ORIG_DIR=$$(pwd)
8788
mkdir ~/Documents
8889
cd /src

tests/Main.m

+2-1
Original file line numberDiff line numberDiff line change
@@ -12,5 +12,6 @@
1212
TestRelationalOperand & ...
1313
TestSchema & ...
1414
TestTls & ...
15-
TestUuid
15+
TestUuid & ...
16+
TestBlob
1617
end

tests/TestBlob.m

+32
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
classdef TestBlob < Prep
2+
methods (Test)
3+
function TestBlob_test32BitRead(testCase)
4+
st = dbstack;
5+
disp(['---------------' st(1).name '---------------']);
6+
value = ['6D596D005302000000010000000100000004000000686974730073696465730074' ...
7+
'61736B73007374616765004D00000041020000000100000007000000060000000000000' ...
8+
'0000000000000F8FF000000000000F03F000000000000F03F0000000000000000000000' ...
9+
'000000F03F0000000000000000000000000000F8FF23000000410200000001000000070' ...
10+
'0000004000000000000006C006C006C006C00720072006C002300000041020000000100' ...
11+
'00000700000004000000000000006400640064006400640064006400250000004102000' ...
12+
'0000100000008000000040000000000000053007400610067006500200031003000'];
13+
hexstring = value';
14+
reshapedString = reshape(hexstring,2,length(value)/2);
15+
hexMtx = reshapedString.';
16+
decMtx = hex2dec(hexMtx);
17+
packed = uint8(decMtx);
18+
19+
data = struct;
20+
data.stage = 'Stage 10';
21+
data.tasks = 'ddddddd';
22+
data.sides = 'llllrrl';
23+
data.hits = [NaN,1,1,0,1,0,NaN];
24+
25+
dj.config('use_32bit_dims', true);
26+
unpacked = mym('deserialize', packed);
27+
dj.config('use_32bit_dims', false);
28+
29+
testCase.verifyEqual(unpacked, data);
30+
end
31+
end
32+
end

tests/TestExternalFile.m

-28
Original file line numberDiff line numberDiff line change
@@ -157,33 +157,5 @@ function TestExternalFile_testMD5Hash(testCase)
157157
uuid = dj.lib.DataHash(packed_cell{1}, 'bin', 'hex', 'MD5');
158158
testCase.verifyEqual(uuid, '1d751e2e1e74faf84ab485fde8ef72be');
159159
end
160-
function TestExternalFile_test32BitRead(testCase)
161-
st = dbstack;
162-
disp(['---------------' st(1).name '---------------']);
163-
value = ['6D596D005302000000010000000100000004000000686974730073696465730074' ...
164-
'61736B73007374616765004D00000041020000000100000007000000060000000000000' ...
165-
'0000000000000F8FF000000000000F03F000000000000F03F0000000000000000000000' ...
166-
'000000F03F0000000000000000000000000000F8FF23000000410200000001000000070' ...
167-
'0000004000000000000006C006C006C006C00720072006C002300000041020000000100' ...
168-
'00000700000004000000000000006400640064006400640064006400250000004102000' ...
169-
'0000100000008000000040000000000000053007400610067006500200031003000'];
170-
hexstring = value';
171-
reshapedString = reshape(hexstring,2,length(value)/2);
172-
hexMtx = reshapedString.';
173-
decMtx = hex2dec(hexMtx);
174-
packed = uint8(decMtx);
175-
176-
data = struct;
177-
data.stage = 'Stage 10';
178-
data.tasks = 'ddddddd';
179-
data.sides = 'llllrrl';
180-
data.hits = [NaN,1,1,0,1,0,NaN];
181-
182-
dj.config('use_32bit_dims', true);
183-
unpacked = mym('deserialize', packed);
184-
dj.config('use_32bit_dims', false);
185-
186-
testCase.verifyEqual(unpacked, data);
187-
end
188160
end
189161
end

0 commit comments

Comments
 (0)