From 7957864d62d72a97561aa887c08a17985e09ed5d Mon Sep 17 00:00:00 2001 From: Elad Salomons Date: Mon, 3 Sep 2018 14:10:09 +0300 Subject: [PATCH] Another fix for unit test --- tests/test_toolkit.cpp | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/tests/test_toolkit.cpp b/tests/test_toolkit.cpp index a8d6fd2..d92ebbc 100644 --- a/tests/test_toolkit.cpp +++ b/tests/test_toolkit.cpp @@ -265,6 +265,7 @@ BOOST_FIXTURE_TEST_CASE(test_add_control, Fixture) int flag = 00; long t, tstep; float h1, h2; + int Cindex; // run with original controls error = EN_openH(ph); @@ -274,7 +275,7 @@ BOOST_FIXTURE_TEST_CASE(test_add_control, Fixture) do { error = EN_runH(ph, &t); BOOST_REQUIRE(error == 0); - error = EN_getnodevalue(ph, 11, EN_HEAD, h1); // get the tank head + error = EN_getnodevalue(ph, 11, EN_HEAD, &h1); // get the tank head BOOST_REQUIRE(error == 0); error = EN_nextH(ph, &tstep); BOOST_REQUIRE(error == 0); @@ -284,16 +285,16 @@ BOOST_FIXTURE_TEST_CASE(test_add_control, Fixture) BOOST_REQUIRE(error == 0); // disable current controls - error = ENsetcontrol(ph, 1, EN_LOWLEVEL, 0, 0, 0, 0); + error = EN_setcontrol(ph, 1, 0, 0, 0, 0, 0); BOOST_REQUIRE(error == 0); - error = ENsetcontrol(ph, 2, EN_HILEVEL, 0, 0, 0, 0); + error = EN_setcontrol(ph, 2, 1, 0, 0, 0, 0); BOOST_REQUIRE(error == 0); // add new controls - error = ENaddcontrol(ph, Cindex, EN_LOWLEVEL, 13, 1, 11, 110); + error = EN_addcontrol(ph, &Cindex, 0, 13, 1, 11, 110); BOOST_REQUIRE(error == 0); BOOST_REQUIRE(Cindex == 3); - error = ENaddcontrol(ph, Cindex, EN_HILEVEL, 13, 0, 11, 140); + error = EN_addcontrol(ph, &Cindex, 1, 13, 0, 11, 140); BOOST_REQUIRE(error == 0); BOOST_REQUIRE(Cindex == 4); @@ -305,7 +306,7 @@ BOOST_FIXTURE_TEST_CASE(test_add_control, Fixture) do { error = EN_runH(ph, &t); BOOST_REQUIRE(error == 0); - error = EN_getnodevalue(ph, 11, EN_HEAD, h2); // get the tank head + error = EN_getnodevalue(ph, 11, EN_HEAD, &h2); // get the tank head BOOST_REQUIRE(error == 0); error = EN_nextH(ph, &tstep); BOOST_REQUIRE(error == 0);