- add unit tests
Yann Collette [Mon, 2 Jun 2008 13:48:00 +0000 (13:48 +0000)]
scilab/modules/parameters/tests/unit_tests/add_param.tst [new file with mode: 0755]
scilab/modules/parameters/tests/unit_tests/get_param.tst [new file with mode: 0755]
scilab/modules/parameters/tests/unit_tests/init_param.tst [new file with mode: 0755]
scilab/modules/parameters/tests/unit_tests/is_param.tst [new file with mode: 0755]
scilab/modules/parameters/tests/unit_tests/list_param.tst [new file with mode: 0755]
scilab/modules/parameters/tests/unit_tests/remove_param.tst [new file with mode: 0755]
scilab/modules/parameters/tests/unit_tests/set_param.tst [new file with mode: 0755]

diff --git a/scilab/modules/parameters/tests/unit_tests/add_param.tst b/scilab/modules/parameters/tests/unit_tests/add_param.tst
new file mode 100755 (executable)
index 0000000..766fdfa
--- /dev/null
@@ -0,0 +1,16 @@
+
+// Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+// Copyright (C) 2008 - Yann COLLETTE <yann.collette@renault.com>
+//
+// This file must be used under the terms of the CeCILL.
+// This source file is licensed as described in the file COPYING, which
+// you should have received as part of this distribution.  The terms
+// are also available at
+// http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt
+
+test_list = init_param();
+
+test_list = add_param(test_list,'test',%T);
+
+if ~is_param(test_list,'test') then pause,end
+
diff --git a/scilab/modules/parameters/tests/unit_tests/get_param.tst b/scilab/modules/parameters/tests/unit_tests/get_param.tst
new file mode 100755 (executable)
index 0000000..150bb61
--- /dev/null
@@ -0,0 +1,15 @@
+
+// Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+// Copyright (C) 2008 - Yann COLLETTE <yann.collette@renault.com>
+//
+// This file must be used under the terms of the CeCILL.
+// This source file is licensed as described in the file COPYING, which
+// you should have received as part of this distribution.  The terms
+// are also available at
+// http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt
+
+test_list = init_param();
+
+test_list = add_param(test_list,'test',%T);
+
+if get_param(test_list,'test')~=%T then pause,end
diff --git a/scilab/modules/parameters/tests/unit_tests/init_param.tst b/scilab/modules/parameters/tests/unit_tests/init_param.tst
new file mode 100755 (executable)
index 0000000..a267646
--- /dev/null
@@ -0,0 +1,13 @@
+
+// Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+// Copyright (C) 2008 - Yann COLLETTE <yann.collette@renault.com>
+//
+// This file must be used under the terms of the CeCILL.
+// This source file is licensed as described in the file COPYING, which
+// you should have received as part of this distribution.  The terms
+// are also available at
+// http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt
+
+test_list = init_param();
+
+if typeof(test_list)~='plist' then pause,end
diff --git a/scilab/modules/parameters/tests/unit_tests/is_param.tst b/scilab/modules/parameters/tests/unit_tests/is_param.tst
new file mode 100755 (executable)
index 0000000..766fdfa
--- /dev/null
@@ -0,0 +1,16 @@
+
+// Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+// Copyright (C) 2008 - Yann COLLETTE <yann.collette@renault.com>
+//
+// This file must be used under the terms of the CeCILL.
+// This source file is licensed as described in the file COPYING, which
+// you should have received as part of this distribution.  The terms
+// are also available at
+// http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt
+
+test_list = init_param();
+
+test_list = add_param(test_list,'test',%T);
+
+if ~is_param(test_list,'test') then pause,end
+
diff --git a/scilab/modules/parameters/tests/unit_tests/list_param.tst b/scilab/modules/parameters/tests/unit_tests/list_param.tst
new file mode 100755 (executable)
index 0000000..26896ff
--- /dev/null
@@ -0,0 +1,18 @@
+
+// Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+// Copyright (C) 2008 - Yann COLLETTE <yann.collette@renault.com>
+//
+// This file must be used under the terms of the CeCILL.
+// This source file is licensed as described in the file COPYING, which
+// you should have received as part of this distribution.  The terms
+// are also available at
+// http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt
+
+test_list = init_param();
+
+test_list = add_param(test_list,'param_1',1);
+test_list = add_param(test_list,'param_2',2);
+
+list_of_params = list_param(test_list);
+
+if length(list_of_params)~=2 then pause,end
diff --git a/scilab/modules/parameters/tests/unit_tests/remove_param.tst b/scilab/modules/parameters/tests/unit_tests/remove_param.tst
new file mode 100755 (executable)
index 0000000..ebb64dc
--- /dev/null
@@ -0,0 +1,17 @@
+
+// Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+// Copyright (C) 2008 - Yann COLLETTE <yann.collette@renault.com>
+//
+// This file must be used under the terms of the CeCILL.
+// This source file is licensed as described in the file COPYING, which
+// you should have received as part of this distribution.  The terms
+// are also available at
+// http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt
+
+test_list = init_param();
+
+test_list = add_param(test_list,'test',%T);
+
+test_list = remove_param(test_list,'test');
+
+if is_param(test_list,'test') then pause, end
diff --git a/scilab/modules/parameters/tests/unit_tests/set_param.tst b/scilab/modules/parameters/tests/unit_tests/set_param.tst
new file mode 100755 (executable)
index 0000000..d5e4d66
--- /dev/null
@@ -0,0 +1,15 @@
+
+// Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+// Copyright (C) 2008 - Yann COLLETTE <yann.collette@renault.com>
+//
+// This file must be used under the terms of the CeCILL.
+// This source file is licensed as described in the file COPYING, which
+// you should have received as part of this distribution.  The terms
+// are also available at
+// http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt
+
+test_list = init_param();
+
+test_list = set_param(test_list,'test',%T);
+
+if get_param(test_list,'test')~=%T then pause,end