Mentions légales du service

Skip to content
Snippets Groups Projects
Commit 4f28eb9d authored by hhakim's avatar hhakim
Browse files

Add unit tests for pyfaust.Faust.size and equiv. matfaust.Faust.numel.

It closes #42.
parent 79dfc22d
Branches
No related tags found
No related merge requests found
...@@ -107,6 +107,13 @@ classdef FaustTest < matlab.unittest.TestCase ...@@ -107,6 +107,13 @@ classdef FaustTest < matlab.unittest.TestCase
this.verifyEqual(num_cols, size_last_fac(2)) this.verifyEqual(num_cols, size_last_fac(2))
end end
function testNumel(this)
disp('testNumel()')
test_numel = numel(this.test_faust);
ref_numel = numel(this.mulFactors());
this.verifyEqual(test_numel, ref_numel)
end
function testGetFactorAndConstructor(this) function testGetFactorAndConstructor(this)
disp('testGetFactorAndConstructor()') disp('testGetFactorAndConstructor()')
for i = 1:this.num_factors for i = 1:this.num_factors
......
...@@ -304,9 +304,15 @@ class TestFaustPy(unittest.TestCase): ...@@ -304,9 +304,15 @@ class TestFaustPy(unittest.TestCase):
os.remove(test_file) os.remove(test_file)
os.remove(ref_file) os.remove(ref_file)
def testShape(self):
print("testShape()")
self.assertEqual((self.F.shape[0],self.F.shape[1]), self.F.shape)
def testSize(self): def testSize(self):
print("testSize()") print("testSize()")
self.assertEqual((self.F.shape[0],self.F.shape[1]), self.F.shape) test_size = self.F.size
ref_size = self.mulFactors().size
self.assertEqual(test_size,ref_size)
def testDelete(self): def testDelete(self):
print("Test del Faust") print("Test del Faust")
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment