MCPcopy Create free account
hub / github.com/OpenStarbound/OpenStarbound / TEST

Function TEST

source/test/spawn_test.cpp:24–36  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

22}
23
24TEST(SpawnTest, RandomCelestialWorld) {
25 CelestialMasterDatabase celestialDatabase;
26 Maybe<CelestialCoordinate> celestialWorld = celestialDatabase.findRandomWorld(10, 50, [&](CelestialCoordinate const& coord) {
27 return celestialDatabase.parameters(coord)->isVisitable();
28 });
29 ASSERT_TRUE((bool)celestialWorld);
30
31 TestUniverse testUniverse(Vec2U(100, 100));
32 WorldId worldId = CelestialWorldId(*celestialWorld);
33 testUniverse.warpPlayer(worldId);
34 EXPECT_EQ(testUniverse.currentPlayerWorld(), worldId);
35 validateWorld(testUniverse);
36}
37
38TEST(SpawnTest, RandomInstanceWorld) {
39 auto& root = Root::singleton();

Callers

nothing calls this directly

Calls 13

validateWorldFunction · 0.85
singletonClass · 0.85
InstanceWorldIdClass · 0.85
findRandomWorldMethod · 0.80
isVisitableMethod · 0.80
currentPlayerWorldMethod · 0.80
toObjectMethod · 0.80
jsonMethod · 0.80
assetsMethod · 0.80
parametersMethod · 0.45
warpPlayerMethod · 0.45
keysMethod · 0.45

Tested by

no test coverage detected