File: SceneStatistics.cpp

package info (click to toggle)
darkradiant 3.9.0-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 41,080 kB
  • sloc: cpp: 264,743; ansic: 10,659; python: 1,852; xml: 1,650; sh: 92; makefile: 21
file content (29 lines) | stat: -rw-r--r-- 1,141 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
#include "RadiantTest.h"

#include "scene/ShaderBreakdown.h"

namespace test
{

using SceneStatisticsTest = RadiantTest;

TEST_F(SceneStatisticsTest, MaterialBreakDown)
{
    loadMap("material_usage.map");

    scene::ShaderBreakdown breakdown;

    const auto& map = breakdown.getMap();

    // Compare the whole array (Faces, Patches, Models, Particles)
    EXPECT_EQ(map.at("textures/common/collision"), (std::array<std::size_t, 4>({ 0, 0, 1, 0 })));
    EXPECT_EQ(map.at("textures/darkmod/decals/vegetation/moss_patch_thick01"), (std::array<std::size_t, 4>({ 0, 0, 1, 0 })));
    EXPECT_EQ(map.at("textures/numbers/0"), (std::array<std::size_t, 4>({ 6, 2, 0, 0 })));
    EXPECT_EQ(map.at("textures/numbers/1"), (std::array<std::size_t, 4>({ 6, 0, 0, 0 })));
    EXPECT_EQ(map.at("textures/particles/pfiresmall2"), (std::array<std::size_t, 4>({ 0, 0, 0, 1 })));
    EXPECT_EQ(map.at("textures/particles/smokepuff"), (std::array<std::size_t, 4>({ 0, 0, 0, 1 })));
    EXPECT_EQ(map.at("torch"), (std::array<std::size_t, 4>({ 0, 0, 1, 0 })));
    EXPECT_EQ(map.at("torch_shadowcasting"), (std::array<std::size_t, 4>({ 0, 0, 1, 0 })));
}

}