Commit 281ac286 authored by Pavel Vainerman's avatar Pavel Vainerman

Выпуск новой версии с текущими наработками (2.0-alt29)

parent 5a3ce391
...@@ -12,7 +12,7 @@ ...@@ -12,7 +12,7 @@
Name: libuniset2 Name: libuniset2
Version: 2.0 Version: 2.0
Release: alt28.2 Release: alt29
Summary: UniSet - library for building distributed industrial control systems Summary: UniSet - library for building distributed industrial control systems
...@@ -409,6 +409,14 @@ mv -f %buildroot%python_sitelibdir_noarch/* %buildroot%python_sitelibdir/%oname ...@@ -409,6 +409,14 @@ mv -f %buildroot%python_sitelibdir_noarch/* %buildroot%python_sitelibdir/%oname
# .. # ..
%changelog %changelog
* Tue May 05 2015 Pavel Vainerman <pv@altlinux.ru> 2.0-alt29
- SM: add reserv mechanism for initializing (setbug #7289)
- SM: fixed bug in 'heartbeat'
- SM: add tests
- minor fixes
- refactoring
- add new tests
* Thu Apr 23 2015 Pavel Vainerman <pv@etersoft.ru> 2.0-alt28.2 * Thu Apr 23 2015 Pavel Vainerman <pv@etersoft.ru> 2.0-alt28.2
- unet-udp: special build... change maximum for digital and analog data. Set A=1500, D=5000. - unet-udp: special build... change maximum for digital and analog data. Set A=1500, D=5000.
......
...@@ -26,35 +26,49 @@ bool run_test_server() ...@@ -26,35 +26,49 @@ bool run_test_server()
return true; return true;
} }
// -------------------------------------------------------- // --------------------------------------------------------
// вспомогательный класс для гарантированного завершения потока..
class TSRunner
{
public:
TSRunner()
{
cancel = false;
res = std::async(std::launch::async,run_test_server);
}
~TSRunner()
{
cancel = true;
res.get();
}
private:
std::future<bool> res;
};
// -----------------------------------------------------------------------------
TEST_CASE("TCPCheck::check", "[tcpcheck][tcpcheck_check]" ) TEST_CASE("TCPCheck::check", "[tcpcheck][tcpcheck_check]" )
{ {
TCPCheck t; TCPCheck t;
TSRunner tserv;
auto res = std::async(std::launch::async, run_test_server);
ostringstream ia; ostringstream ia;
ia << host << ":" << port; ia << host << ":" << port;
msleep(200);
CHECK( t.check(host, port, 300) ); CHECK( t.check(host, port, 300) );
CHECK( t.check(ia.str(), 300) ); CHECK( t.check(ia.str(), 300) );
CHECK_FALSE( t.check("dummy_host_name", port, 300) ); CHECK_FALSE( t.check("dummy_host_name", port, 300) );
CHECK_FALSE( t.check("dummy_host_name:2048", 300) ); CHECK_FALSE( t.check("dummy_host_name:2048", 300) );
cancel = true;
CHECK( res.get() );
} }
// -------------------------------------------------------- // --------------------------------------------------------
TEST_CASE("TCPCheck::ping", "[tcpcheck][tcpcheck_ping]" ) TEST_CASE("TCPCheck::ping", "[tcpcheck][tcpcheck_ping]" )
{ {
TCPCheck t; TCPCheck t;
TSRunner tserv;
auto res = std::async(std::launch::async, run_test_server); msleep(200);
CHECK( t.ping(host) ); CHECK( t.ping(host) );
CHECK_FALSE( t.ping("dummy_host_name") ); CHECK_FALSE( t.ping("dummy_host_name") );
cancel = true;
CHECK( res.get() );
} }
// -------------------------------------------------------- // --------------------------------------------------------
...@@ -5,8 +5,8 @@ AT_COLOR_TESTS ...@@ -5,8 +5,8 @@ AT_COLOR_TESTS
AT_INIT([Uniset test suite]) AT_INIT([Uniset test suite])
m4_include(../tests/tests.at) m4_include(../tests/tests.at)
m4_include(../extensions/tests/extensions-tests.at)
m4_include(../extensions/SharedMemory/tests/sm-tests.at) m4_include(../extensions/SharedMemory/tests/sm-tests.at)
m4_include(../extensions/tests/extensions-tests.at)
m4_include(../extensions/LogicProcessor/tests/lproc-tests.at) m4_include(../extensions/LogicProcessor/tests/lproc-tests.at)
m4_include(../extensions/ModbusSlave/tests/mbslave-tests.at) m4_include(../extensions/ModbusSlave/tests/mbslave-tests.at)
m4_include(../extensions/UNetUDP/tests/unetudp-tests.at) m4_include(../extensions/UNetUDP/tests/unetudp-tests.at)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment