TaskTree tests: Introduce GroupCanceled check

Task-number: QTCREATORBUG-29834
Change-Id: I1bf716e662b279c1a85b7f95f81a61be39ee3110
Reviewed-by: hjk <hjk@qt.io>
This commit is contained in:
Jarek Kobus
2023-11-04 09:44:33 +01:00
parent 1da7f18fb7
commit 273518c82f

View File

@@ -24,7 +24,8 @@ enum class Handler {
Canceled, Canceled,
GroupSetup, GroupSetup,
GroupSuccess, GroupSuccess,
GroupError, // TODO: Add GroupCanceled GroupError,
GroupCanceled,
Sync, Sync,
BarrierAdvance, BarrierAdvance,
Timeout Timeout
@@ -214,7 +215,12 @@ GroupItem createBarrierAdvance(const TreeStorage<CustomStorage> &storage,
static Handler resultToGroupHandler(DoneWith result) static Handler resultToGroupHandler(DoneWith result)
{ {
return result == DoneWith::Success ? Handler::GroupSuccess : Handler::GroupError; switch (result) {
case DoneWith::Success : return Handler::GroupSuccess;
case DoneWith::Error : return Handler::GroupError;
case DoneWith::Cancel : return Handler::GroupCanceled;
}
return Handler::GroupCanceled;
} }
void tst_Tasking::testTree_data() void tst_Tasking::testTree_data()
@@ -980,7 +986,7 @@ void tst_Tasking::testTree_data()
{2, Handler::Setup}, {2, Handler::Setup},
{2, Handler::Error}, {2, Handler::Error},
{1, Handler::Canceled}, {1, Handler::Canceled},
{1, Handler::GroupError}, {1, Handler::GroupCanceled},
{2, Handler::GroupError} {2, Handler::GroupError}
}; };
@@ -1042,7 +1048,7 @@ void tst_Tasking::testTree_data()
{2, Handler::Setup}, {2, Handler::Setup},
{3, Handler::Error}, {3, Handler::Error},
{2, Handler::Canceled}, {2, Handler::Canceled},
{1, Handler::GroupError}, {1, Handler::GroupCanceled},
{2, Handler::GroupError} {2, Handler::GroupError}
}; };
@@ -1122,7 +1128,7 @@ void tst_Tasking::testTree_data()
{2, Handler::Setup}, {2, Handler::Setup},
{3, Handler::Error}, {3, Handler::Error},
{2, Handler::Canceled}, {2, Handler::Canceled},
{1, Handler::GroupError}, {1, Handler::GroupCanceled},
{2, Handler::GroupError} {2, Handler::GroupError}
}; };