winIDEA SDK
test_modify.py
1# This script is licensed under BSD License, see file LICENSE.txt.
2#
3# (c) TASKING Germany GmbH, 2023
4
5import isystem.connect as ic
6
7
8winidea_id = ''
9
10
11def test_modify():
12 connMgr = ic.ConnectionMgr()
13 connMgr.connect(ic.CConnectionConfig().instanceId(winidea_id))
14
15 tcCtrl = ic.CTestCaseController(connMgr, "main", "")
16
17 print("Creating test variables...")
18 tcCtrl.createVariable("my_var", "int")
19 tcCtrl.createVariable("my_var_array", "int[3]")
20
21 tcCtrl.init()
22
23 print("Modifying variable values...")
24 tcCtrl.modify("my_var", "123")
25 tcCtrl.modify("my_var_array[1]", "456")
26
27 print("Modifying variable values via string ...")
28 tcCtrl.modifyAsString("my_var_array", "{100, 0, 200}")
29
30 tcCtrl.destroy()
31
32
33if __name__ == "__main__":
34 test_modify()