Skip to content

Commit c5cb907

Browse files
committed
[Matlab] Refactor Property function names
- Refactors all Property function names to CamelCase. - Refactors all affected tests. - Renames 'values_delete' to 'deleteValues'.
1 parent 75eba69 commit c5cb907

File tree

2 files changed

+18
-18
lines changed

2 files changed

+18
-18
lines changed

+nix/Property.m

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,11 +57,11 @@
5757
nix_mx(fname, obj.nix_handle, values);
5858
end
5959

60-
function r = value_count(obj)
60+
function r = valueCount(obj)
6161
r = nix.Utils.fetchEntityCount(obj, 'valueCount');
6262
end
6363

64-
function [] = values_delete(obj)
64+
function [] = deleteValues(obj)
6565
fname = strcat(obj.alias, '::deleteValues');
6666
nix_mx(fname, obj.nix_handle);
6767
end

tests/TestProperty.m

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -10,16 +10,16 @@
1010
% TESTPROPERTY % Tests for the nix.Property object
1111

1212
funcs = {};
13-
funcs{end+1} = @test_attrs;
14-
funcs{end+1} = @test_update_values;
15-
funcs{end+1} = @test_values;
16-
funcs{end+1} = @test_value_count;
17-
funcs{end+1} = @test_values_delete;
18-
funcs{end+1} = @test_property_compare;
13+
funcs{end+1} = @testAttributes;
14+
funcs{end+1} = @testUpdateValues;
15+
funcs{end+1} = @testValues;
16+
funcs{end+1} = @testValueCount;
17+
funcs{end+1} = @testDeleteValues;
18+
funcs{end+1} = @testCompare;
1919
end
2020

2121
%% Test: Access Attributes
22-
function [] = test_attrs( varargin )
22+
function [] = testAttributes( varargin )
2323
f = nix.File(fullfile(pwd, 'tests', 'testRW.h5'), nix.FileMode.Overwrite);
2424
s = f.createSection('testSectionProperty', 'nixSection');
2525
p = s.createProperty('testProperty1', nix.DataType.String);
@@ -46,7 +46,7 @@
4646
end
4747

4848
%% Test: Access values
49-
function [] = test_values( varargin )
49+
function [] = testValues( varargin )
5050
f = nix.File(fullfile(pwd,'tests','testRW.h5'), nix.FileMode.Overwrite);
5151
s = f.createSection('mainSection', 'nixSection');
5252
currProp = s.createPropertyWithValue('booleanProperty', {true, false, true});
@@ -57,7 +57,7 @@
5757
end
5858

5959
%% Test: Update values and uncertainty
60-
function [] = test_update_values( varargin )
60+
function [] = testUpdateValues( varargin )
6161
f = nix.File(fullfile(pwd,'tests','testRW.h5'), nix.FileMode.Overwrite);
6262
s = f.createSection('mainSection', 'nixSection');
6363

@@ -108,31 +108,31 @@
108108
end
109109

110110
%% Test: Value count
111-
function [] = test_value_count( varargin )
111+
function [] = testValueCount( varargin )
112112
testFile = fullfile(pwd, 'tests', 'testRW.h5');
113113
f = nix.File(testFile, nix.FileMode.Overwrite);
114114
s = f.createSection('testSection', 'nixSection');
115115
p = s.createPropertyWithValue('booleanProperty', {true, false, true});
116116

117-
assert(p.value_count() == 3);
117+
assert(p.valueCount() == 3);
118118
p.values = {};
119-
assert(p.value_count() == 0);
119+
assert(p.valueCount() == 0);
120120
p.values = {false};
121121

122122
clear p s f;
123123
f = nix.File(testFile, nix.FileMode.ReadOnly);
124-
assert(f.sections{1}.properties{1}.value_count() == 1);
124+
assert(f.sections{1}.properties{1}.valueCount() == 1);
125125
end
126126

127127
%% Test: Delete values
128-
function [] = test_values_delete( varargin )
128+
function [] = testDeleteValues( varargin )
129129
testFile = fullfile(pwd,'tests','testRW.h5');
130130
f = nix.File(testFile, nix.FileMode.Overwrite);
131131
s = f.createSection('testSection', 'nixSection');
132132

133133
p = s.createPropertyWithValue('property1', {true, false, true});
134134
assert(~isempty(p.values));
135-
p.values_delete();
135+
p.deleteValues();
136136
assert(isempty(p.values));
137137

138138
clear p s f;
@@ -141,7 +141,7 @@
141141
end
142142

143143
%% Test: Compare properties
144-
function [] = test_property_compare( varargin )
144+
function [] = testCompare( varargin )
145145
testFile = fullfile(pwd, 'tests', 'testRW.h5');
146146
f = nix.File(testFile, nix.FileMode.Overwrite);
147147
s1 = f.createSection('testSection1', 'nixSection');

0 commit comments

Comments
 (0)