Skip to content

Commit

Permalink
Bug 3248: Fixed test_api failures.
Browse files Browse the repository at this point in the history
  • Loading branch information
shoops committed Jun 25, 2024
1 parent e8cd4cc commit 26c3095
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 3 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -83,3 +83,5 @@ python_copasi.egg-info
/copasi-dependencies
TestSuite/distribution/out.txt
.~lock*

tests/opt.cps
11 changes: 8 additions & 3 deletions copasi/CopasiDataModel/CDataModel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1082,9 +1082,14 @@ bool CDataModel::newModel(CProcessReport * pProcessReport,
// set content type to COPASI
mData.mContentType = ContentType::COPASI;

CRegisteredCommonName::setEnabled(false);
commonAfterLoad(pProcessReport, deleteOldData);
CRegisteredCommonName::setEnabled(true);
if (CRegisteredCommonName::isEnabled())
{
CRegisteredCommonName::setEnabled(false);
commonAfterLoad(pProcessReport, deleteOldData);
CRegisteredCommonName::setEnabled(true);
}
else
commonAfterLoad(pProcessReport, deleteOldData);

return true;
}
Expand Down
4 changes: 4 additions & 0 deletions copasi/core/CRootContainer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -91,13 +91,17 @@ void CRootContainer::init(int argc, char *argv[], const bool & withGUI)
{
COptions::init(argc, argv);

CRegisteredCommonName::setEnabled(false);

CCopasiMessage::setIsGUI(withGUI);

if (pRootContainer == NULL)
pRootContainer = new CRootContainer(withGUI);

if (pRootContainer != NULL)
pRootContainer->initializeChildren();

CRegisteredCommonName::setEnabled(true);
}

// static
Expand Down
4 changes: 4 additions & 0 deletions copasi/function/CEvaluationNodeObject.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -70,10 +70,14 @@ CEvaluationNodeObject::CEvaluationNodeObject(const SubType & subType,
mSubType = SubType::AVOGADRO;
}

mRegisteredObjectCN = CRegisteredCommonName(mData.substr(1, mData.length() - 2), nullptr);

break;

case SubType::AVOGADRO:
mData = "<Reference=Avogadro Constant>";
mRegisteredObjectCN = CRegisteredCommonName(mData.substr(1, mData.length() - 2), nullptr);

break;

case SubType::POINTER:
Expand Down

0 comments on commit 26c3095

Please sign in to comment.