Skip to content

Commit 47974dd

Browse files
committed
Created first unit test
1 parent a07d46b commit 47974dd

1 file changed

Lines changed: 53 additions & 0 deletions

File tree

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
#include <gtest/gtest.h>
2+
#include <fstream>
3+
4+
extern "C"
5+
{
6+
#include "../../../INCHI-1-SRC/INCHI_BASE/src/inchi_api.h"
7+
#include "../../../INCHI-1-SRC/INCHI_BASE/src/mode.h"
8+
}
9+
10+
TEST(test_atropisomers, test_Atropisomers_molfile_v2)
11+
{
12+
const char *molblock =
13+
"test_mol_2 \n"
14+
" Ketcher 1302610202D 1 1.00000 0.00000 0 \n"
15+
" \n"
16+
" 13 12 0 0 0 0 0 0 0 0999 V2000 \n"
17+
" 2.9420 -4.1000 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 \n"
18+
" 3.8080 -3.6000 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 \n"
19+
" 4.6740 -4.1000 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 \n"
20+
" 5.5401 -3.6000 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 \n"
21+
" 6.4061 -4.1000 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 \n"
22+
" 7.2721 -3.6000 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 \n"
23+
" 8.1381 -4.1000 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 \n"
24+
" 6.4061 -5.1000 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 \n"
25+
" 5.5401 -2.6000 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 \n"
26+
" 5.5401 -5.6000 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 \n"
27+
" 5.5401 -6.6000 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 \n"
28+
" 6.4061 -2.1000 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 \n"
29+
" 6.4061 -1.1000 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 \n"
30+
" 1 2 1 0 0 0 \n"
31+
" 2 3 1 0 0 0 \n"
32+
" 3 4 1 0 0 0 \n"
33+
" 4 5 1 0 0 0 \n"
34+
" 5 6 1 0 0 0 \n"
35+
" 6 7 1 0 0 0 \n"
36+
" 5 8 1 0 0 0 \n"
37+
" 4 9 1 0 0 0 \n"
38+
" 8 10 1 0 0 0 \n"
39+
" 10 11 1 0 0 0 \n"
40+
" 9 12 1 0 0 0 \n"
41+
" 12 13 1 0 0 0 \n"
42+
"M END \n";
43+
44+
char options[] = "-EnhancedStereochemistry";
45+
inchi_Output output;
46+
inchi_Output *poutput = &output;
47+
const char expected_inchi[] = "InChI=1B/C13H28/c1-5-9-12(8-4)13(10-6-2)11-7-3/h12-13H,5-11H2,1-4H3";
48+
49+
EXPECT_EQ(MakeINCHIFromMolfileText(molblock, options, poutput), 1);
50+
EXPECT_STREQ(poutput->szInChI, expected_inchi);
51+
52+
FreeINCHI(poutput);
53+
}

0 commit comments

Comments
 (0)