Project

Profile

Help

How to connect?
Download (1.13 KB) Statistics
| Branch: | Revision:

he / src / main / c / samples / cppTests / CppTestUtils.h @ 339c45ee

1
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
2
// Copyright (c) 2021 Saxonica Limited.
3
// This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0.
4
// If a copy of the MPL was not distributed with this file, You can obtain one at http://mozilla.org/MPL/2.0/.
5
// This Source Code Form is "Incompatible With Secondary Licenses", as defined by the Mozilla Public License, v. 2.0.
6
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
7

    
8

    
9
#ifndef CPPTESTS_CPPTESTUTILS_H
10
#define CPPTESTS_CPPTESTUTILS_H
11

    
12
#ifdef WINDOWS
13
#include <direct.h>
14
#define GetCurrentDir _getcwd
15
#else
16
#include <unistd.h>
17
#define GetCurrentDir getcwd
18
#endif
19
#include <list>
20

    
21

    
22
typedef struct
23
{
24
    int success;
25
    int failure;
26
    std::list<std::string> failureList;
27

    
28
}sResultCount;
29

    
30

    
31
class CppTestUtils {
32

    
33
public:
34
static int exists(const char *fname)
35
{
36
    FILE *file;
37
    file = fopen(fname, "r");
38
    if (file)
39
    {
40
        fclose(file);
41
        return 1;
42
    }
43
    return 0;
44
}
45

    
46
private:
47

    
48
};
49

    
50
#endif //CPPTESTS_CPPTESTUTILS_H
(2-2/28)