diff options
author | ananmaysuri2000@gmail.com | 2021-05-11 23:36:36 +0530 |
---|---|---|
committer | ananmaysuri2000@gmail.com | 2021-05-11 23:36:36 +0530 |
commit | d8bc1ab06ffaa8644c16f01c22a9d3df6b5ede1e (patch) | |
tree | dc7a630f1da4714dc9a94d548585405e6f75e9a0 | |
parent | 587b557257d7c5324d5c6378d84acb354e67c846 (diff) | |
download | fossee-scilab-octave-toolbox-d8bc1ab06ffaa8644c16f01c22a9d3df6b5ede1e.tar.gz fossee-scilab-octave-toolbox-d8bc1ab06ffaa8644c16f01c22a9d3df6b5ede1e.tar.bz2 fossee-scilab-octave-toolbox-d8bc1ab06ffaa8644c16f01c22a9d3df6b5ede1e.zip |
added tests for structure and string support
-rw-r--r-- | .travis.yml | 3 | ||||
-rw-r--r-- | tests/test.sce | 55 |
2 files changed, 58 insertions, 0 deletions
diff --git a/.travis.yml b/.travis.yml index 6793a59..a740f4f 100644 --- a/.travis.yml +++ b/.travis.yml @@ -10,6 +10,9 @@ addons: - build-essential - liboctave-dev - octave-signal + - octave-struct + - octave-communications + - octave-strings script: - cd $TRAVIS_BUILD_DIR/ diff --git a/tests/test.sce b/tests/test.sce index b3a7993..edae0e7 100644 --- a/tests/test.sce +++ b/tests/test.sce @@ -370,6 +370,61 @@ else disp("cheb2ord Test failed") end +/////////Test case for base64encode ////////// + +s = octave_fun("base64encode","strings","Hakuna Matata","true"); + +if(s == "SGFrdW5hIE1hdGF0YQ==") + test_pass=[test_pass,1] +else + test_pass=[test_pass,0] + disp("base64encode Test failed") +end + +/////////Test case for getfields ////////// + +st = struct('double',25.25,'string','c++','complex',4 + 3*%i,'matrix',[1 2 3.56;4 5 6*%i]); +[od,os,oc,om] = octave_fun("getfields","struct",st,'double','string','complex','matrix'); + +if(od == 25.25 & os == "c++" & oc == 4 + 3*%i & om == [1 2 3.56;4 5 6*%i]) + test_pass=[test_pass,1] +else + test_pass=[test_pass,0] + disp("getfields Test failed") +end + +/////////Test case for options ////////// + +opt = octave_fun("options","control","string","c++","double",25.25,"complex",4 + 3*%i,"matrix",[1 2 3.56;4 5 6*%i]) + +if(opt.string == "c++" & opt.double == 25.25 & opt.complex == 4 + 3*%i & opt.matrix == [1 2 3.56;4 5 6*%i]) + test_pass=[test_pass,1] +else + test_pass=[test_pass,0] + disp("options Test failed") +end + +/////////Test case for poly2trellis ////////// + +trellis = octave_fun("poly2trellis","communications",[4 3],[4 5 17;7 4 2]); + +if(trellis.numInputSymbols == 4) + test_pass=[test_pass,1] +else + test_pass=[test_pass,0] + disp("poly2trellis Test failed") +end + +/////////Test case for convenc ////////// + +//code = octave_fun("convenc","communications",ones(100,1),trellis); + +//if(size(code) == [150 1]) +// test_pass=[test_pass,1] +//else +// test_pass=[test_pass,0] +// disp("convenc Test failed") +//end ///////////////////////////////////////////// res=find(test_pass==0) |