Luanti 5.10.0-dev
 
Loading...
Searching...
No Matches
TestNoise Class Reference
+ Inheritance diagram for TestNoise:
+ Collaboration diagram for TestNoise:

Public Member Functions

 TestNoise ()
 
const char * getName ()
 
void runTests (IGameDef *gamedef)
 
void testNoise2dAtOriginWithZeroSeed ()
 
void testNoise2dWithMaxSeed ()
 
void testNoise2dWithFunPrimes ()
 
void testNoise2dPoint ()
 
void testNoise2dBulk ()
 
void testNoise3dAtOriginWithZeroSeed ()
 
void testNoise3dWithMaxSeed ()
 
void testNoise3dWithFunPrimes ()
 
void testNoise3dPoint ()
 
void testNoise3dBulk ()
 
void testNoiseInvalidParams ()
 
- Public Member Functions inherited from TestBase
bool testModule (IGameDef *gamedef)
 
std::string getTestTempDirectory ()
 
std::string getTestTempFile ()
 
void runTest (const char *name, std::function< void()> &&test)
 

Static Public Attributes

static const float expected_2d_results [10 *10]
 
static const float expected_3d_results [10 *10 *10]
 

Additional Inherited Members

- Public Attributes inherited from TestBase
u32 num_tests_failed
 
u32 num_tests_run
 

Constructor & Destructor Documentation

◆ TestNoise()

TestNoise::TestNoise ( )
inline

References TestManager::registerTestModule().

+ Here is the call graph for this function:

Member Function Documentation

◆ getName()

const char * TestNoise::getName ( )
inlinevirtual

Implements TestBase.

◆ runTests()

void TestNoise::runTests ( IGameDef * gamedef)
virtual

Implements TestBase.

References TEST, testNoise2dAtOriginWithZeroSeed(), testNoise2dBulk(), testNoise2dPoint(), testNoise2dWithFunPrimes(), testNoise2dWithMaxSeed(), testNoise3dAtOriginWithZeroSeed(), testNoise3dBulk(), testNoise3dPoint(), testNoise3dWithFunPrimes(), testNoise3dWithMaxSeed(), and testNoiseInvalidParams().

+ Here is the call graph for this function:

◆ testNoise2dAtOriginWithZeroSeed()

void TestNoise::testNoise2dAtOriginWithZeroSeed ( )

References noise2d(), and UASSERT.

Referenced by runTests().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ testNoise2dBulk()

void TestNoise::testNoise2dBulk ( )

References expected_2d_results, Noise::perlinMap2D(), and UASSERT.

Referenced by runTests().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ testNoise2dPoint()

void TestNoise::testNoise2dPoint ( )

References expected_2d_results, NoisePerlin2D(), and UASSERT.

Referenced by runTests().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ testNoise2dWithFunPrimes()

void TestNoise::testNoise2dWithFunPrimes ( )

References noise2d(), and UASSERT.

Referenced by runTests().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ testNoise2dWithMaxSeed()

void TestNoise::testNoise2dWithMaxSeed ( )

References noise2d(), and UASSERT.

Referenced by runTests().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ testNoise3dAtOriginWithZeroSeed()

void TestNoise::testNoise3dAtOriginWithZeroSeed ( )

References noise2d(), and UASSERT.

Referenced by runTests().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ testNoise3dBulk()

void TestNoise::testNoise3dBulk ( )

References expected_3d_results, Noise::perlinMap3D(), and UASSERT.

Referenced by runTests().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ testNoise3dPoint()

void TestNoise::testNoise3dPoint ( )

References expected_3d_results, NoisePerlin3D(), and UASSERT.

Referenced by runTests().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ testNoise3dWithFunPrimes()

void TestNoise::testNoise3dWithFunPrimes ( )

References noise2d(), and UASSERT.

Referenced by runTests().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ testNoise3dWithMaxSeed()

void TestNoise::testNoise3dWithMaxSeed ( )

References noise3d(), and UASSERT.

Referenced by runTests().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ testNoiseInvalidParams()

void TestNoise::testNoiseInvalidParams ( )

References Noise::perlinMap3D(), and UASSERT.

Referenced by runTests().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

Member Data Documentation

◆ expected_2d_results

const float TestNoise::expected_2d_results
static
Initial value:
= {
19.11726, 18.49626, 16.48476, 15.02135, 14.75713, 16.26008, 17.54822,
18.06860, 18.57016, 18.48407, 18.49649, 17.89160, 15.94162, 14.54901,
14.31298, 15.72643, 16.94669, 17.55494, 18.58796, 18.87925, 16.08101,
15.53764, 13.83844, 12.77139, 12.73648, 13.95632, 14.97904, 15.81829,
18.37694, 19.73759, 13.19182, 12.71924, 11.34560, 10.78025, 11.18980,
12.52303, 13.45012, 14.30001, 17.43298, 19.15244, 10.93217, 10.48625,
9.30923, 9.18632, 10.16251, 12.11264, 13.19697, 13.80801, 16.39567,
17.66203, 10.40222, 9.86070, 8.47223, 8.45471, 10.04780, 13.54730,
15.33709, 15.48503, 16.46177, 16.52508, 10.80333, 10.19045, 8.59420,
8.47646, 10.22676, 14.43173, 16.48353, 16.24859, 16.20863, 15.52847,
11.01179, 10.45209, 8.98678, 8.83986, 10.43004, 14.46054, 16.29387,
15.73521, 15.01744, 13.85542, 10.55201, 10.33375, 9.85102, 10.07821,
11.58235, 15.62046, 17.35505, 16.13181, 12.66011, 9.51853, 11.50994,
11.54074, 11.77989, 12.29790, 13.76139, 17.81982, 19.49008, 17.79470,
12.34344, 7.78363,
}

Referenced by testNoise2dBulk(), and testNoise2dPoint().

◆ expected_3d_results

const float TestNoise::expected_3d_results
static

The documentation for this class was generated from the following file: