File: c2bTests.h

package info (click to toggle)
cb2bib 1.9.2-1
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 3,368 kB
  • sloc: cpp: 24,179; sh: 481; makefile: 16
file content (58 lines) | stat: -rw-r--r-- 1,375 bytes parent folder | download
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
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
/***************************************************************************
 *   Copyright (C) 2004-2015 by Pere Constans
 *   constans@molspaces.com
 *   cb2Bib version 1.9.2. Licensed under the GNU GPL version 3.
 *   See the LICENSE file that comes with this distribution.
 ***************************************************************************/
#ifndef C2BTESTS_H
#define C2BTESTS_H

#include <QString>

class QTextStream;
class bibParser;
class bibReference;


/**
    Test cb2Bib functionality
*/
class c2bTests
{

public:
    c2bTests();
    ~c2bTests();

    int allTests();


private:
    QString _bibliographic_dir;
    QString decomposition(const QChar& c);
    QTextStream& cout;
    int _failed_test_count;
    int _test_count;
    void author_parser();
    void check_test(const bool passed, const QString& input, const QString& output);
    void compression_check();
    void heuristic(bibParser& bp, const bibReference& reference, const QString& text);
    void heuristic_author();
    void heuristic_check_patterns();
    void heuristic_journal();
    void heuristic_misc();
    void heuristic_pvny();
    void write(const bibParser& bp, const bibReference& reference);
    void write_information();

    inline const char* boolToStr(bool b)
    {
        if (b)
            return "passed";
        else
            return "failed";
    }

};

#endif