Skip to content

Commit

Permalink
Attempt to tick during test.
Browse files Browse the repository at this point in the history
  • Loading branch information
kring committed Sep 23, 2024
1 parent dfc393f commit 460a559
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 3 deletions.
5 changes: 4 additions & 1 deletion Source/CesiumRuntime/Private/Tests/CesiumTestHelpers.h
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,10 @@ void waitForImpl(
done.Execute();
} else {
pWorld->GetTimerManager().SetTimerForNextTick(
[done, pWorld, condition, timerHandle]() mutable {
[done,
pWorld,
condition = std::forward<T>(condition),
timerHandle]() mutable {
waitForImpl<T>(done, pWorld, std::move(condition), timerHandle);
});
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,10 +59,13 @@ void FSampleHeightMostDetailedSpec::Define() {
"works with a single position",
EAsyncExecution::TaskGraphMainThread,
[this](const FDoneDelegate& done) {
CesiumAsync::Promise<void> foo =
getAsyncSystem().createPromise<void>();

pTileset->SampleHeightMostDetailed(
{FVector(-105.1, 40.1, 1.0)},
FCesiumSampleHeightMostDetailedCallback::CreateLambda(
[this, done](
[this, done, foo](
ACesium3DTileset* pTileset,
const TArray<FCesiumSampleHeightResult>& result,
const TArray<FString>& warnings) {
Expand All @@ -85,8 +88,17 @@ void FSampleHeightMostDetailedSpec::Define() {
result[0].LongitudeLatitudeHeight.Z,
1.0,
1.0));
done.ExecuteIfBound();
foo.resolve();
// done.ExecuteIfBound();
}));

CesiumTestHelpers::waitFor(
done,
CesiumTestHelpers::getGlobalWorldContext(),
30.0f,
[future = foo.getFuture().share()]() {
return future.isReady();
});
});

LatentIt(
Expand Down

0 comments on commit 460a559

Please sign in to comment.