Skip to content

Commit 1c1998f

Browse files
committed
fixed up unittests
1 parent 058f283 commit 1c1998f

1 file changed

Lines changed: 15 additions & 15 deletions

File tree

+nla/+edge/unittests/MultiLevelPermutationTest.m

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
methods (TestMethodSetup)
88
function loadTestData(testCase)
99
testCase.test_options = struct();
10-
testCase.test_options.func_conn.v = [1:10].*ones(10,1);
10+
testCase.test_options.behavior = [1:10]';
1111
end
1212
end
1313

@@ -19,29 +19,29 @@ function clearTestData(testCase)
1919

2020
methods (Test)
2121
function testPermutationNode(testCase)
22-
node = nla.edge.permutationMethods.tree.PermutationNode(0, testCase.test_options.func_conn.v, []);
22+
node = nla.edge.permutationMethods.tree.PermutationNode(0, testCase.test_options.behavior, []);
2323
testCase.verifyEqual(node.level, 0);
2424
testCase.verifyEqual(node.children, []);
2525
testCase.verifyEqual(node.parent, false);
2626
testCase.verifyEqual(node.original_data, node.data_with_indexes);
27-
expected_original_data = {[1:10].*ones(10, 1), 1:10, 1:10};
27+
expected_original_data = {[1:10]', [1:10]'};
2828
testCase.verifyEqual(node.original_data, expected_original_data);
2929
end
3030

3131
function testPermutationTree(testCase)
32-
tree = nla.edge.permutationMethods.tree.PermutationTree(testCase.test_options.func_conn.v, []);
32+
tree = nla.edge.permutationMethods.tree.PermutationTree(testCase.test_options.behavior, []);
3333
testCase.verifyClass(tree, 'nla.edge.permutationMethods.tree.PermutationTree');
3434
testCase.verifyClass(tree.root_node, 'nla.edge.permutationMethods.tree.PermutationNode');
3535
end
3636

3737
function testTwoPermutationGroups(testCase)
3838
testCase.test_options.permutation_groups = [1; 1; 1; 1; 1; 2; 2; 2; 2; 2];
39-
tree = nla.edge.permutationMethods.tree.PermutationTree(testCase.test_options.func_conn.v, testCase.test_options.permutation_groups);
39+
tree = nla.edge.permutationMethods.tree.PermutationTree(testCase.test_options.behavior, testCase.test_options.permutation_groups);
4040
testCase.verifyEqual(size(tree.root_node.children, 2), 2);
4141
testCase.verifyEqual(tree.root_node, tree.root_node.children(1).parent);
4242
testCase.verifyEqual(tree.root_node, tree.root_node.children(2).parent);
43-
testCase.verifyEqual(tree.root_node.children(1).original_data{3}, [1:5]);
44-
testCase.verifyEqual(tree.root_node.children(2).original_data{3}, [6:10]);
43+
testCase.verifyEqual(tree.root_node.children(1).original_data{2}, [1:5]');
44+
testCase.verifyEqual(tree.root_node.children(2).original_data{2}, [6:10]');
4545
end
4646

4747
function testMultiLevel(testCase)
@@ -62,9 +62,9 @@ function testPermute(testCase)
6262

6363
original_options = testCase.test_options;
6464
permuted_options = multi_level.permute(testCase.test_options);
65-
testCase.verifyNotEqual(permuted_options.func_conn, original_options.func_conn);
66-
testCase.verifyEqual(sort(permuted_options.func_conn.v(1, 1:5)), 1:5);
67-
testCase.verifyEqual(sort(permuted_options.func_conn.v(1, 6:10)), 6:10);
65+
testCase.verifyNotEqual(permuted_options.behavior, original_options.behavior);
66+
testCase.verifyEqual(sort(permuted_options.behavior(1:5)), [1:5]');
67+
testCase.verifyEqual(sort(permuted_options.behavior(6:10)), [6:10]');
6868
end
6969

7070
function testMultiLevelTwoLevels(testCase)
@@ -88,11 +88,11 @@ function testMultiLevelPermute(testCase)
8888

8989
original_options = testCase.test_options;
9090
permuted_options = multi_level.permute(testCase.test_options);
91-
testCase.verifyNotEqual(permuted_options.func_conn, original_options.func_conn);
92-
testCase.verifyEqual(sort(permuted_options.func_conn.v(1, 1:2)), 1:2);
93-
testCase.verifyEqual(sort(permuted_options.func_conn.v(1, 3:5)), 3:5);
94-
testCase.verifyEqual(sort(permuted_options.func_conn.v(1, 6:8)), 6:8);
95-
testCase.verifyEqual(sort(permuted_options.func_conn.v(1, 9:10)), 9:10);
91+
testCase.verifyNotEqual(permuted_options.behavior, original_options.behavior);
92+
testCase.verifyEqual(sort(permuted_options.behavior(1:2)), [1:2]');
93+
testCase.verifyEqual(sort(permuted_options.behavior(3:5)), [3:5]');
94+
testCase.verifyEqual(sort(permuted_options.behavior(6:8)), [6:8]');
95+
testCase.verifyEqual(sort(permuted_options.behavior(9:10)), [9:10]');
9696
end
9797
end
9898
end

0 commit comments

Comments
 (0)