Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
A
ApplicationCore
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
ChimeraTK Mirror
ApplicationCore
Commits
b092c4ad
Commit
b092c4ad
authored
8 years ago
by
Martin Christoph Hierholzer
Browse files
Options
Downloads
Patches
Plain Diff
fixed readAny no longer working due to a broken TestDecoratorTransferFuture
parent
8b5d6553
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
include/TestDecoratorRegisterAccessor.h
+29
-6
29 additions, 6 deletions
include/TestDecoratorRegisterAccessor.h
tests/executables_src/testTestFacilities.cc
+0
-1
0 additions, 1 deletion
tests/executables_src/testTestFacilities.cc
with
29 additions
and
7 deletions
include/TestDecoratorRegisterAccessor.h
+
29
−
6
View file @
b092c4ad
...
...
@@ -24,21 +24,23 @@ namespace ChimeraTK {
TestDecoratorTransferFuture
()
:
_originalFuture
{
nullptr
}
{}
TestDecoratorTransferFuture
(
TransferFuture
&
originalFuture
,
boost
::
shared_ptr
<
TestDecoratorRegisterAccessor
<
UserType
>>
accessor
)
TestDecoratorTransferFuture
(
TransferFuture
&
originalFuture
,
TestDecoratorRegisterAccessor
<
UserType
>
*
accessor
)
:
_originalFuture
(
&
originalFuture
),
_accessor
(
accessor
)
{
TransferFuture
::
_theFuture
=
_originalFuture
->
getBoostFuture
();
TransferFuture
::
_transferElement
=
&
(
_originalFuture
->
getTransferElement
());
}
virtual
~
TestDecoratorTransferFuture
()
{}
void
wait
()
override
{
try
{
Application
::
getTestableModeLockObject
().
unlock
();
}
catch
(
std
::
system_error
&
e
)
{
// ignore operation not permitted errors, since they happen the first time (lock not yet owned)
if
(
e
.
code
()
!=
std
::
errc
::
operation_not_permitted
)
throw
e
;
if
(
e
.
code
()
!=
std
::
errc
::
operation_not_permitted
)
throw
;
}
boost
::
this_thread
::
interruption_point
();
_originalFuture
->
wait
();
_accessor
->
postRead
();
_accessor
->
hasActiveFuture
=
false
;
...
...
@@ -46,11 +48,27 @@ namespace ChimeraTK {
--
Application
::
getInstance
().
testableMode_counter
;
}
TestDecoratorTransferFuture
&
operator
=
(
const
TestDecoratorTransferFuture
&&
other
)
{
TransferFuture
::
_theFuture
=
other
.
_theFuture
;
TransferFuture
::
_transferElement
=
other
.
_transferElement
;
_originalFuture
=
other
.
_originalFuture
;
_accessor
=
other
.
_accessor
;
return
*
this
;
}
TestDecoratorTransferFuture
(
TestDecoratorTransferFuture
&&
other
)
:
TransferFuture
(
other
.
_theFuture
,
other
.
_transferElement
),
_originalFuture
(
other
.
_originalFuture
),
_accessor
(
other
.
_accessor
)
{}
TestDecoratorTransferFuture
(
const
TestDecoratorTransferFuture
&
other
)
=
delete
;
protected
:
TransferFuture
*
_originalFuture
;
boost
::
shared_ptr
<
TestDecoratorRegisterAccessor
<
UserType
>
>
_accessor
;
TestDecoratorRegisterAccessor
<
UserType
>
*
_accessor
;
};
/*******************************************************************************************************************/
...
...
@@ -66,6 +84,9 @@ namespace ChimeraTK {
for
(
size_t
i
=
0
;
i
<
_accessor
->
getNumberOfChannels
();
++
i
)
buffer_2D
[
i
]
=
_accessor
->
accessChannel
(
i
);
}
virtual
~
TestDecoratorRegisterAccessor
()
{}
void
write
()
override
{
preWrite
();
auto
&
myLock
=
Application
::
getTestableModeLockObject
();
...
...
@@ -92,10 +113,12 @@ namespace ChimeraTK {
}
TransferFuture
&
readAsync
()
override
{
if
(
TransferElement
::
hasActiveFuture
)
{
return
activeTestDecoratorFuture
;
}
auto
&
future
=
_accessor
->
readAsync
();
auto
sharedThis
=
boost
::
static_pointer_cast
<
TestDecoratorRegisterAccessor
<
UserType
>>
(
this
->
shared_from_this
());
TransferElement
::
hasActiveFuture
=
true
;
activeTestDecoratorFuture
=
TestDecoratorTransferFuture
<
UserType
>
(
future
,
sharedT
his
);
activeTestDecoratorFuture
=
TestDecoratorTransferFuture
<
UserType
>
(
future
,
t
his
);
return
activeTestDecoratorFuture
;
}
...
...
This diff is collapsed.
Click to expand it.
tests/executables_src/testTestFacilities.cc
+
0
−
1
View file @
b092c4ad
...
...
@@ -279,7 +279,6 @@ BOOST_AUTO_TEST_CASE_TEMPLATE( testReadAny, T, test_types ) {
auto
v3
=
test
.
getScalar
<
T
>
(
"input/v3"
);
auto
v4
=
test
.
getScalar
<
T
>
(
"input/v4"
);
test
.
runApplication
();
// check that we don't receive anything yet
usleep
(
10000
);
BOOST_CHECK
(
value
.
readNonBlocking
()
==
false
);
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment