Skip to content

Commit

Permalink
matlab bindings: Update to channel attributes test
Browse files Browse the repository at this point in the history
  • Loading branch information
SrikanthPagadarai committed Jan 23, 2025
1 parent be67cb3 commit 3bfad56
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions bindings/matlab/test/testChannelAttributes.m
Original file line number Diff line number Diff line change
Expand Up @@ -31,22 +31,23 @@ function testPlutoChannelAttributes(testCase)

%% Double
% Read from Channel Attribute
[status, attrName, result] = iioReadChannelAttributeDouble(testCase.uri{1}, testCase.phyDev{1}, testCase.chnParamsDouble{1}, testCase.chnParamsDouble{2}, testCase.chnParamsDouble{3});
[status, chnDataFormatPtr, attrName, result] = iioReadChannelAttributeDouble(testCase.uri{1}, testCase.phyDev{1}, testCase.chnParamsDouble{1}, testCase.chnParamsDouble{2}, testCase.chnParamsDouble{3});
assert(~chnDataFormatPtr.isNull);
assert(strcmp(attrName, testCase.chnParamsDouble{3}));
assert(status==0);
OrigValue = result;

% Write to Channel Attribute and Verify Value is Written
status = iioWriteChannelAttributeDouble(testCase.uri{1}, testCase.phyDev{1}, testCase.chnParamsDouble{1}, testCase.chnParamsDouble{2}, testCase.chnParamsDouble{3}, testCase.chnParamsDouble{4});
assert(status==0);
[status, ~, result] = iioReadChannelAttributeDouble(testCase.uri{1}, testCase.phyDev{1}, testCase.chnParamsDouble{1}, testCase.chnParamsDouble{2}, testCase.chnParamsDouble{3});
[status, ~, ~, result] = iioReadChannelAttributeDouble(testCase.uri{1}, testCase.phyDev{1}, testCase.chnParamsDouble{1}, testCase.chnParamsDouble{2}, testCase.chnParamsDouble{3});
assert(status==0);
assert(result==testCase.chnParamsDouble{4});

% Write Original Value to Channel Attribute and Verify Value is Written
status = iioWriteChannelAttributeDouble(testCase.uri{1}, testCase.phyDev{1}, testCase.chnParamsDouble{1}, testCase.chnParamsDouble{2}, testCase.chnParamsDouble{3}, OrigValue);
assert(status==0);
[status, ~, result] = iioReadChannelAttributeDouble(testCase.uri{1}, testCase.phyDev{1}, testCase.chnParamsDouble{1}, testCase.chnParamsDouble{2}, testCase.chnParamsDouble{3});
[status, ~, ~, result] = iioReadChannelAttributeDouble(testCase.uri{1}, testCase.phyDev{1}, testCase.chnParamsDouble{1}, testCase.chnParamsDouble{2}, testCase.chnParamsDouble{3});
assert(status==0);
assert(result==OrigValue);

Expand Down

0 comments on commit 3bfad56

Please sign in to comment.