MCPcopy Create free account
hub / github.com/comaps/comaps / UNIT_TEST

Function UNIT_TEST

libs/drape/drape_tests/glyph_packer_test.cpp:4–26  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2#include "testing/testing.hpp"
3
4UNIT_TEST(SimplePackTest)
5{
6 dp::GlyphPacker packer(m2::PointU(32, 32));
7
8 m2::RectU r;
9
10 TEST(packer.PackGlyph(10, 13, r), ());
11 TEST_EQUAL(r, m2::RectU(0, 0, 10, 13), ());
12
13 TEST(packer.PackGlyph(18, 8, r), ());
14 TEST_EQUAL(r, m2::RectU(10, 0, 28, 8), ());
15
16 TEST(packer.PackGlyph(4, 15, r), ());
17 TEST_EQUAL(r, m2::RectU(28, 0, 32, 15), ());
18
19 TEST(packer.PackGlyph(7, 10, r), ());
20 TEST(!packer.IsFull(), ());
21 TEST_EQUAL(r, m2::RectU(0, 15, 7, 25), ());
22
23 TEST(!packer.PackGlyph(12, 18, r), ());
24 TEST(packer.IsFull(), ());
25 TEST_EQUAL(r, m2::RectU(0, 15, 7, 25), ());
26}

Callers

nothing calls this directly

Calls 3

TESTFunction · 0.85
PackGlyphMethod · 0.80
IsFullMethod · 0.45

Tested by

no test coverage detected