LIMA
Libre Multilingual Analyzer — C++ API
Loading...
Searching...
No Matches
DictionaryDataTest1-src.cpp
Go to the documentation of this file.
1// Copyright 2002-2013 CEA LIST
2// SPDX-FileCopyrightText: 2022 CEA LIST <gael.de-chalendar@cea.fr>
3//
4// SPDX-License-Identifier: MIT
5
6// clazy:skip
7
8
9// To be defined as a variable set at build time
10#define UNIT_TEST
11
12#define BOOST_TEST_DYN_LINK
13#define BOOST_TEST_MODULE DictionaryDataTest
14#include <boost/test/unit_test.hpp>
15
17
18using namespace Lima;
19
20// create DictionaryData and check segment adress
21BOOST_AUTO_TEST_CASE( DictionaryDataTest1 )
22{
23
24 //value of LIMA_RESOURCE_DIR is set by find_package(LIMADATA) and LIMALDATAConfig.cmake;
25 std::string resourcesPath("@LIMA_RESOURCE_DIR@");
26 // create and read DictionaryData
28 std::string dicoFile(resourcesPath);
29 dicoFile.append("/LinguisticProcessings/fre/dicoDat-fre.dat");
30 dicoData.loadBinaryFile(dicoFile);
31
32 // uint64_t getSize() const;
33 uint64_t size = dicoData.getSize();
34 BOOST_REQUIRE(size == 660157);
35
36 // test unsigned char* getEntryAddr(uint64_t index) const;
37 uint64_t index(0);
38 unsigned char*entryAddr = dicoData.getEntryAddr(index);
39 std::cout << "dicoData.getEntryAddr[0]=" << hex << static_cast<void*>(entryAddr) << std::endl;
40 std::cout << "dicoData..m_data=" << hex << static_cast<void*>(dicoData.m_data) << std::endl;
41// BOOST_REQUIRE();
42 // Que tester???
43 // Il faudrait un petit dictionnaire bien contrôlé pour effectuer un jeu de test efficace
44
45
46 // test inline unsigned char* getLingPropertiesAddr(uint64_t index) const;
47 // unsigned char*
48 // getLingPropertiesAddr(index);
49
50 // test public uint64_t getSize() const;
51
52 // test public static uint64_t readCodedInt(unsigned char* &p);
53
54}
BOOST_AUTO_TEST_CASE(DictionaryDataTest1)
unsigned char * getEntryAddr(uint64_t index) const
NAUTITIA.