File: SgfUtilTest.cpp

package info (click to toggle)
pentobi 29.0-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 3,892 kB
  • sloc: cpp: 25,719; javascript: 875; xml: 40; makefile: 13; sh: 6
file content (27 lines) | stat: -rw-r--r-- 954 bytes parent folder | download | duplicates (2)
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
//-----------------------------------------------------------------------------
/** @file libboardgame_base/tests/SgfUtilTest.cpp
    @author Markus Enzenberger
    @copyright GNU General Public License version 3 or later */
//-----------------------------------------------------------------------------

#include "libboardgame_base/SgfUtil.h"

#include "libboardgame_test/Test.h"

using namespace std;
using namespace libboardgame_base;

//-----------------------------------------------------------------------------

LIBBOARDGAME_TEST_CASE(sgf_util_get_path_from_root)
{
    auto root = make_unique<SgfNode>();
    auto& child = root->create_new_child();
    vector<const SgfNode*> path;
    get_path_from_root(child, path);
    LIBBOARDGAME_CHECK_EQUAL(path.size(), 2u)
    LIBBOARDGAME_CHECK_EQUAL(path[0], root.get())
    LIBBOARDGAME_CHECK_EQUAL(path[1], &child)
}

//-----------------------------------------------------------------------------