restore and fix some broken tests
..more to come, especially several of the QueryResolver based tests are still broken
This commit is contained in:
parent
933e486cf9
commit
a1d98eb457
6 changed files with 19 additions and 12 deletions
|
|
@ -45,6 +45,10 @@
|
||||||
** AutoRegistered::is_attached_to and AutoRegistered::deactivateRegistryLink
|
** AutoRegistered::is_attached_to and AutoRegistered::deactivateRegistryLink
|
||||||
** can be used for detaching an Registry explicitly before destruction.
|
** can be used for detaching an Registry explicitly before destruction.
|
||||||
** Ignoring this might lead to segfault on application shutdown. /////////////////TICKET #574
|
** Ignoring this might lead to segfault on application shutdown. /////////////////TICKET #574
|
||||||
|
** @warning be sure to understand the implications of object identity,
|
||||||
|
** especially when it comes to closing and opening the Session. Especially
|
||||||
|
** note that Assets use a systematic identity, not an instance identity,
|
||||||
|
** which might lead to removing an old instance from the new session.
|
||||||
**
|
**
|
||||||
** @see session-element-tracker-test.cpp
|
** @see session-element-tracker-test.cpp
|
||||||
** @see session-interface-modules.hpp
|
** @see session-interface-modules.hpp
|
||||||
|
|
|
||||||
|
|
@ -245,7 +245,8 @@ namespace session {
|
||||||
SessManagerImpl::close ()
|
SessManagerImpl::close ()
|
||||||
{
|
{
|
||||||
Lock sync(this);
|
Lock sync(this);
|
||||||
lifecycle_->shutDown();
|
if (isUp())
|
||||||
|
lifecycle_->shutDown();
|
||||||
pSess_.reset();
|
pSess_.reset();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -258,7 +259,8 @@ namespace session {
|
||||||
SessManagerImpl::reset ()
|
SessManagerImpl::reset ()
|
||||||
{
|
{
|
||||||
Lock sync(this);
|
Lock sync(this);
|
||||||
lifecycle_->shutDown();
|
if (isUp())
|
||||||
|
lifecycle_->shutDown();
|
||||||
lifecycle_->pullUp();
|
lifecycle_->pullUp();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -268,7 +270,8 @@ namespace session {
|
||||||
{
|
{
|
||||||
UNIMPLEMENTED ("load serialised session");
|
UNIMPLEMENTED ("load serialised session");
|
||||||
Lock sync(this);
|
Lock sync(this);
|
||||||
lifecycle_->shutDown();
|
if (isUp())
|
||||||
|
lifecycle_->shutDown();
|
||||||
lifecycle_->pullUp();
|
lifecycle_->pullUp();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -530,7 +530,7 @@ END
|
||||||
|
|
||||||
|
|
||||||
TEST "Query support utilities" QueryUtils_test <<END
|
TEST "Query support utilities" QueryUtils_test <<END
|
||||||
out-lit: ..original : a A AA dufte 1a _1 A_A BÄH White space §&Ω%€GΩ%€ar ☠☠☠ baäääääge!!!!! :
|
out-lit: ..original : a A AA dufte 1a _1 A_A BÄH White space §&Ω%€GΩ%€ar ☠☠☠ baäääääge!!!!! :
|
||||||
out-lit: normalised : a a aA dufte o1a o_1 a_A bH o white_space gar_bage :
|
out-lit: normalised : a a aA dufte o1a o_1 a_A bH o white_space gar_bage :
|
||||||
return: 0
|
return: 0
|
||||||
END
|
END
|
||||||
|
|
|
||||||
|
|
@ -112,9 +112,9 @@ namespace test {
|
||||||
CHECK (pipe2 == pipe1);
|
CHECK (pipe2 == pipe1);
|
||||||
pipe2 = Pipe::query ("default(X)");
|
pipe2 = Pipe::query ("default(X)");
|
||||||
CHECK (pipe2 == pipe1);
|
CHECK (pipe2 == pipe1);
|
||||||
pipe2 = Session::current->defaults(Query<Pipe> ());
|
pipe2 = Session::current->defaults(Query<Pipe> (""));
|
||||||
CHECK (pipe2 == pipe1);
|
CHECK (pipe2 == pipe1);
|
||||||
pipe2 = asset::Struct::retrieve (Query<Pipe> ());
|
pipe2 = asset::Struct::retrieve (Query<Pipe> (""));
|
||||||
CHECK (pipe2 == pipe1);
|
CHECK (pipe2 == pipe1);
|
||||||
pipe2 = asset::Struct::retrieve (Query<Pipe> ("default(P)"));
|
pipe2 = asset::Struct::retrieve (Query<Pipe> ("default(P)"));
|
||||||
CHECK (pipe2 == pipe1);
|
CHECK (pipe2 == pipe1);
|
||||||
|
|
@ -143,7 +143,7 @@ namespace test {
|
||||||
void
|
void
|
||||||
failureCreatesNewDefault()
|
failureCreatesNewDefault()
|
||||||
{
|
{
|
||||||
PPipe pipe1 = Session::current->defaults(Query<Pipe> ()); // "the default pipe"
|
PPipe pipe1 = Session::current->defaults(Query<Pipe> ("")); // "the default pipe"
|
||||||
|
|
||||||
string new_pID (str (format ("dummy_%s_%i")
|
string new_pID (str (format ("dummy_%s_%i")
|
||||||
% pipe1->getPipeID()
|
% pipe1->getPipeID()
|
||||||
|
|
|
||||||
|
|
@ -211,11 +211,11 @@ namespace test {
|
||||||
/** @test ensure the asset cleanup doesn't interfere with session shutdown
|
/** @test ensure the asset cleanup doesn't interfere with session shutdown
|
||||||
*/
|
*/
|
||||||
void
|
void
|
||||||
verify_cleanup (PTimeline aTimeline_in_session)
|
verify_cleanup (PTimeline const& aTimeline_in_session)
|
||||||
{
|
{
|
||||||
CHECK (1 < aTimeline_in_session.use_count(), "test object should still be attached to session");
|
CHECK (1 < aTimeline_in_session.use_count(), "test object should still be attached to session");
|
||||||
Session::current.reset();
|
Session::current.reset();
|
||||||
aTimeline_in_session->detach(); // should be a no-op and not cause any invalid access
|
CHECK (1 == aTimeline_in_session.use_count(), "session reset should have de-registered the test object");
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -66,7 +66,7 @@ namespace test{
|
||||||
virtual void
|
virtual void
|
||||||
run (Arg arg)
|
run (Arg arg)
|
||||||
{
|
{
|
||||||
if (isnil(arg)) arg = Cmdline ("Query normaliseID extractID removeTerm countPred");
|
if (isnil(arg)) arg = Cmdline ("normaliseID extractID removeTerm countPred");
|
||||||
|
|
||||||
if (contains (arg, "normaliseID")) check_normaliseID();
|
if (contains (arg, "normaliseID")) check_normaliseID();
|
||||||
if (contains (arg, "extractID" )) check_extractID ();
|
if (contains (arg, "extractID" )) check_extractID ();
|
||||||
|
|
@ -85,11 +85,11 @@ namespace test{
|
||||||
tokens.push_back (" White \t space ");
|
tokens.push_back (" White \t space ");
|
||||||
tokens.push_back ("§&Ω%€GΩ%€ar ☠☠☠ baäääääge!!!!! ");
|
tokens.push_back ("§&Ω%€GΩ%€ar ☠☠☠ baäääääge!!!!! ");
|
||||||
|
|
||||||
cout << "..original : " << tokens << " :"<<endl;
|
cout << "..original : "<<tokens<<" :"<<endl;
|
||||||
|
|
||||||
for_each (tokens, normaliseID, _1 );
|
for_each (tokens, normaliseID, _1 );
|
||||||
|
|
||||||
cout << "normalised : " << tokens << " :"<<endl;
|
cout << "normalised : "<<tokens<<" :"<<endl;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue