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
e2aa43c8
Commit
e2aa43c8
authored
Oct 31, 2021
by
Pavel Vainerman
Committed by
Pavel Vainerman
Oct 31, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
(catch2): temp commit
parent
8ea8378f
Hide whitespace changes
Inline
Side-by-side
Showing
16 changed files
with
54 additions
and
40 deletions
+54
-40
testsuite.yml
.github/workflows/testsuite.yml
+1
-0
configure.ac
configure.ac
+5
-2
run_test_iocontrol.cc
extensions/IOControl/tests/run_test_iocontrol.cc
+2
-2
tests.cc
extensions/LogicProcessor/tests/tests.cc
+2
-2
tests.cc
extensions/SharedMemory/tests/tests.cc
+2
-2
tests_multicast_with_sm.cc
extensions/UNetUDP/tests/tests_multicast_with_sm.cc
+2
-2
tests_with_sm.cc
extensions/UNetUDP/tests/tests_with_sm.cc
+2
-2
VTypes.h
extensions/include/VTypes.h
+9
-0
test_vtypes.cc
extensions/tests/test_vtypes.cc
+2
-2
tests_with_sm.cc
extensions/tests/tests_with_sm.cc
+2
-2
test_conftest.cc
tests/test_conftest.cc
+3
-3
test_oindex_hash.cc
tests/test_oindex_hash.cc
+1
-1
test_tcpcheck.cc
tests/test_tcpcheck.cc
+2
-1
test_ui.cc
tests/test_ui.cc
+15
-15
test_unixml.cc
tests/test_unixml.cc
+3
-3
tests_with_conf.cc
tests/tests_with_conf.cc
+1
-1
No files found.
.github/workflows/testsuite.yml
View file @
e2aa43c8
...
@@ -11,6 +11,7 @@ jobs:
...
@@ -11,6 +11,7 @@ jobs:
runs-on
:
ubuntu-latest
runs-on
:
ubuntu-latest
container
:
container
:
image
:
alt:sisyphus
image
:
alt:sisyphus
options
:
--privileged
steps
:
steps
:
-
name
:
install packages
-
name
:
install packages
run
:
|
run
:
|
...
...
configure.ac
View file @
e2aa43c8
...
@@ -366,10 +366,13 @@ AC_SUBST(UNISET_EXT_LIBS)
...
@@ -366,10 +366,13 @@ AC_SUBST(UNISET_EXT_LIBS)
#AC_LANG_PUSH([C++])
#AC_LANG_PUSH([C++])
#AC_CHECK_HEADERS([catch.hpp],,exit)
#AC_CHECK_HEADERS([catch.hpp],,exit)
#AC_LANG_POP([C++])
#AC_LANG_POP([C++])
CATCH_VERSION_MAJOR=1
CATCH_VERSION_MAJOR=1
CATCH_CFLAGS=
CATCH_FILE="include/catch.hpp"
CATCH_FILE="include/catch.hpp"
if test ! -e ${CATCH_FILE}; then
if test ! -e ${CATCH_FILE}; then
CATCH_FILE="/usr/include/catch.hpp"
CATCH_FILE="/usr/include/catch2/catch.hpp"
CATCH_CFLAGS="-I/usr/include/catch2"
fi
fi
AC_MSG_CHECKING([catch version in $CATCH_FILE])
AC_MSG_CHECKING([catch version in $CATCH_FILE])
...
@@ -485,7 +488,7 @@ CXX_EXTRA_FLAGS="-Wnon-virtual-dtor -Woverloaded-virtual -Woverflow -D_GLIBCXX_U
...
@@ -485,7 +488,7 @@ CXX_EXTRA_FLAGS="-Wnon-virtual-dtor -Woverloaded-virtual -Woverflow -D_GLIBCXX_U
# export
# export
LDFLAGS="$LDFLAGS ${OMNI_LIBS} ${XML_LIBS} ${SIGC_LIBS} ${COV_LIBS} ${POCO_LIBS} ${EV_LIBS}"
LDFLAGS="$LDFLAGS ${OMNI_LIBS} ${XML_LIBS} ${SIGC_LIBS} ${COV_LIBS} ${POCO_LIBS} ${EV_LIBS}"
# all developer liked options add to autogen.sh, please
# all developer liked options add to autogen.sh, please
CXXFLAGS="-
std=c++17 -I\$(top_builddir)/include $CXXFLAGS -funsigned-char -g -DCATCH_VERSION_MAJOR=${CATCH_VERSION_MAJOR}
-D_GNU_SOURCE ${REST_API_CFLAGS} ${COMPORT_485F_CFLAGS} ${OMNI_CFLAGS} ${XML_CFLAGS} ${SIGC_CFLAGS} ${COV_CFLAGS} ${POCO_CFLAGS} ${EV_CFLAGS} $CXX_EXTRA_FLAGS"
CXXFLAGS="-
I\$(top_builddir)/include $CXXFLAGS ${CATCH_CFLAGS} -funsigned-char -g
-D_GNU_SOURCE ${REST_API_CFLAGS} ${COMPORT_485F_CFLAGS} ${OMNI_CFLAGS} ${XML_CFLAGS} ${SIGC_CFLAGS} ${COV_CFLAGS} ${POCO_CFLAGS} ${EV_CFLAGS} $CXX_EXTRA_FLAGS"
AC_SUBST(LDFLAGS)
AC_SUBST(LDFLAGS)
AC_SUBST(CXXFLAGS)
AC_SUBST(CXXFLAGS)
...
...
extensions/IOControl/tests/run_test_iocontrol.cc
View file @
e2aa43c8
...
@@ -28,11 +28,11 @@ int main( int argc, const char* argv[] )
...
@@ -28,11 +28,11 @@ int main( int argc, const char* argv[] )
cout
<<
"--confile - Использовать указанный конф. файл. По умолчанию configure.xml"
<<
endl
;
cout
<<
"--confile - Использовать указанный конф. файл. По умолчанию configure.xml"
<<
endl
;
SharedMemory
::
help_print
(
argc
,
argv
);
SharedMemory
::
help_print
(
argc
,
argv
);
cout
<<
endl
<<
endl
<<
"--------------- CATCH HELP --------------"
<<
endl
;
cout
<<
endl
<<
endl
<<
"--------------- CATCH HELP --------------"
<<
endl
;
session
.
showHelp
(
"tests_iocontrol"
);
session
.
showHelp
();
return
0
;
return
0
;
}
}
int
returnCode
=
session
.
applyCommandLine
(
argc
,
argv
,
Catch
::
Session
::
OnUnusedOptions
::
Ignore
);
int
returnCode
=
session
.
applyCommandLine
(
argc
,
argv
);
if
(
returnCode
!=
0
)
// Indicates a command line error
if
(
returnCode
!=
0
)
// Indicates a command line error
return
returnCode
;
return
returnCode
;
...
...
extensions/LogicProcessor/tests/tests.cc
View file @
e2aa43c8
...
@@ -20,11 +20,11 @@ int main(int argc, const char* argv[] )
...
@@ -20,11 +20,11 @@ int main(int argc, const char* argv[] )
{
{
cout
<<
"--confile - Использовать указанный конф. файл. По умолчанию configure.xml"
<<
endl
;
cout
<<
"--confile - Использовать указанный конф. файл. По умолчанию configure.xml"
<<
endl
;
cout
<<
endl
<<
endl
<<
"--------------- CATCH HELP --------------"
<<
endl
;
cout
<<
endl
<<
endl
<<
"--------------- CATCH HELP --------------"
<<
endl
;
session
.
showHelp
(
"tests"
);
session
.
showHelp
();
return
0
;
return
0
;
}
}
int
returnCode
=
session
.
applyCommandLine
(
argc
,
argv
,
Catch
::
Session
::
OnUnusedOptions
::
Ignore
);
int
returnCode
=
session
.
applyCommandLine
(
argc
,
argv
);
if
(
returnCode
!=
0
)
// Indicates a command line error
if
(
returnCode
!=
0
)
// Indicates a command line error
return
returnCode
;
return
returnCode
;
...
...
extensions/SharedMemory/tests/tests.cc
View file @
e2aa43c8
...
@@ -27,11 +27,11 @@ int main(int argc, const char* argv[] )
...
@@ -27,11 +27,11 @@ int main(int argc, const char* argv[] )
cout
<<
"--confile - Использовать указанный конф. файл. По умолчанию configure.xml"
<<
endl
;
cout
<<
"--confile - Использовать указанный конф. файл. По умолчанию configure.xml"
<<
endl
;
SharedMemory
::
help_print
(
argc
,
argv
);
SharedMemory
::
help_print
(
argc
,
argv
);
cout
<<
endl
<<
endl
<<
"--------------- CATCH HELP --------------"
<<
endl
;
cout
<<
endl
<<
endl
<<
"--------------- CATCH HELP --------------"
<<
endl
;
session
.
showHelp
(
"tests"
);
session
.
showHelp
();
return
0
;
return
0
;
}
}
int
returnCode
=
session
.
applyCommandLine
(
argc
,
argv
,
Catch
::
Session
::
OnUnusedOptions
::
Ignore
);
int
returnCode
=
session
.
applyCommandLine
(
argc
,
argv
);
if
(
returnCode
!=
0
)
// Indicates a command line error
if
(
returnCode
!=
0
)
// Indicates a command line error
return
returnCode
;
return
returnCode
;
...
...
extensions/UNetUDP/tests/tests_multicast_with_sm.cc
View file @
e2aa43c8
...
@@ -24,11 +24,11 @@ int main(int argc, const char* argv[] )
...
@@ -24,11 +24,11 @@ int main(int argc, const char* argv[] )
cout
<<
"--confile - Использовать указанный конф. файл. По умолчанию configure.xml"
<<
endl
;
cout
<<
"--confile - Использовать указанный конф. файл. По умолчанию configure.xml"
<<
endl
;
SharedMemory
::
help_print
(
argc
,
argv
);
SharedMemory
::
help_print
(
argc
,
argv
);
cout
<<
endl
<<
endl
<<
"--------------- CATCH HELP --------------"
<<
endl
;
cout
<<
endl
<<
endl
<<
"--------------- CATCH HELP --------------"
<<
endl
;
session
.
showHelp
(
"test_multicast_with_sm"
);
session
.
showHelp
();
return
0
;
return
0
;
}
}
int
returnCode
=
session
.
applyCommandLine
(
argc
,
argv
,
Catch
::
Session
::
OnUnusedOptions
::
Ignore
);
int
returnCode
=
session
.
applyCommandLine
(
argc
,
argv
);
if
(
returnCode
!=
0
)
// Indicates a command line error
if
(
returnCode
!=
0
)
// Indicates a command line error
return
returnCode
;
return
returnCode
;
...
...
extensions/UNetUDP/tests/tests_with_sm.cc
View file @
e2aa43c8
...
@@ -24,11 +24,11 @@ int main(int argc, const char* argv[] )
...
@@ -24,11 +24,11 @@ int main(int argc, const char* argv[] )
cout
<<
"--confile - Использовать указанный конф. файл. По умолчанию configure.xml"
<<
endl
;
cout
<<
"--confile - Использовать указанный конф. файл. По умолчанию configure.xml"
<<
endl
;
SharedMemory
::
help_print
(
argc
,
argv
);
SharedMemory
::
help_print
(
argc
,
argv
);
cout
<<
endl
<<
endl
<<
"--------------- CATCH HELP --------------"
<<
endl
;
cout
<<
endl
<<
endl
<<
"--------------- CATCH HELP --------------"
<<
endl
;
session
.
showHelp
(
"test_with_sm"
);
session
.
showHelp
();
return
0
;
return
0
;
}
}
int
returnCode
=
session
.
applyCommandLine
(
argc
,
argv
,
Catch
::
Session
::
OnUnusedOptions
::
Ignore
);
int
returnCode
=
session
.
applyCommandLine
(
argc
,
argv
);
if
(
returnCode
!=
0
)
// Indicates a command line error
if
(
returnCode
!=
0
)
// Indicates a command line error
return
returnCode
;
return
returnCode
;
...
...
extensions/include/VTypes.h
View file @
e2aa43c8
...
@@ -286,6 +286,11 @@ namespace uniset
...
@@ -286,6 +286,11 @@ namespace uniset
{
{
return
raw
;
return
raw
;
}
}
// ------------------------------------------
operator
int
()
{
return
raw
;
}
uint16_t
raw
;
uint16_t
raw
;
};
};
...
@@ -325,6 +330,10 @@ namespace uniset
...
@@ -325,6 +330,10 @@ namespace uniset
{
{
return
raw
;
return
raw
;
}
}
operator
int
()
{
return
raw
;
}
int16_t
raw
;
int16_t
raw
;
};
};
...
...
extensions/tests/test_vtypes.cc
View file @
e2aa43c8
...
@@ -319,13 +319,13 @@ TEST_CASE("VTypes: Signed", "[vtypes][signed]")
...
@@ -319,13 +319,13 @@ TEST_CASE("VTypes: Signed", "[vtypes][signed]")
{
{
long
l
=
-
32766
;
long
l
=
-
32766
;
Signed
v
(
l
);
Signed
v
(
l
);
REQUIRE
(
(
int16_t
)
v
==
l
);
REQUIRE
(
v
==
l
);
}
}
SECTION
(
"Modbus constructor"
)
SECTION
(
"Modbus constructor"
)
{
{
ModbusRTU
::
ModbusData
d
=
65535
;
ModbusRTU
::
ModbusData
d
=
65535
;
Signed
v
(
d
);
Signed
v
(
d
);
REQUIRE
(
(
int
16_t
)
v
==
(
int16_
t
)
d
);
REQUIRE
(
(
int
)
v
==
(
in
t
)
d
);
}
}
}
}
// -----------------------------------------------------------------------------
// -----------------------------------------------------------------------------
extensions/tests/tests_with_sm.cc
View file @
e2aa43c8
...
@@ -54,11 +54,11 @@ int main(int argc, const char* argv[] )
...
@@ -54,11 +54,11 @@ int main(int argc, const char* argv[] )
cout
<<
"--confile - Использовать указанный конф. файл. По умолчанию configure.xml"
<<
endl
;
cout
<<
"--confile - Использовать указанный конф. файл. По умолчанию configure.xml"
<<
endl
;
SharedMemory
::
help_print
(
argc
,
argv
);
SharedMemory
::
help_print
(
argc
,
argv
);
cout
<<
endl
<<
endl
<<
"--------------- CATCH HELP --------------"
<<
endl
;
cout
<<
endl
<<
endl
<<
"--------------- CATCH HELP --------------"
<<
endl
;
session
.
showHelp
(
"test_with_sm"
);
session
.
showHelp
();
return
0
;
return
0
;
}
}
int
returnCode
=
session
.
applyCommandLine
(
argc
,
argv
,
Catch
::
Session
::
OnUnusedOptions
::
Ignore
);
int
returnCode
=
session
.
applyCommandLine
(
argc
,
argv
);
if
(
returnCode
!=
0
)
// Indicates a command line error
if
(
returnCode
!=
0
)
// Indicates a command line error
return
returnCode
;
return
returnCode
;
...
...
tests/test_conftest.cc
View file @
e2aa43c8
...
@@ -86,7 +86,7 @@ TEST_CASE( "Configuration", "[Configuration]" )
...
@@ -86,7 +86,7 @@ TEST_CASE( "Configuration", "[Configuration]" )
{
{
int
t_argc
=
0
;
int
t_argc
=
0
;
char
t_argv
[]
=
{
""
};
char
t_argv
[]
=
{
""
};
REQUIRE_THROWS_AS
(
Configuration
(
t_argc
,
(
const
char
*
const
*
)(
t_argv
),
""
),
uniset
::
SystemError
&
);
REQUIRE_THROWS_AS
(
Configuration
(
t_argc
,
(
const
char
*
const
*
)(
t_argv
),
""
),
uniset
::
SystemError
);
}
}
// SECTION( "ObjectIndex Constructor" )
// SECTION( "ObjectIndex Constructor" )
...
@@ -98,7 +98,7 @@ TEST_CASE( "Configuration", "[Configuration]" )
...
@@ -98,7 +98,7 @@ TEST_CASE( "Configuration", "[Configuration]" )
int
t_argc
=
0
;
int
t_argc
=
0
;
char
t_argv
[]
=
{
""
};
char
t_argv
[]
=
{
""
};
ulog
()
->
level
(
Debug
::
NONE
);
ulog
()
->
level
(
Debug
::
NONE
);
REQUIRE_THROWS_AS
(
Configuration
(
t_argc
,
(
const
char
*
const
*
)(
t_argv
),
"tests_no_objectsmap.xml"
),
uniset
::
SystemError
&
);
REQUIRE_THROWS_AS
(
Configuration
(
t_argc
,
(
const
char
*
const
*
)(
t_argv
),
"tests_no_objectsmap.xml"
),
uniset
::
SystemError
);
}
}
SECTION
(
"Bad conf: no <UniSet>"
)
SECTION
(
"Bad conf: no <UniSet>"
)
...
@@ -106,7 +106,7 @@ TEST_CASE( "Configuration", "[Configuration]" )
...
@@ -106,7 +106,7 @@ TEST_CASE( "Configuration", "[Configuration]" )
int
t_argc
=
0
;
int
t_argc
=
0
;
char
t_argv
[]
=
{
""
};
char
t_argv
[]
=
{
""
};
ulog
()
->
level
(
Debug
::
NONE
);
ulog
()
->
level
(
Debug
::
NONE
);
REQUIRE_THROWS_AS
(
Configuration
(
t_argc
,
(
const
char
*
const
*
)(
t_argv
),
"tests_no_uniset_section.xml"
),
uniset
::
SystemError
&
);
REQUIRE_THROWS_AS
(
Configuration
(
t_argc
,
(
const
char
*
const
*
)(
t_argv
),
"tests_no_uniset_section.xml"
),
uniset
::
SystemError
);
}
}
}
}
tests/test_oindex_hash.cc
View file @
e2aa43c8
...
@@ -19,5 +19,5 @@ TEST_CASE("ObjectIndexHash", "[oindex_hash][basic]" )
...
@@ -19,5 +19,5 @@ TEST_CASE("ObjectIndexHash", "[oindex_hash][basic]" )
// -----------------------------------------------------------------------------
// -----------------------------------------------------------------------------
TEST_CASE
(
"ObjectIndexHash: collision"
,
"[oindex_hash][base][collision]"
)
TEST_CASE
(
"ObjectIndexHash: collision"
,
"[oindex_hash][base][collision]"
)
{
{
REQUIRE_THROWS_AS
(
ObjectIndex_hashXML
(
"tests_oindex_hash_collision_config.xml"
),
uniset
::
SystemError
&
);
REQUIRE_THROWS_AS
(
ObjectIndex_hashXML
(
"tests_oindex_hash_collision_config.xml"
),
uniset
::
SystemError
);
}
}
tests/test_tcpcheck.cc
View file @
e2aa43c8
...
@@ -4,6 +4,7 @@
...
@@ -4,6 +4,7 @@
#include <atomic>
#include <atomic>
#include <future>
#include <future>
#include <ostream>
#include <ostream>
#include <sstream>
#include "UTCPSocket.h"
#include "UTCPSocket.h"
#include "TCPCheck.h"
#include "TCPCheck.h"
...
@@ -61,7 +62,7 @@ TEST_CASE("TCPCheck::check", "[tcpcheck][tcpcheck_check]" )
...
@@ -61,7 +62,7 @@ TEST_CASE("TCPCheck::check", "[tcpcheck][tcpcheck_check]" )
TCPCheck
t
;
TCPCheck
t
;
TSRunner
tserv
;
TSRunner
tserv
;
ostringstream
ia
;
std
::
ostringstream
ia
;
ia
<<
host
<<
":"
<<
port
;
ia
<<
host
<<
":"
<<
port
;
msleep
(
200
);
msleep
(
200
);
...
...
tests/test_ui.cc
View file @
e2aa43c8
...
@@ -27,25 +27,25 @@ TEST_CASE("UInterface", "[UInterface]")
...
@@ -27,25 +27,25 @@ TEST_CASE("UInterface", "[UInterface]")
CHECK
(
ui
.
getConfIOType
(
sid
)
!=
UniversalIO
::
UnknownIOType
);
CHECK
(
ui
.
getConfIOType
(
sid
)
!=
UniversalIO
::
UnknownIOType
);
REQUIRE_THROWS_AS
(
ui
.
getValue
(
DefaultObjectId
),
uniset
::
ORepFailed
&
);
REQUIRE_THROWS_AS
(
ui
.
getValue
(
DefaultObjectId
),
uniset
::
ORepFailed
);
REQUIRE_THROWS_AS
(
ui
.
getValue
(
sid
),
uniset
::
Exception
&
);
REQUIRE_THROWS_AS
(
ui
.
getValue
(
sid
),
uniset
::
Exception
);
REQUIRE_THROWS_AS
(
ui
.
getValue
(
sid
,
DefaultObjectId
),
uniset
::
Exception
&
);
REQUIRE_THROWS_AS
(
ui
.
getValue
(
sid
,
DefaultObjectId
),
uniset
::
Exception
);
REQUIRE_THROWS_AS
(
ui
.
getValue
(
sid
,
100
),
uniset
::
Exception
&
);
REQUIRE_THROWS_AS
(
ui
.
getValue
(
sid
,
100
),
uniset
::
Exception
);
REQUIRE_THROWS_AS
(
ui
.
resolve
(
sid
),
uniset
::
ORepFailed
&
);
REQUIRE_THROWS_AS
(
ui
.
resolve
(
sid
),
uniset
::
ORepFailed
);
REQUIRE_THROWS_AS
(
ui
.
resolve
(
sid
,
10
),
uniset
::
ResolveNameError
&
);
REQUIRE_THROWS_AS
(
ui
.
resolve
(
sid
,
10
),
uniset
::
ResolveNameError
);
REQUIRE_THROWS_AS
(
ui
.
resolve
(
sid
,
DefaultObjectId
),
ResolveNameError
&
);
REQUIRE_THROWS_AS
(
ui
.
resolve
(
sid
,
DefaultObjectId
),
ResolveNameError
);
TransportMessage
tm
(
SensorMessage
(
sid
,
10
).
transport_msg
()
);
TransportMessage
tm
(
SensorMessage
(
sid
,
10
).
transport_msg
()
);
REQUIRE_THROWS_AS
(
ui
.
send
(
testOID
,
tm
),
uniset
::
Exception
&
);
REQUIRE_THROWS_AS
(
ui
.
send
(
testOID
,
tm
),
uniset
::
Exception
);
REQUIRE_THROWS_AS
(
ui
.
send
(
testOID
,
tm
,
-
20
),
uniset
::
Exception
&
);
REQUIRE_THROWS_AS
(
ui
.
send
(
testOID
,
tm
,
-
20
),
uniset
::
Exception
);
REQUIRE_THROWS_AS
(
ui
.
send
(
testOID
,
tm
,
DefaultObjectId
),
uniset
::
Exception
&
);
REQUIRE_THROWS_AS
(
ui
.
send
(
testOID
,
tm
,
DefaultObjectId
),
uniset
::
Exception
);
REQUIRE_THROWS_AS
(
ui
.
getTimeChange
(
sid
,
-
20
),
uniset
::
Exception
&
);
REQUIRE_THROWS_AS
(
ui
.
getTimeChange
(
sid
,
-
20
),
uniset
::
Exception
);
REQUIRE_THROWS_AS
(
ui
.
getTimeChange
(
sid
,
DefaultObjectId
),
uniset
::
Exception
&
);
REQUIRE_THROWS_AS
(
ui
.
getTimeChange
(
sid
,
DefaultObjectId
),
uniset
::
Exception
);
REQUIRE_THROWS_AS
(
ui
.
getTimeChange
(
sid
,
conf
->
getLocalNode
()),
uniset
::
Exception
&
);
REQUIRE_THROWS_AS
(
ui
.
getTimeChange
(
sid
,
conf
->
getLocalNode
()),
uniset
::
Exception
);
REQUIRE_THROWS_AS
(
ui
.
sendText
(
testOID
,
"hello"
,
1
),
uniset
::
Exception
&
);
REQUIRE_THROWS_AS
(
ui
.
sendText
(
testOID
,
"hello"
,
1
),
uniset
::
Exception
);
REQUIRE_THROWS_AS
(
ui
.
sendText
(
testOID
,
"hello"
,
1
,
-
20
),
uniset
::
Exception
&
);
REQUIRE_THROWS_AS
(
ui
.
sendText
(
testOID
,
"hello"
,
1
,
-
20
),
uniset
::
Exception
);
CHECK_FALSE
(
ui
.
isExist
(
sid
)
);
CHECK_FALSE
(
ui
.
isExist
(
sid
)
);
CHECK_FALSE
(
ui
.
isExist
(
sid
,
DefaultObjectId
)
);
CHECK_FALSE
(
ui
.
isExist
(
sid
,
DefaultObjectId
)
);
...
...
tests/test_unixml.cc
View file @
e2aa43c8
...
@@ -20,8 +20,8 @@ TEST_CASE("UniXML", "[unixml][basic]" )
...
@@ -20,8 +20,8 @@ TEST_CASE("UniXML", "[unixml][basic]" )
SECTION
(
"Bad file"
)
SECTION
(
"Bad file"
)
{
{
REQUIRE_THROWS_AS
(
UniXML
(
"unknown.xml"
),
uniset
::
NameNotFound
&
);
REQUIRE_THROWS_AS
(
UniXML
(
"unknown.xml"
),
uniset
::
NameNotFound
);
REQUIRE_THROWS_AS
(
UniXML
(
"tests_unixml_badfile.xml"
),
uniset
::
Exception
&
);
REQUIRE_THROWS_AS
(
UniXML
(
"tests_unixml_badfile.xml"
),
uniset
::
Exception
);
}
}
UniXML
uxml
(
"tests_unixml.xml"
);
UniXML
uxml
(
"tests_unixml.xml"
);
...
@@ -234,6 +234,6 @@ TEST_CASE("UniXML createFromText", "[unixml][createFromText]" )
...
@@ -234,6 +234,6 @@ TEST_CASE("UniXML createFromText", "[unixml][createFromText]" )
CHECK_FALSE
(
uxml
.
isOpen
()
);
CHECK_FALSE
(
uxml
.
isOpen
()
);
const
string
badtext
=
"<?xml version="
;
const
string
badtext
=
"<?xml version="
;
REQUIRE_THROWS_AS
(
uxml
.
createFromText
(
badtext
),
uniset
::
SystemError
&
);
REQUIRE_THROWS_AS
(
uxml
.
createFromText
(
badtext
),
uniset
::
SystemError
);
}
}
// -----------------------------------------------------------------------------
// -----------------------------------------------------------------------------
tests/tests_with_conf.cc
View file @
e2aa43c8
...
@@ -13,7 +13,7 @@ int main( int argc, const char* argv[] )
...
@@ -13,7 +13,7 @@ int main( int argc, const char* argv[] )
uniset
::
uniset_init
(
argc
,
argv
);
uniset
::
uniset_init
(
argc
,
argv
);
int
returnCode
=
session
.
applyCommandLine
(
argc
,
argv
,
Catch
::
Session
::
OnUnusedOptions
::
Ignore
);
int
returnCode
=
session
.
applyCommandLine
(
argc
,
argv
);
if
(
returnCode
!=
0
)
// Indicates a command line error
if
(
returnCode
!=
0
)
// Indicates a command line error
return
returnCode
;
return
returnCode
;
...
...
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