Skip to content

Commit 9d093a0

Browse files
committed
Adding more tests
1 parent 4230fad commit 9d093a0

2 files changed

Lines changed: 20 additions & 1 deletion

File tree

toolkit/epanet/toolkit/toolkit.i

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -228,7 +228,7 @@ int curv_set(Handle ph, int index, EN_API_FLOAT_TYPE *x, EN_API_FLOAT_TYPE *y, i
228228

229229
int scntl_add(Handle ph, int *cindex, int ctype, int lindex, EN_API_FLOAT_TYPE setting, int nindex, EN_API_FLOAT_TYPE level);
230230
int scntl_delete(Handle ph, int index);
231-
int scntl_get(Handle ph, int controlIndex, int *controlType, int *linkIndex, EN_API_FLOAT_TYPE *setting, int *nodeIndex, EN_API_FLOAT_TYPE *level);
231+
int scntl_get(Handle ph, int controlIndex, int *OUTPUT, int *OUTPUT, EN_API_FLOAT_TYPE *OUTPUT, int *OUTPUT, EN_API_FLOAT_TYPE *OUTPUT);
232232
int scntl_set(Handle ph, int cindex, int ctype, int lindex, EN_API_FLOAT_TYPE setting, int nindex, EN_API_FLOAT_TYPE level);
233233

234234

toolkit/tests/test_toolkit.py

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -225,4 +225,23 @@ def test_pattern(handle):
225225

226226
def test_curve(handle):
227227
index = en.curv_getindex(handle, "1")
228+
assert index == 1
229+
228230
length = en.curv_getlength(handle, index)
231+
assert length == 1
232+
233+
type = en.curv_gettype(handle, index)
234+
assert en.CurveType(type) == en.CurveType.CHAR
235+
236+
value = en.curv_getvalue(handle, index, length)
237+
assert value == [1500.0, 250.0]
238+
239+
240+
def test_simplecontrol(handle):
241+
242+
value = en.scntl_get(handle, 1)
243+
assert value == [0, 13, 1.0, 11, 110.0]
244+
245+
value.clear()
246+
value = en.scntl_get(handle, 2)
247+
assert value == [1, 13, 0.0, 11, 140.0]

0 commit comments

Comments
 (0)