Repository: rdkit/rdkit — pull request #6827 (cpp)
Title: Fixes #6816

This PR addressees #6816 by making sure that `reapplyMolBlockWedging()` also restores the double bond stereo depiction as originally specified in the molblock, either V2000 (`sss` bond stereo field) or V3000 (through the `CFG` field in the bond block).
Currently, this was happening only partially for the V3000 format, and not at all for the V2000 format.
I added a unit test to make sure things works as expected; here's the gist that I used to set up the unit test:

[Jupyter notebook used for `TEST_CASE("test GitHub6816")` in `Code/GraphMol/Depictor/catch_tests.cpp`](https://gist.github.com/ptosco/aa51700b3fcafa6e0629a638e1f1cc0a)

UPDATE: this PR also fixes #6893, which was found by @rvianello at a later stage.

Resolved issues:
title: Double bonds should not be depicted as crossed bonds in the presence of wavy bonds
body: I have compared the ChemDraw depictions to RDKit depictions for a few cases where undefined geometric isomerism at a double bond is represented as:

1. _Either_ single bonds on the stereochemistry-determining atoms (bond stereo 4) (Examples 1-3)
2. _Cis or trans (either)_ double bond (bond stereo 3) (Example 4)

```
from rdkit import Chem
from rdkit.Chem.Draw import IPythonConsole, rdMolDraw2D, rdDepictor
```

# Example 1
### ChemDraw
![image](https://github.com/rdkit/rdkit/assets/5244385/fda6d3a9-9427-49b7-b1c1-51fc8d791212)

### RDKit
```
mol = Chem.MolFromMolBlock("""double.mol
  ChemDraw10192311132D

  4  3  0  0  0  0  0  0  0  0999 V2000
   -0.7145    0.2062    0.0000 C   0  0  0  0  0  0  0  0  0  0  0  0
    0.0000    0.6188    0.0000 C   0  0  0  0  0  0  0  0  0  0  0  0
    0.7145    0.2062    0.0000 F   0  0  0  0  0  0  0  0  0  0  0  0
   -0.7145   -0.6188    0.0000 O   0  0  0  0  0  0  0  0  0  0  0  0
  1  2  2  0        0
  2  3  1  4        0
  1  4  1  4        0
M  END
""")
Chem.ReapplyMolBlockWedging(mol)
mol
```
![image](https://github.com/rdkit/rdkit/assets/5244385/48c7b5d1-81e3-4315-9cfc-4a3730157581)

# Example 2
### ChemDraw
![image](https://github.com/rdkit/rdkit/assets/5244385/5d045eb3-2c6e-4bd7-9d2b-194472aaff31)

### RDKit
```
mol = Chem.MolFromMolBlock("""double-2.mol
  ChemDraw10192311332D

  4  3  0  0  0  0  0  0  0  0999 V2000
   -0.3572   -0.2062    0.0000 C   0  0  0  0  0  0  0  0  0  0  0  0
    0.3572    0.2062    0.0000 C   0  0  0  0  0  0  0  0  0  0  0  0
    1.0717    0.6188    0.0000 F   0  0  0  0  0  0  0  0  0  0  0  0
   -1.0717   -0.6188    0.0000 O   0  0  0  0  0  0  0  0  0  0  0  0
  1  2  2  0        0
  2  3  1  4        0
  1  4  1  4        0
M  END
""")
Chem.ReapplyMolBlockWedging(mol)
mol
```
![image](https://github.com/rdkit/rdkit/assets/5244385/38482587-0365-4a9b-81c3-3d169a10cd1f)

# Example 3
### ChemDraw
![image](https://github.com/rdkit/rdkit/assets/5244385/d0951139-484e-41b6-94e4-b4371d4acaaa)

### RDKit
```
mol = Chem.MolFromMolBlock("""di-imine-2-2000.mol
  ChemDraw10192311522D

  8  7  0  0  0  0  0  0  0  0999 V2000
   -0.9959   -1.0600    0.0000 C   0  0  0  0  0  0  0  0  0  0  0  0
   -0.4125   -0.4767    0.0000 C   0  0  0  0  0  0  0  0  0  0  0  0
    0.4125   -0.4767    0.0000 C   0  0  0  0  0  0  0  0  0  0  0  0
    0.9959   -1.0600    0.0000 C   0  0  0  0  0  0  0  0  0  0  0  0
   -0.7282    0.2855    0.0000 N   0  0  0  0  0  0  0  0  0  0  0  0
   -0.9971    1.0600    0.0000 C   0  0  0  0  0  0  0  0  0  0  0  0
    0.7282    0.2855    0.0000 N   0  0  0  0  0  0  0  0  0  0  0  0
    0.9971    1.0270    0.0000 C   0  0  0  0  0  0  0  0  0  0  0  0
  1  2  1  0        0
  2  3  1  0        0
  3  4  1  0        0
  2  5  2  0        0
  5  6  1  4        0
  3  7  2  0        0
  7  8  1  4        0
M  END
""")
Chem.ReapplyMolBlockWedging(mol)
mol
```
![image](https://github.com/rdkit/rdkit/assets/5244385/4092b183-a56c-4ef2-a335-e9c094cb4d6c)

# Example 4
### ChemDraw
![image](https://github.com/rdkit/rdkit/assets/5244385/6aad781d-b086-404d-bdbc-9fe1ad39f363)

### RDKit
```
mol = Chem.MolFromMolBlock("""di-imine-cross-2000.mol
  ChemDraw10192311582D

  8  7  0  0  0  0  0  0  0  0999 V2000
   -1.0099   -1.1129    0.0000 C   0  0  0  0  0  0  0  0  0  0  0  0
   -0.5974   -0.3984    0.0000 C   0  0  0  0  0  0  0  0  0  0  0  0
    0.2276   -0.3984    0.0000 C   0  0  0  0  0  0  0  0  0  0  0  0
    0.6401   -1.1129    0.0000 C   0  0  0  0  0  0  0  0  0  0  0  0
   -0.8109    0.3984    0.0000 N   0  0  0  0  0  0  0  0  0  0  0  0
    0.6401    0.3160    0.0000 N   0  0  0  0  0  0  0  0  0  0  0  0
   -1.2234    1.1129    0.0000 C   0  0  0  0  0  0  0  0  0  0  0  0
    1.2234    0.8994    0.0000 C   0  0  0  0  0  0  0  0  0  0  0  0
  1  2  1  0        0
  2  3  1  0        0
  3  4  1  0        0
  2  5  2  3        0
  3  6  2  3        0
  5  7  1  0        0
  6  8  1  0        0
M  END
""")
Chem.ReapplyMolBlockWedging(mol)
mol
```
![image](https://github.com/rdkit/rdkit/assets/5244385/d43c0563-d6cc-4c1d-ad67-10c1e440e997)

Example 4 looks correct to me.
In examples 1-3 I believe the crossed bond depicted by RDKit is redundant since the wavy bonds are sufficient to specificy undefined stereochemistry.

Hints:

Fix patch:
diff --git a/Code/GraphMol/Chirality.cpp b/Code/GraphMol/Chirality.cpp
index f748b413ca5..ba6b3fdae43 100644
--- a/Code/GraphMol/Chirality.cpp
+++ b/Code/GraphMol/Chirality.cpp
@@ -3303,13 +3303,17 @@ void detectBondStereochemistry(ROMol &mol, int confId) {
   }
 }
 
-void clearSingleBondDirFlags(ROMol &mol) {
+void clearSingleBondDirFlags(ROMol &mol, bool retainCisTransInfo) {
   for (auto bond : mol.bonds()) {
     if (bond->getBondType() == Bond::SINGLE) {
-      if (bond->getBondDir() == Bond::UNKNOWN) {
+      auto bondDir = bond->getBondDir();
+      if (bondDir == Bond::UNKNOWN) {
         bond->setProp(common_properties::_UnknownStereo, 1);
       }
-      bond->setBondDir(Bond::NONE);
+      if (!retainCisTransInfo ||
+          (bondDir != Bond::ENDDOWNRIGHT && bondDir != Bond::ENDUPRIGHT)) {
+        bond->setBondDir(Bond::NONE);
+      }
     }
   }
 }
diff --git a/Code/GraphMol/MolOps.h b/Code/GraphMol/MolOps.h
index 47bf9bdb3b8..8d611d84e02 100644
--- a/Code/GraphMol/MolOps.h
+++ b/Code/GraphMol/MolOps.h
@@ -975,8 +975,10 @@ RDKIT_GRAPHMOL_EXPORT void detectBondStereochemistry(ROMol &mol,
 RDKIT_GRAPHMOL_EXPORT void setDoubleBondNeighborDirections(
     ROMol &mol, const Conformer *conf = nullptr);
 //! removes directions from single bonds. Wiggly bonds will have the property
-//! _UnknownStereo set on them
-RDKIT_GRAPHMOL_EXPORT void clearSingleBondDirFlags(ROMol &mol);
+//! _UnknownStereo set on them. If retainCisTransInfo is true,
+//! ENDUPRIGHT and ENDDOWNRIGHT bond directions will not be cleared
+RDKIT_GRAPHMOL_EXPORT void clearSingleBondDirFlags(
+    ROMol &mol, bool retainCisTransInfo = false);
 
 //! Assign CIS/TRANS bond stereochemistry tags based on neighboring
 //! directions
diff --git a/Code/GraphMol/WedgeBonds.cpp b/Code/GraphMol/WedgeBonds.cpp
index 7ed32594fb3..a24a1e85eaf 100644
--- a/Code/GraphMol/WedgeBonds.cpp
+++ b/Code/GraphMol/WedgeBonds.cpp
@@ -506,7 +506,7 @@ void wedgeBond(Bond *bond, unsigned int fromAtomIdx, const Conformer *conf) {
 }
 
 void reapplyMolBlockWedging(ROMol &mol) {
-  MolOps::clearSingleBondDirFlags(mol);
+  MolOps::clearSingleBondDirFlags(mol, true);
   for (auto b : mol.bonds()) {
     int explicit_unknown_stereo = -1;
     if (b->getPropIfPresent<int>(common_properties::_UnknownStereo,
@@ -522,25 +522,40 @@ void reapplyMolBlockWedging(ROMol &mol) {
       } else if (bond_dir == 6) {
         b->setBondDir(Bond::BEGINDASH);
       }
+      if (b->getBondType() == Bond::DOUBLE) {
+        if (bond_dir == 0 && b->getStereo() == Bond::STEREOANY) {
+          b->setBondDir(Bond::NONE);
+          b->setStereo(Bond::STEREONONE);
+        } else if (bond_dir == 3) {
+          b->setBondDir(Bond::EITHERDOUBLE);
+          b->setStereo(Bond::STEREOANY);
+        }
+      }
     }
     int cfg = -1;
-    if (b->getPropIfPresent<int>(common_properties::_MolFileBondCfg, cfg)) {
-      switch (cfg) {
-        case 1:
-          b->setBondDir(Bond::BEGINWEDGE);
-          break;
-        case 2:
-          if (b->getBondType() == Bond::SINGLE) {
-            b->setBondDir(Bond::UNKNOWN);
-          } else if (b->getBondType() == Bond::DOUBLE) {
-            b->setBondDir(Bond::EITHERDOUBLE);
-            b->setStereo(Bond::STEREOANY);
-          }
-          break;
-        case 3:
-          b->setBondDir(Bond::BEGINDASH);
-          break;
-      }
+    b->getPropIfPresent<int>(common_properties::_MolFileBondCfg, cfg);
+    switch (cfg) {
+      case 1:
+        b->setBondDir(Bond::BEGINWEDGE);
+        break;
+      case 2:
+        if (b->getBondType() == Bond::SINGLE) {
+          b->setBondDir(Bond::UNKNOWN);
+        } else if (b->getBondType() == Bond::DOUBLE) {
+          b->setBondDir(Bond::EITHERDOUBLE);
+          b->setStereo(Bond::STEREOANY);
+        }
+        break;
+      case 3:
+        b->setBondDir(Bond::BEGINDASH);
+        break;
+      case 0:
+      case -1:
+        if (bond_dir == -1 && b->getBondType() == Bond::DOUBLE &&
+            b->getStereo() == Bond::STEREOANY) {
+          b->setBondDir(Bond::NONE);
+          b->setStereo(Bond::STEREONONE);
+        }
     }
   }
 }


Test patch:
diff --git a/Code/GraphMol/Depictor/catch_tests.cpp b/Code/GraphMol/Depictor/catch_tests.cpp
index a4dbf1ccb22..eb371851c17 100644
--- a/Code/GraphMol/Depictor/catch_tests.cpp
+++ b/Code/GraphMol/Depictor/catch_tests.cpp
@@ -1179,3 +1179,878 @@ M  END
     }
   }
 }
+
+TEST_CASE("test GitHub6816") {
+  SECTION("double-2000") {
+    auto mol = R"CTAB(double-2000.mol
+  ChemDraw10192311132D
+
+  4  3  0  0  0  0  0  0  0  0999 V2000
+   -0.7145    0.2062    0.0000 C   0  0  0  0  0  0  0  0  0  0  0  0
+    0.0000    0.6188    0.0000 C   0  0  0  0  0  0  0  0  0  0  0  0
+    0.7145    0.2062    0.0000 F   0  0  0  0  0  0  0  0  0  0  0  0
+   -0.7145   -0.6188    0.0000 O   0  0  0  0  0  0  0  0  0  0  0  0
+  1  2  2  0        0
+  2  3  1  4        0
+  1  4  1  4        0
+M  END
+)CTAB"_ctab;
+    REQUIRE(mol);
+    CHECK(mol->getBondWithIdx(0)->getStereo() == Bond::STEREOANY);
+    CHECK(mol->getBondWithIdx(0)->getBondDir() == Bond::NONE);
+    CHECK(!mol->getBondWithIdx(0)->hasProp(
+        common_properties::_MolFileBondStereo));
+    CHECK(!mol->getBondWithIdx(0)->hasProp(common_properties::_MolFileBondCfg));
+    CHECK(!mol->getBondWithIdx(0)->hasProp(common_properties::_UnknownStereo));
+
+    CHECK(mol->getBondWithIdx(1)->getStereo() == Bond::STEREONONE);
+    CHECK(mol->getBondWithIdx(1)->getBondDir() == Bond::NONE);
+    CHECK(mol->getBondWithIdx(1)->getProp<int>(
+              common_properties::_MolFileBondStereo) == 4);
+    CHECK(!mol->getBondWithIdx(1)->hasProp(common_properties::_MolFileBondCfg));
+    CHECK(mol->getBondWithIdx(1)->getProp<int>(
+        common_properties::_UnknownStereo));
+
+    CHECK(mol->getBondWithIdx(2)->getStereo() == Bond::STEREONONE);
+    CHECK(mol->getBondWithIdx(2)->getBondDir() == Bond::NONE);
+    CHECK(mol->getBondWithIdx(2)->getProp<int>(
+              common_properties::_MolFileBondStereo) == 4);
+    CHECK(!mol->getBondWithIdx(2)->hasProp(common_properties::_MolFileBondCfg));
+    CHECK(mol->getBondWithIdx(2)->getProp<int>(
+        common_properties::_UnknownStereo));
+
+    Chirality::reapplyMolBlockWedging(*mol);
+    CHECK(mol->getBondWithIdx(0)->getStereo() == Bond::STEREONONE);
+    CHECK(mol->getBondWithIdx(0)->getBondDir() == Bond::NONE);
+
+    CHECK(mol->getBondWithIdx(1)->getStereo() == Bond::STEREONONE);
+    CHECK(mol->getBondWithIdx(1)->getBondDir() == Bond::UNKNOWN);
+
+    CHECK(mol->getBondWithIdx(2)->getStereo() == Bond::STEREONONE);
+    CHECK(mol->getBondWithIdx(2)->getBondDir() == Bond::UNKNOWN);
+  }
+  SECTION("double-3000") {
+    auto mol = R"CTAB(double-3000.mol
+  ChemDraw10232310312D
+
+  0  0  0     0  0              0 V3000
+M  V30 BEGIN CTAB
+M  V30 COUNTS 4 3 0 0 0
+M  V30 BEGIN ATOM
+M  V30 1 C -0.714435 0.206182 0.000000 0
+M  V30 2 C 0.000000 0.618744 0.000000 0
+M  V30 3 F 0.714435 0.206182 0.000000 0
+M  V30 4 O -0.714435 -0.618744 0.000000 0
+M  V30 END ATOM
+M  V30 BEGIN BOND
+M  V30 1 2 1 2
+M  V30 2 1 2 3 CFG=2
+M  V30 3 1 1 4 CFG=2
+M  V30 END BOND
+M  V30 END CTAB
+M  END
+)CTAB"_ctab;
+    REQUIRE(mol);
+    CHECK(mol->getBondWithIdx(0)->getStereo() == Bond::STEREOANY);
+    CHECK(mol->getBondWithIdx(0)->getBondDir() == Bond::NONE);
+    CHECK(!mol->getBondWithIdx(0)->hasProp(
+        common_properties::_MolFileBondStereo));
+    CHECK(!mol->getBondWithIdx(0)->hasProp(common_properties::_MolFileBondCfg));
+    CHECK(!mol->getBondWithIdx(0)->hasProp(common_properties::_UnknownStereo));
+
+    CHECK(mol->getBondWithIdx(1)->getStereo() == Bond::STEREONONE);
+    CHECK(mol->getBondWithIdx(1)->getBondDir() == Bond::NONE);
+    CHECK(!mol->getBondWithIdx(1)->hasProp(
+        common_properties::_MolFileBondStereo));
+    CHECK(mol->getBondWithIdx(1)->getProp<int>(
+              common_properties::_MolFileBondCfg) == 2);
+    CHECK(mol->getBondWithIdx(1)->getProp<int>(
+        common_properties::_UnknownStereo));
+
+    CHECK(mol->getBondWithIdx(2)->getStereo() == Bond::STEREONONE);
+    CHECK(mol->getBondWithIdx(2)->getBondDir() == Bond::NONE);
+    CHECK(!mol->getBondWithIdx(2)->hasProp(
+        common_properties::_MolFileBondStereo));
+    CHECK(mol->getBondWithIdx(2)->getProp<int>(
+              common_properties::_MolFileBondCfg) == 2);
+    CHECK(mol->getBondWithIdx(2)->getProp<int>(
+        common_properties::_UnknownStereo));
+
+    Chirality::reapplyMolBlockWedging(*mol);
+    CHECK(mol->getBondWithIdx(0)->getStereo() == Bond::STEREONONE);
+    CHECK(mol->getBondWithIdx(0)->getBondDir() == Bond::NONE);
+
+    CHECK(mol->getBondWithIdx(1)->getStereo() == Bond::STEREONONE);
+    CHECK(mol->getBondWithIdx(1)->getBondDir() == Bond::UNKNOWN);
+
+    CHECK(mol->getBondWithIdx(2)->getStereo() == Bond::STEREONONE);
+    CHECK(mol->getBondWithIdx(2)->getBondDir() == Bond::UNKNOWN);
+  }
+  SECTION("double-explicit-crossed-2000") {
+    auto mol = R"CTAB(double-explicit-crossed-2000.mol
+  ChemDraw10232310432D
+
+  4  3  0  0  0  0  0  0  0  0999 V2000
+   -0.7144    0.2062    0.0000 C   0  0  0  0  0  0  0  0  0  0  0  0
+    0.0000    0.6187    0.0000 C   0  0  0  0  0  0  0  0  0  0  0  0
+    0.7144    0.2062    0.0000 F   0  0  0  0  0  0  0  0  0  0  0  0
+   -0.7144   -0.6187    0.0000 O   0  0  0  0  0  0  0  0  0  0  0  0
+  1  2  2  3      
+  2  3  1  4      
+  1  4  1  4      
+M  END
+)CTAB"_ctab;
+    REQUIRE(mol);
+    CHECK(mol->getBondWithIdx(0)->getStereo() == Bond::STEREOANY);
+    CHECK(mol->getBondWithIdx(0)->getBondDir() == Bond::NONE);
+    CHECK(mol->getBondWithIdx(0)->getProp<int>(
+              common_properties::_MolFileBondStereo) == 3);
+    CHECK(!mol->getBondWithIdx(0)->hasProp(common_properties::_MolFileBondCfg));
+    CHECK(!mol->getBondWithIdx(0)->hasProp(common_properties::_UnknownStereo));
+
+    CHECK(mol->getBondWithIdx(1)->getStereo() == Bond::STEREONONE);
+    CHECK(mol->getBondWithIdx(1)->getBondDir() == Bond::NONE);
+    CHECK(mol->getBondWithIdx(1)->getProp<int>(
+              common_properties::_MolFileBondStereo) == 4);
+    CHECK(!mol->getBondWithIdx(1)->hasProp(common_properties::_MolFileBondCfg));
+    CHECK(mol->getBondWithIdx(1)->getProp<int>(
+        common_properties::_UnknownStereo));
+
+    CHECK(mol->getBondWithIdx(2)->getStereo() == Bond::STEREONONE);
+    CHECK(mol->getBondWithIdx(2)->getBondDir() == Bond::NONE);
+    CHECK(mol->getBondWithIdx(2)->getProp<int>(
+              common_properties::_MolFileBondStereo) == 4);
+    CHECK(!mol->getBondWithIdx(2)->hasProp(common_properties::_MolFileBondCfg));
+    CHECK(mol->getBondWithIdx(2)->getProp<int>(
+        common_properties::_UnknownStereo));
+
+    Chirality::reapplyMolBlockWedging(*mol);
+    CHECK(mol->getBondWithIdx(0)->getStereo() == Bond::STEREOANY);
+    CHECK(mol->getBondWithIdx(0)->getBondDir() == Bond::EITHERDOUBLE);
+
+    CHECK(mol->getBondWithIdx(1)->getStereo() == Bond::STEREONONE);
+    CHECK(mol->getBondWithIdx(1)->getBondDir() == Bond::UNKNOWN);
+
+    CHECK(mol->getBondWithIdx(2)->getStereo() == Bond::STEREONONE);
+    CHECK(mol->getBondWithIdx(2)->getBondDir() == Bond::UNKNOWN);
+  }
+  SECTION("double-explicit-crossed-3000") {
+    auto mol = R"CTAB(double-explicit-crossed-3000.mol
+  ChemDraw10232310422D
+
+  0  0  0     0  0              0 V3000
+M  V30 BEGIN CTAB
+M  V30 COUNTS 4 3 0 0 0
+M  V30 BEGIN ATOM
+M  V30 1 C -0.714435 0.206182 0.000000 0
+M  V30 2 C 0.000000 0.618744 0.000000 0
+M  V30 3 F 0.714435 0.206182 0.000000 0
+M  V30 4 O -0.714435 -0.618744 0.000000 0
+M  V30 END ATOM
+M  V30 BEGIN BOND
+M  V30 1 2 1 2 CFG=2
+M  V30 2 1 2 3 CFG=2
+M  V30 3 1 1 4 CFG=2
+M  V30 END BOND
+M  V30 END CTAB
+M  END
+)CTAB"_ctab;
+    REQUIRE(mol);
+    CHECK(mol->getBondWithIdx(0)->getStereo() == Bond::STEREOANY);
+    CHECK(mol->getBondWithIdx(0)->getBondDir() == Bond::NONE);
+    CHECK(!mol->getBondWithIdx(0)->hasProp(
+        common_properties::_MolFileBondStereo));
+    CHECK(mol->getBondWithIdx(0)->getProp<int>(
+              common_properties::_MolFileBondCfg) == 2);
+    CHECK(!mol->getBondWithIdx(0)->hasProp(common_properties::_UnknownStereo));
+
+    CHECK(mol->getBondWithIdx(1)->getStereo() == Bond::STEREONONE);
+    CHECK(mol->getBondWithIdx(1)->getBondDir() == Bond::NONE);
+    CHECK(!mol->getBondWithIdx(1)->hasProp(
+        common_properties::_MolFileBondStereo));
+    CHECK(mol->getBondWithIdx(1)->getProp<int>(
+              common_properties::_MolFileBondCfg) == 2);
+    CHECK(mol->getBondWithIdx(1)->getProp<int>(
+        common_properties::_UnknownStereo));
+
+    CHECK(mol->getBondWithIdx(2)->getStereo() == Bond::STEREONONE);
+    CHECK(mol->getBondWithIdx(2)->getBondDir() == Bond::NONE);
+    CHECK(!mol->getBondWithIdx(2)->hasProp(
+        common_properties::_MolFileBondStereo));
+    CHECK(mol->getBondWithIdx(2)->getProp<int>(
+              common_properties::_MolFileBondCfg) == 2);
+    CHECK(mol->getBondWithIdx(2)->getProp<int>(
+        common_properties::_UnknownStereo));
+
+    Chirality::reapplyMolBlockWedging(*mol);
+    CHECK(mol->getBondWithIdx(0)->getStereo() == Bond::STEREOANY);
+    CHECK(mol->getBondWithIdx(0)->getBondDir() == Bond::EITHERDOUBLE);
+
+    CHECK(mol->getBondWithIdx(1)->getStereo() == Bond::STEREONONE);
+    CHECK(mol->getBondWithIdx(1)->getBondDir() == Bond::UNKNOWN);
+
+    CHECK(mol->getBondWithIdx(2)->getStereo() == Bond::STEREONONE);
+    CHECK(mol->getBondWithIdx(2)->getBondDir() == Bond::UNKNOWN);
+  }
+  SECTION("double-2-2000") {
+    auto mol = R"CTAB(double-2-2000.mol
+  ChemDraw10192311332D
+
+  4  3  0  0  0  0  0  0  0  0999 V2000
+   -0.3572   -0.2062    0.0000 C   0  0  0  0  0  0  0  0  0  0  0  0
+    0.3572    0.2062    0.0000 C   0  0  0  0  0  0  0  0  0  0  0  0
+    1.0717    0.6188    0.0000 F   0  0  0  0  0  0  0  0  0  0  0  0
+   -1.0717   -0.6188    0.0000 O   0  0  0  0  0  0  0  0  0  0  0  0
+  1  2  2  0        0
+  2  3  1  4        0
+  1  4  1  4        0
+M  END
+)CTAB"_ctab;
+    REQUIRE(mol);
+    CHECK(mol->getBondWithIdx(0)->getStereo() == Bond::STEREOANY);
+    CHECK(mol->getBondWithIdx(0)->getBondDir() == Bond::NONE);
+    CHECK(!mol->getBondWithIdx(0)->hasProp(
+        common_properties::_MolFileBondStereo));
+    CHECK(!mol->getBondWithIdx(0)->hasProp(common_properties::_MolFileBondCfg));
+    CHECK(!mol->getBondWithIdx(0)->hasProp(common_properties::_UnknownStereo));
+
+    CHECK(mol->getBondWithIdx(1)->getStereo() == Bond::STEREONONE);
+    CHECK(mol->getBondWithIdx(1)->getBondDir() == Bond::NONE);
+    CHECK(mol->getBondWithIdx(1)->getProp<int>(
+              common_properties::_MolFileBondStereo) == 4);
+    CHECK(!mol->getBondWithIdx(1)->hasProp(common_properties::_MolFileBondCfg));
+    CHECK(mol->getBondWithIdx(1)->getProp<int>(
+        common_properties::_UnknownStereo));
+
+    CHECK(mol->getBondWithIdx(2)->getStereo() == Bond::STEREONONE);
+    CHECK(mol->getBondWithIdx(2)->getBondDir() == Bond::NONE);
+    CHECK(mol->getBondWithIdx(2)->getProp<int>(
+              common_properties::_MolFileBondStereo) == 4);
+    CHECK(!mol->getBondWithIdx(2)->hasProp(common_properties::_MolFileBondCfg));
+    CHECK(mol->getBondWithIdx(2)->getProp<int>(
+        common_properties::_UnknownStereo));
+
+    Chirality::reapplyMolBlockWedging(*mol);
+    CHECK(mol->getBondWithIdx(0)->getStereo() == Bond::STEREONONE);
+    CHECK(mol->getBondWithIdx(0)->getBondDir() == Bond::NONE);
+
+    CHECK(mol->getBondWithIdx(1)->getStereo() == Bond::STEREONONE);
+    CHECK(mol->getBondWithIdx(1)->getBondDir() == Bond::UNKNOWN);
+
+    CHECK(mol->getBondWithIdx(2)->getStereo() == Bond::STEREONONE);
+    CHECK(mol->getBondWithIdx(2)->getBondDir() == Bond::UNKNOWN);
+  }
+  SECTION("double-2-3000") {
+    auto mol = R"CTAB(double-2-3000.mol
+  ChemDraw10232310312D
+
+  0  0  0     0  0              0 V3000
+M  V30 BEGIN CTAB
+M  V30 COUNTS 4 3 0 0 0
+M  V30 BEGIN ATOM
+M  V30 1 C -0.357168 -0.206181 0.000000 0
+M  V30 2 C 0.357167 0.206182 0.000000 0
+M  V30 3 F 1.071603 0.618744 0.000000 0
+M  V30 4 O -1.071603 -0.618744 0.000000 0
+M  V30 END ATOM
+M  V30 BEGIN BOND
+M  V30 1 2 1 2
+M  V30 2 1 2 3 CFG=2
+M  V30 3 1 1 4 CFG=2
+M  V30 END BOND
+M  V30 END CTAB
+M  END
+)CTAB"_ctab;
+    REQUIRE(mol);
+    CHECK(mol->getBondWithIdx(0)->getStereo() == Bond::STEREOANY);
+    CHECK(mol->getBondWithIdx(0)->getBondDir() == Bond::NONE);
+    CHECK(!mol->getBondWithIdx(0)->hasProp(
+        common_properties::_MolFileBondStereo));
+    CHECK(!mol->getBondWithIdx(0)->hasProp(common_properties::_MolFileBondCfg));
+    CHECK(!mol->getBondWithIdx(0)->hasProp(common_properties::_UnknownStereo));
+
+    CHECK(mol->getBondWithIdx(1)->getStereo() == Bond::STEREONONE);
+    CHECK(mol->getBondWithIdx(1)->getBondDir() == Bond::NONE);
+    CHECK(!mol->getBondWithIdx(1)->hasProp(
+        common_properties::_MolFileBondStereo));
+    CHECK(mol->getBondWithIdx(1)->getProp<int>(
+              common_properties::_MolFileBondCfg) == 2);
+    CHECK(mol->getBondWithIdx(1)->getProp<int>(
+        common_properties::_UnknownStereo));
+
+    CHECK(mol->getBondWithIdx(2)->getStereo() == Bond::STEREONONE);
+    CHECK(mol->getBondWithIdx(2)->getBondDir() == Bond::NONE);
+    CHECK(!mol->getBondWithIdx(2)->hasProp(
+        common_properties::_MolFileBondStereo));
+    CHECK(mol->getBondWithIdx(2)->getProp<int>(
+              common_properties::_MolFileBondCfg) == 2);
+    CHECK(mol->getBondWithIdx(2)->getProp<int>(
+        common_properties::_UnknownStereo));
+
+    Chirality::reapplyMolBlockWedging(*mol);
+    CHECK(mol->getBondWithIdx(0)->getStereo() == Bond::STEREONONE);
+    CHECK(mol->getBondWithIdx(0)->getBondDir() == Bond::NONE);
+
+    CHECK(mol->getBondWithIdx(1)->getStereo() == Bond::STEREONONE);
+    CHECK(mol->getBondWithIdx(1)->getBondDir() == Bond::UNKNOWN);
+
+    CHECK(mol->getBondWithIdx(2)->getStereo() == Bond::STEREONONE);
+    CHECK(mol->getBondWithIdx(2)->getBondDir() == Bond::UNKNOWN);
+  }
+  SECTION("double-2-explicit-crossed-2000") {
+    auto mol = R"CTAB(double-2-explicit-crossed-2000.mol
+  ChemDraw10232310432D
+
+  4  3  0  0  0  0  0  0  0  0999 V2000
+   -0.3572   -0.2062    0.0000 C   0  0  0  0  0  0  0  0  0  0  0  0
+    0.3572    0.2062    0.0000 C   0  0  0  0  0  0  0  0  0  0  0  0
+    1.0716    0.6187    0.0000 F   0  0  0  0  0  0  0  0  0  0  0  0
+   -1.0716   -0.6187    0.0000 O   0  0  0  0  0  0  0  0  0  0  0  0
+  1  2  2  3      
+  2  3  1  4      
+  1  4  1  4      
+M  END
+)CTAB"_ctab;
+    REQUIRE(mol);
+    CHECK(mol->getBondWithIdx(0)->getStereo() == Bond::STEREOANY);
+    CHECK(mol->getBondWithIdx(0)->getBondDir() == Bond::NONE);
+    CHECK(mol->getBondWithIdx(0)->getProp<int>(
+              common_properties::_MolFileBondStereo) == 3);
+    CHECK(!mol->getBondWithIdx(0)->hasProp(common_properties::_MolFileBondCfg));
+    CHECK(!mol->getBondWithIdx(0)->hasProp(common_properties::_UnknownStereo));
+
+    CHECK(mol->getBondWithIdx(1)->getStereo() == Bond::STEREONONE);
+    CHECK(mol->getBondWithIdx(1)->getBondDir() == Bond::NONE);
+    CHECK(mol->getBondWithIdx(1)->getProp<int>(
+              common_properties::_MolFileBondStereo) == 4);
+    CHECK(!mol->getBondWithIdx(1)->hasProp(common_properties::_MolFileBondCfg));
+    CHECK(mol->getBondWithIdx(1)->getProp<int>(
+        common_properties::_UnknownStereo));
+
+    CHECK(mol->getBondWithIdx(2)->getStereo() == Bond::STEREONONE);
+    CHECK(mol->getBondWithIdx(2)->getBondDir() == Bond::NONE);
+    CHECK(mol->getBondWithIdx(2)->getProp<int>(
+              common_properties::_MolFileBondStereo) == 4);
+    CHECK(!mol->getBondWithIdx(2)->hasProp(common_properties::_MolFileBondCfg));
+    CHECK(mol->getBondWithIdx(2)->getProp<int>(
+        common_properties::_UnknownStereo));
+
+    Chirality::reapplyMolBlockWedging(*mol);
+    CHECK(mol->getBondWithIdx(0)->getStereo() == Bond::STEREOANY);
+    CHECK(mol->getBondWithIdx(0)->getBondDir() == Bond::EITHERDOUBLE);
+
+    CHECK(mol->getBondWithIdx(1)->getStereo() == Bond::STEREONONE);
+    CHECK(mol->getBondWithIdx(1)->getBondDir() == Bond::UNKNOWN);
+
+    CHECK(mol->getBondWithIdx(2)->getStereo() == Bond::STEREONONE);
+    CHECK(mol->getBondWithIdx(2)->getBondDir() == Bond::UNKNOWN);
+  }
+  SECTION("double-2-explicit-crossed-3000") {
+    auto mol = R"CTAB(double-2-explicit-crossed-3000.mol
+  ChemDraw10232310422D
+
+  0  0  0     0  0              0 V3000
+M  V30 BEGIN CTAB
+M  V30 COUNTS 4 3 0 0 0
+M  V30 BEGIN ATOM
+M  V30 1 C -0.357168 -0.206181 0.000000 0
+M  V30 2 C 0.357167 0.206182 0.000000 0
+M  V30 3 F 1.071603 0.618744 0.000000 0
+M  V30 4 O -1.071603 -0.618744 0.000000 0
+M  V30 END ATOM
+M  V30 BEGIN BOND
+M  V30 1 2 1 2 CFG=2
+M  V30 2 1 2 3 CFG=2
+M  V30 3 1 1 4 CFG=2
+M  V30 END BOND
+M  V30 END CTAB
+M  END
+)CTAB"_ctab;
+    REQUIRE(mol);
+    CHECK(mol->getBondWithIdx(0)->getStereo() == Bond::STEREOANY);
+    CHECK(mol->getBondWithIdx(0)->getBondDir() == Bond::NONE);
+    CHECK(!mol->getBondWithIdx(0)->hasProp(
+        common_properties::_MolFileBondStereo));
+    CHECK(mol->getBondWithIdx(0)->getProp<int>(
+              common_properties::_MolFileBondCfg) == 2);
+    CHECK(!mol->getBondWithIdx(0)->hasProp(common_properties::_UnknownStereo));
+
+    CHECK(mol->getBondWithIdx(1)->getStereo() == Bond::STEREONONE);
+    CHECK(mol->getBondWithIdx(1)->getBondDir() == Bond::NONE);
+    CHECK(!mol->getBondWithIdx(1)->hasProp(
+        common_properties::_MolFileBondStereo));
+    CHECK(mol->getBondWithIdx(1)->getProp<int>(
+              common_properties::_MolFileBondCfg) == 2);
+    CHECK(mol->getBondWithIdx(1)->getProp<int>(
+        common_properties::_UnknownStereo));
+
+    CHECK(mol->getBondWithIdx(2)->getStereo() == Bond::STEREONONE);
+    CHECK(mol->getBondWithIdx(2)->getBondDir() == Bond::NONE);
+    CHECK(!mol->getBondWithIdx(2)->hasProp(
+        common_properties::_MolFileBondStereo));
+    CHECK(mol->getBondWithIdx(2)->getProp<int>(
+              common_properties::_MolFileBondCfg) == 2);
+    CHECK(mol->getBondWithIdx(2)->getProp<int>(
+        common_properties::_UnknownStereo));
+
+    Chirality::reapplyMolBlockWedging(*mol);
+    CHECK(mol->getBondWithIdx(0)->getStereo() == Bond::STEREOANY);
+    CHECK(mol->getBondWithIdx(0)->getBondDir() == Bond::EITHERDOUBLE);
+
+    CHECK(mol->getBondWithIdx(1)->getStereo() == Bond::STEREONONE);
+    CHECK(mol->getBondWithIdx(1)->getBondDir() == Bond::UNKNOWN);
+
+    CHECK(mol->getBondWithIdx(2)->getStereo() == Bond::STEREONONE);
+    CHECK(mol->getBondWithIdx(2)->getBondDir() == Bond::UNKNOWN);
+  }
+  SECTION("di-imine-2-2000") {
+    auto mol = R"CTAB(di-imine-2-2000.mol
+  ChemDraw10192311522D
+
+  8  7  0  0  0  0  0  0  0  0999 V2000
+   -0.9959   -1.0600    0.0000 C   0  0  0  0  0  0  0  0  0  0  0  0
+   -0.4125   -0.4767    0.0000 C   0  0  0  0  0  0  0  0  0  0  0  0
+    0.4125   -0.4767    0.0000 C   0  0  0  0  0  0  0  0  0  0  0  0
+    0.9959   -1.0600    0.0000 C   0  0  0  0  0  0  0  0  0  0  0  0
+   -0.7282    0.2855    0.0000 N   0  0  0  0  0  0  0  0  0  0  0  0
+   -0.9971    1.0600    0.0000 C   0  0  0  0  0  0  0  0  0  0  0  0
+    0.7282    0.2855    0.0000 N   0  0  0  0  0  0  0  0  0  0  0  0
+    0.9971    1.0270    0.0000 C   0  0  0  0  0  0  0  0  0  0  0  0
+  1  2  1  0        0
+  2  3  1  0        0
+  3  4  1  0        0
+  2  5  2  0        0
+  5  6  1  4        0
+  3  7  2  0        0
+  7  8  1  4        0
+M  END
+)CTAB"_ctab;
+    REQUIRE(mol);
+    CHECK(mol->getBondWithIdx(3)->getStereo() == Bond::STEREOANY);
+    CHECK(mol->getBondWithIdx(3)->getBondDir() == Bond::NONE);
+    CHECK(!mol->getBondWithIdx(3)->hasProp(
+        common_properties::_MolFileBondStereo));
+    CHECK(!mol->getBondWithIdx(3)->hasProp(common_properties::_MolFileBondCfg));
+    CHECK(!mol->getBondWithIdx(3)->hasProp(common_properties::_UnknownStereo));
+
+    CHECK(mol->getBondWithIdx(4)->getStereo() == Bond::STEREONONE);
+    CHECK(mol->getBondWithIdx(4)->getBondDir() == Bond::NONE);
+    CHECK(mol->getBondWithIdx(4)->getProp<int>(
+              common_properties::_MolFileBondStereo) == 4);
+    CHECK(!mol->getBondWithIdx(4)->hasProp(common_properties::_MolFileBondCfg));
+    CHECK(mol->getBondWithIdx(4)->getProp<int>(
+        common_properties::_UnknownStereo));
+
+    CHECK(mol->getBondWithIdx(5)->getStereo() == Bond::STEREOANY);
+    CHECK(mol->getBondWithIdx(5)->getBondDir() == Bond::NONE);
+    CHECK(!mol->getBondWithIdx(5)->hasProp(
+        common_properties::_MolFileBondStereo));
+    CHECK(!mol->getBondWithIdx(5)->hasProp(common_properties::_MolFileBondCfg));
+    CHECK(!mol->getBondWithIdx(5)->hasProp(common_properties::_UnknownStereo));
+
+    CHECK(mol->getBondWithIdx(6)->getStereo() == Bond::STEREONONE);
+    CHECK(mol->getBondWithIdx(6)->getBondDir() == Bond::NONE);
+    CHECK(mol->getBondWithIdx(6)->getProp<int>(
+              common_properties::_MolFileBondStereo) == 4);
+    CHECK(!mol->getBondWithIdx(6)->hasProp(common_properties::_MolFileBondCfg));
+    CHECK(mol->getBondWithIdx(6)->getProp<int>(
+        common_properties::_UnknownStereo));
+
+    Chirality::reapplyMolBlockWedging(*mol);
+    CHECK(mol->getBondWithIdx(3)->getStereo() == Bond::STEREONONE);
+    CHECK(mol->getBondWithIdx(3)->getBondDir() == Bond::NONE);
+
+    CHECK(mol->getBondWithIdx(4)->getStereo() == Bond::STEREONONE);
+    CHECK(mol->getBondWithIdx(4)->getBondDir() == Bond::UNKNOWN);
+
+    CHECK(mol->getBondWithIdx(5)->getStereo() == Bond::STEREONONE);
+    CHECK(mol->getBondWithIdx(5)->getBondDir() == Bond::NONE);
+
+    CHECK(mol->getBondWithIdx(6)->getStereo() == Bond::STEREONONE);
+    CHECK(mol->getBondWithIdx(6)->getBondDir() == Bond::UNKNOWN);
+  }
+  SECTION("di-imine-2-3000") {
+    auto mol = R"CTAB(di-imine-2-3000.mol
+  ChemDraw10232310302D
+
+  0  0  0     0  0              0 V3000
+M  V30 BEGIN CTAB
+M  V30 COUNTS 8 7 0 0 0
+M  V30 BEGIN ATOM
+M  V30 1 C -0.995922 -1.060024 0.000000 0
+M  V30 2 C -0.412509 -0.476711 0.000000 0
+M  V30 3 C 0.412509 -0.476711 0.000000 0
+M  V30 4 C 0.995923 -1.060024 0.000000 0
+M  V30 5 N -0.728217 0.285506 0.000000 0
+M  V30 6 C -0.997122 1.060024 0.000000 0
+M  V30 7 N 0.728216 0.285506 0.000000 0
+M  V30 8 C 0.997122 1.027023 0.000000 0
+M  V30 END ATOM
+M  V30 BEGIN BOND
+M  V30 1 1 1 2
+M  V30 2 1 2 3
+M  V30 3 1 3 4
+M  V30 4 2 2 5
+M  V30 5 1 5 6 CFG=2
+M  V30 6 2 3 7
+M  V30 7 1 7 8 CFG=2
+M  V30 END BOND
+M  V30 END CTAB
+M  END
+)CTAB"_ctab;
+    REQUIRE(mol);
+    CHECK(mol->getBondWithIdx(3)->getStereo() == Bond::STEREOANY);
+    CHECK(mol->getBondWithIdx(3)->getBondDir() == Bond::NONE);
+    CHECK(!mol->getBondWithIdx(3)->hasProp(
+        common_properties::_MolFileBondStereo));
+    CHECK(!mol->getBondWithIdx(3)->hasProp(common_properties::_MolFileBondCfg));
+    CHECK(!mol->getBondWithIdx(3)->hasProp(common_properties::_UnknownStereo));
+
+    CHECK(mol->getBondWithIdx(4)->getStereo() == Bond::STEREONONE);
+    CHECK(mol->getBondWithIdx(4)->getBondDir() == Bond::NONE);
+    CHECK(!mol->getBondWithIdx(4)->hasProp(
+        common_properties::_MolFileBondStereo));
+    CHECK(mol->getBondWithIdx(4)->getProp<int>(
+              common_properties::_MolFileBondCfg) == 2);
+    CHECK(mol->getBondWithIdx(4)->getProp<int>(
+        common_properties::_UnknownStereo));
+
+    CHECK(mol->getBondWithIdx(5)->getStereo() == Bond::STEREOANY);
+    CHECK(mol->getBondWithIdx(5)->getBondDir() == Bond::NONE);
+    CHECK(!mol->getBondWithIdx(5)->hasProp(
+        common_properties::_MolFileBondStereo));
+    CHECK(!mol->getBondWithIdx(5)->hasProp(common_properties::_MolFileBondCfg));
+    CHECK(!mol->getBondWithIdx(5)->hasProp(common_properties::_UnknownStereo));
+
+    CHECK(mol->getBondWithIdx(6)->getStereo() == Bond::STEREONONE);
+    CHECK(mol->getBondWithIdx(6)->getBondDir() == Bond::NONE);
+    CHECK(!mol->getBondWithIdx(6)->hasProp(
+        common_properties::_MolFileBondStereo));
+    CHECK(mol->getBondWithIdx(6)->getProp<int>(
+              common_properties::_MolFileBondCfg) == 2);
+    CHECK(mol->getBondWithIdx(6)->getProp<int>(
+        common_properties::_UnknownStereo));
+
+    Chirality::reapplyMolBlockWedging(*mol);
+    CHECK(mol->getBondWithIdx(3)->getStereo() == Bond::STEREONONE);
+    CHECK(mol->getBondWithIdx(3)->getBondDir() == Bond::NONE);
+
+    CHECK(mol->getBondWithIdx(4)->getStereo() == Bond::STEREONONE);
+    CHECK(mol->getBondWithIdx(4)->getBondDir() == Bond::UNKNOWN);
+
+    CHECK(mol->getBondWithIdx(5)->getStereo() == Bond::STEREONONE);
+    CHECK(mol->getBondWithIdx(5)->getBondDir() == Bond::NONE);
+
+    CHECK(mol->getBondWithIdx(6)->getStereo() == Bond::STEREONONE);
+    CHECK(mol->getBondWithIdx(6)->getBondDir() == Bond::UNKNOWN);
+  }
+  SECTION("di-imine-2-explicit-crossed-2000") {
+    auto mol = R"CTAB(di-imine-2-explicit-crossed-2000.mol
+  ChemDraw10232310432D
+
+  8  7  0  0  0  0  0  0  0  0999 V2000
+   -0.9959   -1.0600    0.0000 C   0  0  0  0  0  0  0  0  0  0  0  0
+   -0.4125   -0.4767    0.0000 C   0  0  0  0  0  0  0  0  0  0  0  0
+    0.4125   -0.4767    0.0000 C   0  0  0  0  0  0  0  0  0  0  0  0
+    0.9959   -1.0600    0.0000 C   0  0  0  0  0  0  0  0  0  0  0  0
+   -0.7282    0.2855    0.0000 N   0  0  0  0  0  0  0  0  0  0  0  0
+   -0.9971    1.0600    0.0000 C   0  0  0  0  0  0  0  0  0  0  0  0
+    0.7282    0.2855    0.0000 N   0  0  0  0  0  0  0  0  0  0  0  0
+    0.9971    1.0270    0.0000 C   0  0  0  0  0  0  0  0  0  0  0  0
+  1  2  1  0      
+  2  3  1  0      
+  3  4  1  0      
+  2  5  2  3      
+  5  6  1  4      
+  3  7  2  0      
+  7  8  1  4      
+M  END
+)CTAB"_ctab;
+    REQUIRE(mol);
+    CHECK(mol->getBondWithIdx(3)->getStereo() == Bond::STEREOANY);
+    CHECK(mol->getBondWithIdx(3)->getBondDir() == Bond::NONE);
+    CHECK(mol->getBondWithIdx(3)->getProp<int>(
+              common_properties::_MolFileBondStereo) == 3);
+    CHECK(!mol->getBondWithIdx(3)->hasProp(common_properties::_MolFileBondCfg));
+    CHECK(!mol->getBondWithIdx(3)->hasProp(common_properties::_UnknownStereo));
+
+    CHECK(mol->getBondWithIdx(4)->getStereo() == Bond::STEREONONE);
+    CHECK(mol->getBondWithIdx(4)->getBondDir() == Bond::NONE);
+    CHECK(mol->getBondWithIdx(4)->getProp<int>(
+              common_properties::_MolFileBondStereo) == 4);
+    CHECK(!mol->getBondWithIdx(4)->hasProp(common_properties::_MolFileBondCfg));
+    CHECK(mol->getBondWithIdx(4)->getProp<int>(
+        common_properties::_UnknownStereo));
+
+    CHECK(mol->getBondWithIdx(5)->getStereo() == Bond::STEREOANY);
+    CHECK(mol->getBondWithIdx(5)->getBondDir() == Bond::NONE);
+    CHECK(!mol->getBondWithIdx(5)->hasProp(
+        common_properties::_MolFileBondStereo));
+    CHECK(!mol->getBondWithIdx(5)->hasProp(common_properties::_MolFileBondCfg));
+    CHECK(!mol->getBondWithIdx(5)->hasProp(common_properties::_UnknownStereo));
+
+    CHECK(mol->getBondWithIdx(6)->getStereo() == Bond::STEREONONE);
+    CHECK(mol->getBondWithIdx(6)->getBondDir() == Bond::NONE);
+    CHECK(mol->getBondWithIdx(6)->getProp<int>(
+              common_properties::_MolFileBondStereo) == 4);
+    CHECK(!mol->getBondWithIdx(6)->hasProp(common_properties::_MolFileBondCfg));
+    CHECK(mol->getBondWithIdx(6)->getProp<int>(
+        common_properties::_UnknownStereo));
+
+    Chirality::reapplyMolBlockWedging(*mol);
+    CHECK(mol->getBondWithIdx(3)->getStereo() == Bond::STEREOANY);
+    CHECK(mol->getBondWithIdx(3)->getBondDir() == Bond::EITHERDOUBLE);
+
+    CHECK(mol->getBondWithIdx(4)->getStereo() == Bond::STEREONONE);
+    CHECK(mol->getBondWithIdx(4)->getBondDir() == Bond::UNKNOWN);
+
+    CHECK(mol->getBondWithIdx(5)->getStereo() == Bond::STEREONONE);
+    CHECK(mol->getBondWithIdx(5)->getBondDir() == Bond::NONE);
+
+    CHECK(mol->getBondWithIdx(6)->getStereo() == Bond::STEREONONE);
+    CHECK(mol->getBondWithIdx(6)->getBondDir() == Bond::UNKNOWN);
+  }
+  SECTION("di-imine-2-explicit-crossed-3000") {
+    auto mol = R"CTAB(di-imine-2-explicit-crossed-3000.mol
+  ChemDraw10232310432D
+
+  0  0  0     0  0              0 V3000
+M  V30 BEGIN CTAB
+M  V30 COUNTS 8 7 0 0 0
+M  V30 BEGIN ATOM
+M  V30 1 C -0.995922 -1.060024 0.000000 0
+M  V30 2 C -0.412509 -0.476711 0.000000 0
+M  V30 3 C 0.412509 -0.476711 0.000000 0
+M  V30 4 C 0.995923 -1.060024 0.000000 0
+M  V30 5 N -0.728217 0.285506 0.000000 0
+M  V30 6 C -0.997122 1.060024 0.000000 0
+M  V30 7 N 0.728216 0.285506 0.000000 0
+M  V30 8 C 0.997122 1.027023 0.000000 0
+M  V30 END ATOM
+M  V30 BEGIN BOND
+M  V30 1 1 1 2
+M  V30 2 1 2 3
+M  V30 3 1 3 4
+M  V30 4 2 2 5 CFG=2
+M  V30 5 1 5 6 CFG=2
+M  V30 6 2 3 7
+M  V30 7 1 7 8 CFG=2
+M  V30 END BOND
+M  V30 END CTAB
+M  END
+)CTAB"_ctab;
+    REQUIRE(mol);
+    CHECK(mol->getBondWithIdx(3)->getStereo() == Bond::STEREOANY);
+    CHECK(mol->getBondWithIdx(3)->getBondDir() == Bond::NONE);
+    CHECK(!mol->getBondWithIdx(3)->hasProp(
+        common_properties::_MolFileBondStereo));
+    CHECK(mol->getBondWithIdx(3)->getProp<int>(
+              common_properties::_MolFileBondCfg) == 2);
+    CHECK(!mol->getBondWithIdx(3)->hasProp(common_properties::_UnknownStereo));
+
+    CHECK(mol->getBondWithIdx(4)->getStereo() == Bond::STEREONONE);
+    CHECK(mol->getBondWithIdx(4)->getBondDir() == Bond::NONE);
+    CHECK(!mol->getBondWithIdx(4)->hasProp(
+        common_properties::_MolFileBondStereo));
+    CHECK(mol->getBondWithIdx(4)->getProp<int>(
+              common_properties::_MolFileBondCfg) == 2);
+    CHECK(mol->getBondWithIdx(4)->getProp<int>(
+        common_properties::_UnknownStereo));
+
+    CHECK(mol->getBondWithIdx(5)->getStereo() == Bond::STEREOANY);
+    CHECK(mol->getBondWithIdx(5)->getBondDir() == Bond::NONE);
+    CHECK(!mol->getBondWithIdx(5)->hasProp(
+        common_properties::_MolFileBondStereo));
+    CHECK(!mol->getBondWithIdx(5)->hasProp(common_properties::_MolFileBondCfg));
+    CHECK(!mol->getBondWithIdx(5)->hasProp(common_properties::_UnknownStereo));
+
+    CHECK(mol->getBondWithIdx(6)->getStereo() == Bond::STEREONONE);
+    CHECK(mol->getBondWithIdx(6)->getBondDir() == Bond::NONE);
+    CHECK(!mol->getBondWithIdx(6)->hasProp(
+        common_properties::_MolFileBondStereo));
+    CHECK(mol->getBondWithIdx(6)->getProp<int>(
+              common_properties::_MolFileBondCfg) == 2);
+    CHECK(mol->getBondWithIdx(6)->getProp<int>(
+        common_properties::_UnknownStereo));
+
+    Chirality::reapplyMolBlockWedging(*mol);
+    CHECK(mol->getBondWithIdx(3)->getStereo() == Bond::STEREOANY);
+    CHECK(mol->getBondWithIdx(3)->getBondDir() == Bond::EITHERDOUBLE);
+
+    CHECK(mol->getBondWithIdx(4)->getStereo() == Bond::STEREONONE);
+    CHECK(mol->getBondWithIdx(4)->getBondDir() == Bond::UNKNOWN);
+
+    CHECK(mol->getBondWithIdx(5)->getStereo() == Bond::STEREONONE);
+    CHECK(mol->getBondWithIdx(5)->getBondDir() == Bond::NONE);
+
+    CHECK(mol->getBondWithIdx(6)->getStereo() == Bond::STEREONONE);
+    CHECK(mol->getBondWithIdx(6)->getBondDir() == Bond::UNKNOWN);
+  }
+
+  SECTION("di-imine-cross-2000") {
+    auto mol = R"CTAB(di-imine-cross-2000.mol
+  ChemDraw10192311582D
+
+  8  7  0  0  0  0  0  0  0  0999 V2000
+   -1.0099   -1.1129    0.0000 C   0  0  0  0  0  0  0  0  0  0  0  0
+   -0.5974   -0.3984    0.0000 C   0  0  0  0  0  0  0  0  0  0  0  0
+    0.2276   -0.3984    0.0000 C   0  0  0  0  0  0  0  0  0  0  0  0
+    0.6401   -1.1129    0.0000 C   0  0  0  0  0  0  0  0  0  0  0  0
+   -0.8109    0.3984    0.0000 N   0  0  0  0  0  0  0  0  0  0  0  0
+    0.6401    0.3160    0.0000 N   0  0  0  0  0  0  0  0  0  0  0  0
+   -1.2234    1.1129    0.0000 C   0  0  0  0  0  0  0  0  0  0  0  0
+    1.2234    0.8994    0.0000 C   0  0  0  0  0  0  0  0  0  0  0  0
+  1  2  1  0        0
+  2  3  1  0        0
+  3  4  1  0        0
+  2  5  2  3        0
+  3  6  2  3        0
+  5  7  1  0        0
+  6  8  1  0        0
+M  END
+)CTAB"_ctab;
+    REQUIRE(mol);
+    CHECK(mol->getBondWithIdx(3)->getStereo() == Bond::STEREOANY);
+    CHECK(mol->getBondWithIdx(3)->getBondDir() == Bond::NONE);
+    CHECK(mol->getBondWithIdx(3)->getProp<int>(
+              common_properties::_MolFileBondStereo) == 3);
+    CHECK(!mol->getBondWithIdx(3)->hasProp(common_properties::_MolFileBondCfg));
+    CHECK(!mol->getBondWithIdx(3)->hasProp(common_properties::_UnknownStereo));
+
+    CHECK(mol->getBondWithIdx(4)->getStereo() == Bond::STEREOANY);
+    CHECK(mol->getBondWithIdx(4)->getBondDir() == Bond::NONE);
+    CHECK(mol->getBondWithIdx(4)->getProp<int>(
+              common_properties::_MolFileBondStereo) == 3);
+    CHECK(!mol->getBondWithIdx(4)->hasProp(common_properties::_MolFileBondCfg));
+    CHECK(!mol->getBondWithIdx(4)->hasProp(common_properties::_UnknownStereo));
+
+    CHECK(mol->getBondWithIdx(5)->getStereo() == Bond::STEREONONE);
+    CHECK(mol->getBondWithIdx(5)->getBondDir() == Bond::NONE);
+    CHECK(!mol->getBondWithIdx(5)->hasProp(
+        common_properties::_MolFileBondStereo));
+    CHECK(!mol->getBondWithIdx(5)->hasProp(common_properties::_MolFileBondCfg));
+    CHECK(!mol->getBondWithIdx(5)->hasProp(common_properties::_UnknownStereo));
+
+    CHECK(mol->getBondWithIdx(6)->getStereo() == Bond::STEREONONE);
+    CHECK(mol->getBondWithIdx(6)->getBondDir() == Bond::NONE);
+    CHECK(!mol->getBondWithIdx(6)->hasProp(
+        common_properties::_MolFileBondStereo));
+    CHECK(!mol->getBondWithIdx(6)->hasProp(common_properties::_MolFileBondCfg));
+    CHECK(!mol->getBondWithIdx(6)->hasProp(common_properties::_UnknownStereo));
+
+    Chirality::reapplyMolBlockWedging(*mol);
+    CHECK(mol->getBondWithIdx(3)->getStereo() == Bond::STEREOANY);
+    CHECK(mol->getBondWithIdx(3)->getBondDir() == Bond::EITHERDOUBLE);
+
+    CHECK(mol->getBondWithIdx(4)->getStereo() == Bond::STEREOANY);
+    CHECK(mol->getBondWithIdx(4)->getBondDir() == Bond::EITHERDOUBLE);
+
+    CHECK(mol->getBondWithIdx(5)->getStereo() == Bond::STEREONONE);
+    CHECK(mol->getBondWithIdx(5)->getBondDir() == Bond::NONE);
+
+    CHECK(mol->getBondWithIdx(6)->getStereo() == Bond::STEREONONE);
+    CHECK(mol->getBondWithIdx(6)->getBondDir() == Bond::NONE);
+  }
+  SECTION("di-imine-cross-3000") {
+    auto mol = R"CTAB(di-imine-cross-3000.mol
+  ChemDraw10232310302D
+
+  0  0  0     0  0              0 V3000
+M  V30 BEGIN CTAB
+M  V30 COUNTS 8 7 0 0 0
+M  V30 BEGIN ATOM
+M  V30 1 C -1.009900 -1.112900 0.000000 0
+M  V30 2 C -0.597400 -0.398400 0.000000 0
+M  V30 3 C 0.227600 -0.398400 0.000000 0
+M  V30 4 C 0.640100 -1.112900 0.000000 0
+M  V30 5 N -0.810900 0.398400 0.000000 0
+M  V30 6 N 0.640100 0.316000 0.000000 0
+M  V30 7 C -1.223400 1.112900 0.000000 0
+M  V30 8 C 1.223400 0.899400 0.000000 0
+M  V30 END ATOM
+M  V30 BEGIN BOND
+M  V30 1 1 1 2
+M  V30 2 1 2 3
+M  V30 3 1 3 4
+M  V30 4 2 2 5 CFG=2
+M  V30 5 2 3 6 CFG=2
+M  V30 6 1 5 7
+M  V30 7 1 6 8
+M  V30 END BOND
+M  V30 END CTAB
+M  END
+)CTAB"_ctab;
+    REQUIRE(mol);
+    CHECK(mol->getBondWithIdx(3)->getStereo() == Bond::STEREOANY);
+    CHECK(mol->getBondWithIdx(3)->getBondDir() == Bond::NONE);
+    CHECK(!mol->getBondWithIdx(3)->hasProp(
+        common_properties::_MolFileBondStereo));
+    CHECK(mol->getBondWithIdx(3)->getProp<int>(
+              common_properties::_MolFileBondCfg) == 2);
+    CHECK(!mol->getBondWithIdx(3)->hasProp(common_properties::_UnknownStereo));
+
+    CHECK(mol->getBondWithIdx(4)->getStereo() == Bond::STEREOANY);
+    CHECK(mol->getBondWithIdx(4)->getBondDir() == Bond::NONE);
+    CHECK(!mol->getBondWithIdx(4)->hasProp(
+        common_properties::_MolFileBondStereo));
+    CHECK(mol->getBondWithIdx(4)->getProp<int>(
+              common_properties::_MolFileBondCfg) == 2);
+    CHECK(!mol->getBondWithIdx(4)->hasProp(common_properties::_UnknownStereo));
+
+    CHECK(mol->getBondWithIdx(5)->getStereo() == Bond::STEREONONE);
+    CHECK(mol->getBondWithIdx(5)->getBondDir() == Bond::NONE);
+    CHECK(!mol->getBondWithIdx(5)->hasProp(
+        common_properties::_MolFileBondStereo));
+    CHECK(!mol->getBondWithIdx(5)->hasProp(common_properties::_MolFileBondCfg));
+    CHECK(!mol->getBondWithIdx(5)->hasProp(common_properties::_UnknownStereo));
+
+    CHECK(mol->getBondWithIdx(6)->getStereo() == Bond::STEREONONE);
+    CHECK(mol->getBondWithIdx(6)->getBondDir() == Bond::NONE);
+    CHECK(!mol->getBondWithIdx(6)->hasProp(
+        common_properties::_MolFileBondStereo));
+    CHECK(!mol->getBondWithIdx(6)->hasProp(common_properties::_MolFileBondCfg));
+    CHECK(!mol->getBondWithIdx(6)->hasProp(common_properties::_UnknownStereo));
+
+    Chirality::reapplyMolBlockWedging(*mol);
+    CHECK(mol->getBondWithIdx(3)->getStereo() == Bond::STEREOANY);
+    CHECK(mol->getBondWithIdx(3)->getBondDir() == Bond::EITHERDOUBLE);
+
+    CHECK(mol->getBondWithIdx(4)->getStereo() == Bond::STEREOANY);
+    CHECK(mol->getBondWithIdx(4)->getBondDir() == Bond::EITHERDOUBLE);
+
+    CHECK(mol->getBondWithIdx(5)->getStereo() == Bond::STEREONONE);
+    CHECK(mol->getBondWithIdx(5)->getBondDir() == Bond::NONE);
+
+    CHECK(mol->getBondWithIdx(6)->getStereo() == Bond::STEREONONE);
+    CHECK(mol->getBondWithIdx(6)->getBondDir() == Bond::NONE);
+  }
+  SECTION(
+      "roundtripping molblock with cis double bond should not change it into crosssed") {
+    auto molblockIn = R"CTAB(
+     RDKit          2D
+
+  5  4  0  0  0  0  0  0  0  0999 V2000
+   -2.4998    2.4772    0.0000 C   0  0  0  0  0  0  0  0  0  0  0  0
+   -3.2142    2.0647    0.0000 C   0  0  0  0  0  0  0  0  0  0  0  0
+   -2.4998    3.3022    0.0000 C   0  0  0  0  0  0  0  0  0  0  0  0
+   -3.2142    3.7147    0.0000 C   0  0  0  0  0  0  0  0  0  0  0  0
+   -3.9287    3.3022    0.0000 Cl  0  0  0  0  0  0  0  0  0  0  0  0
+  2  1  1  0
+  1  3  2  0
+  3  4  1  0
+  4  5  1  0
+M  END
+)CTAB";
+    {
+      std::unique_ptr<RWMol> mol(MolBlockToMol(molblockIn, false));
+      auto molblockOut = MolToMolBlock(*mol);
+      CHECK(molblockIn == molblockOut);
+    }
+    {
+      std::unique_ptr<RWMol> mol(MolBlockToMol(molblockIn, false));
+      reapplyMolBlockWedging(*mol);
+      auto molblockOut = MolToMolBlock(*mol);
+      CHECK(molblockIn == molblockOut);
+    }
+  }
+}