-
Notifications
You must be signed in to change notification settings - Fork 22
Expand file tree
/
Copy pathtest_ichimake.cpp
More file actions
90 lines (65 loc) · 1.99 KB
/
test_ichimake.cpp
File metadata and controls
90 lines (65 loc) · 1.99 KB
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
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
#include <gtest/gtest.h>
#include <gmock/gmock.h>
#include <unistd.h>
#include <sys/stat.h>
#include <fstream>
#include <filesystem>
#include <vector>
extern "C"
{
#include "../../../INCHI-1-SRC/INCHI_BASE/src/ichimake.c"
#include "../../../INCHI-1-SRC/INCHI_BASE/src/ichi_io.h"
}
TEST(test_ichimake, test_GetSp3RelRacAbs_none)
{
INChI inchi = {0};
INChI_Stereo stereo = {0};
stereo.nNumberOfStereoCenters = 0;
// pINChI->bDeleted
// Stereo->nCompInv2Abs
// 0: No inversion (structure unchanged by inversion)
// Positive integer (>0): Indicates inversion changes the structure (normal/absolute stereo)
// Negative integer (<0): Indicates inversion changes the structure (inverted/absolute stereo)
//int GetSp3RelRacAbs(const INChI* pINChI, INChI_Stereo* Stereo);
int result = GetSp3RelRacAbs(&inchi, &stereo);
EXPECT_EQ(result, SP3_NONE);
}
TEST(test_ichimake, test_GetSp3RelRacAbs_sp3)
{
INChI inchi = {0};
INChI_Stereo stereo = {0};
stereo.nNumberOfStereoCenters = 1;
stereo.nCompInv2Abs = 0;
int result = GetSp3RelRacAbs(&inchi, &stereo);
EXPECT_EQ(result, SP3_ONLY);
}
TEST(test_ichimake, test_GetSp3RelRacAbs_rel)
{
INChI inchi = {0};
INChI_Stereo stereo = {0};
inchi.nFlags = INCHI_FLAG_REL_STEREO;
stereo.nNumberOfStereoCenters = 1;
stereo.nCompInv2Abs = 1;
int result = GetSp3RelRacAbs(&inchi, &stereo);
EXPECT_EQ(result, SP3_REL);
}
TEST(test_ichimake, test_GetSp3RelRacAbs_rac)
{
INChI inchi = {0};
INChI_Stereo stereo = {0};
inchi.nFlags = INCHI_FLAG_RAC_STEREO;
stereo.nNumberOfStereoCenters = 1;
stereo.nCompInv2Abs = 1;
int result = GetSp3RelRacAbs(&inchi, &stereo);
EXPECT_EQ(result, SP3_RAC);
}
TEST(test_ichimake, test_GetSp3RelRacAbs_abs)
{
INChI inchi = {0};
INChI_Stereo stereo = {0};
inchi.nFlags = 0x0111;
stereo.nNumberOfStereoCenters = 1;
stereo.nCompInv2Abs = 1;
int result = GetSp3RelRacAbs(&inchi, &stereo);
EXPECT_EQ(result, SP3_ABS);
}