Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/unit-testing/4.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
在Matlab 2016B中通过的单元测试在Mablab 2017A预发布中失败:TestParameter未定义_Matlab_Unit Testing - Fatal编程技术网

在Matlab 2016B中通过的单元测试在Mablab 2017A预发布中失败:TestParameter未定义

在Matlab 2016B中通过的单元测试在Mablab 2017A预发布中失败:TestParameter未定义,matlab,unit-testing,Matlab,Unit Testing,我有一个单元测试类heyrarchy: classdef TFbe < ITAlgo % concrete class classdef ( Abstract ) ITAlgo < matlab.unittest.TestCase % abstract class 和一个抽象测试函数: run_time ( testCase ) ; 抽象函数在CFbe中实现,此实现调用do_run_time。 这在Matlab2016b(Windows7,64位版本)中运行良好,测试通过。

我有一个单元测试类heyrarchy:

classdef TFbe <  ITAlgo % concrete class
classdef  ( Abstract ) ITAlgo < matlab.unittest.TestCase % abstract class
和一个抽象测试函数:

run_time ( testCase ) ;
抽象函数在CFbe中实现,此实现调用do_run_time。 这在Matlab2016b(Windows7,64位版本)中运行良好,测试通过。 现在,我下载了新的Matlab2017a预发行版(Windows7,64位版本),但失败了

我得到以下错误(橙色字体):

警告:具体类TFbe未定义TestParameter属性 do_运行时方法的命名参数。或者实现该属性 或者将类定义为抽象类。此警告将成为中的错误 未来版本。 警告:具体类TFbe未定义 TestParameter属性,名为do_运行时的num_of_迭代次数 方法。实现属性或将类定义为抽象类。 此警告将在将来的版本中成为错误

然后我得到错误消息(红色字体):

错误使用 matlab.unittest.internal.parameters.validateParametersExistForInputArguments>validateParameters (第18行)具体类TFbe未定义TestParameter属性 do_运行时方法的命名参数。或者实现该属性 或者将类定义为抽象类

错误 matlab.unittest.internal.parameters.validateParametersExistForInputArguments (第5行)validateParameters(testClass,'Test','TestParameter')

matlab.unittest.Test.fromTestCase中的错误(第268行) 验证输入参数的参数列表(testClass)

matlab.unittest.internal.RunnableTestContent/run中出错(第51行) suite=Test.fromTestCase(testCase,varargin{:})


与版本2016B相比有什么变化

什么是名为args的TestParameter属性?(它们被描述为“试验参数规范 “-那是什么?)

要在版本2017A预发行版中运行测试,我需要更改什么

谢谢,
Oded

由于2017a是预发行版(因此是保密的),因此可能值得通过Mathworks网站直接将其提交给Mathworks。您是否查看了该预发行版的发行说明?这始终是人们应该首先考虑的问题。现在我绕过了这个问题,将do_run_time更改为非测试方法。此方法将其参数(args,num_of_iterations)存储在类的新添加属性中(作为传递参数的hack),然后调用使用这两个属性的测试方法,并执行所有测试工作。这确实通过了单元测试,但我不想在我的项目中有这样的代码。
run_time ( testCase ) ;