Skip to content
Snippets Groups Projects
SCDalgo_test.m 1.31 KiB
Newer Older
classdef SCDalgo_test < SCDtest
  
  properties (Abstract=true)
    algoobj % SCD algo obj name - abstract allows modification by sub-class
  end
  
  methods (TestClassSetup)
    function clear_base(testCase)
      % clear base workspace
      testCase.assertWarningFree(@() evalin('base','clear'));
    end
    
    function clear_sldd(testCase)
      SCD.clean_dd
      testCase.assertTrue(true);
    end
    
    function setup_conf(testCase)
      testCase.assertWarningFree(@() SCDconf_setConf('SIM'));
    function setup_algo(testCase)
      testCase.assertInstanceOf(testCase.algoobj,'SCDclass_algo');
      testCase.algoobj.init; % init data dictionary & fixed params
    end 
  end
  
  methods (TestClassTeardown)
    function close_dd(testCase) %#ok<MANU>
      Simulink.data.dictionary.closeAll('-discard');
    end
    
    function close_bd(testCase) %#ok<MANU>
      bdclose all;
    end

    function test_printinfo(testCase)
      testCase.algoobj.printinfo;
      testCase.algoobj.setup; % setup tunable parameters
    end
    
    function test_compile(testCase)
      testCase.algoobj.compile; % update model (Ctrl-D) Simulink
    function test_test_harness(testCase)
      testCase.algoobj.test_harness;