Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
U
uniset2
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
1
Issues
1
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
UniSet project repositories
uniset2
Commits
281ac286
Commit
281ac286
authored
May 05, 2015
by
Pavel Vainerman
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Выпуск новой версии с текущими наработками (2.0-alt29)
parent
5a3ce391
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
34 additions
and
12 deletions
+34
-12
libuniset2.spec
conf/libuniset2.spec
+9
-1
test_tcpcheck.cc
tests/test_tcpcheck.cc
+24
-10
testsuite.at
testsuite/testsuite.at
+1
-1
No files found.
conf/libuniset2.spec
View file @
281ac286
...
@@ -12,7 +12,7 @@
...
@@ -12,7 +12,7 @@
Name: libuniset2
Name: libuniset2
Version: 2.0
Version: 2.0
Release: alt2
8.2
Release: alt2
9
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.
...
...
tests/test_tcpcheck.cc
View file @
281ac286
...
@@ -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
()
);
}
}
// --------------------------------------------------------
// --------------------------------------------------------
testsuite/testsuite.at
View file @
281ac286
...
@@ -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)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment