From 24eed1accc276c1e1dc27169007013fc3a4f39e3 Mon Sep 17 00:00:00 2001 From: Alan Garny Date: Thu, 26 Nov 2026 15:18:31 +1300 Subject: [PATCH 1/5] New version. --- VERSION.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/VERSION.txt b/VERSION.txt index 2e162caba..c1f814ded 100644 --- a/VERSION.txt +++ b/VERSION.txt @@ -1 +1 @@ -1.20261125.0 +2.20261126.0 From 3a32fe430d0d67bb1c40f688cef4d2b1b6ab7af7 Mon Sep 17 00:00:00 2001 From: Alan Garny Date: Thu, 26 Nov 2026 15:24:42 +1300 Subject: [PATCH 2/5] Renamed COMBINE archive to OMEX file throughout (incl. API). --- src/CMakeLists.txt | 8 +- src/api/libopencor/file.h | 20 ++-- src/bindings/javascript/file.cpp | 2 +- src/bindings/python/file.cpp | 2 +- src/file/file.cpp | 44 +++---- src/file/file_p.h | 4 +- src/misc/utils.cpp | 10 +- src/sed/seddocument.cpp | 22 ++-- src/sed/seddocument_p.h | 2 +- src/support/cellml/cellmlfile.cpp | 6 +- .../combinearchive.cpp => omex/omexfile.cpp} | 113 +++++++++--------- .../combinearchive.h => omex/omexfile.h} | 22 ++-- .../combinearchive_p.h => omex/omexfile_p.h} | 4 +- src/support/sedml/sedmlfile.cpp | 2 +- tests/CMakeLists.txt | 6 +- tests/api/file/basictests.cpp | 2 +- tests/api/file/childtests.cpp | 78 ++++++------ tests/api/file/i18ntests.cpp | 10 +- tests/api/file/typetests.cpp | 14 +-- tests/api/sed/basictests.cpp | 48 ++++---- tests/api/sed/instancetests.cpp | 12 +- tests/bindings/javascript/file.basic.test.js | 2 +- tests/bindings/javascript/file.child.test.js | 70 +++++------ tests/bindings/javascript/file.i18n.test.js | 10 +- tests/bindings/javascript/file.type.test.js | 14 +-- tests/bindings/javascript/res/index.html | 2 +- .../bindings/javascript/res/res/libopencor.js | 6 +- tests/bindings/javascript/sed.basic.test.js | 48 ++++---- .../bindings/javascript/sed.instance.test.js | 12 +- tests/bindings/python/test_file_basic.py | 2 +- tests/bindings/python/test_file_child.py | 78 ++++++------ tests/bindings/python/test_file_i18n.py | 10 +- tests/bindings/python/test_file_type.py | 14 +-- tests/bindings/python/test_sed_basic.py | 48 ++++---- tests/bindings/python/test_sed_instance.py | 14 +-- tests/install/bindings/python/test_install.py | 2 +- tests/install/src/main.cpp | 2 +- .../model_with_nested_imports.omex | Bin tests/support/cellml/basictests.cpp | 4 +- .../support/{combine => omex}/basictests.cpp | 8 +- .../{combine => omex}/coveragetests.cpp | 10 +- tests/support/{combine => omex}/tests.cmake | 2 +- 42 files changed, 393 insertions(+), 396 deletions(-) rename src/support/{combine/combinearchive.cpp => omex/omexfile.cpp} (77%) rename src/support/{combine/combinearchive.h => omex/omexfile.h} (64%) rename src/support/{combine/combinearchive_p.h => omex/omexfile_p.h} (95%) rename tests/res/support/{combine => omex}/model_with_nested_imports.omex (100%) rename tests/support/{combine => omex}/basictests.cpp (78%) rename tests/support/{combine => omex}/coveragetests.cpp (75%) rename tests/support/{combine => omex}/tests.cmake (97%) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index c77193132..26bb8816b 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -203,7 +203,7 @@ set(INTERNAL_SOURCE_FILES ${CMAKE_CURRENT_SOURCE_DIR}/solver/solversecondorderrungekutta.cpp ${CMAKE_CURRENT_SOURCE_DIR}/support/cellml/cellmlfile.cpp ${CMAKE_CURRENT_SOURCE_DIR}/support/cellml/cellmlfileruntime.cpp - ${CMAKE_CURRENT_SOURCE_DIR}/support/combine/combinearchive.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/support/omex/omexfile.cpp ${CMAKE_CURRENT_SOURCE_DIR}/support/sedml/sedmlfile.cpp ) @@ -320,8 +320,8 @@ set(INTERNAL_HEADER_FILES ${CMAKE_CURRENT_SOURCE_DIR}/support/cellml/cellmlfile.h ${CMAKE_CURRENT_SOURCE_DIR}/support/cellml/cellmlfileruntime_p.h ${CMAKE_CURRENT_SOURCE_DIR}/support/cellml/cellmlfileruntime.h - ${CMAKE_CURRENT_SOURCE_DIR}/support/combine/combinearchive_p.h - ${CMAKE_CURRENT_SOURCE_DIR}/support/combine/combinearchive.h + ${CMAKE_CURRENT_SOURCE_DIR}/support/omex/omexfile_p.h + ${CMAKE_CURRENT_SOURCE_DIR}/support/omex/omexfile.h ${CMAKE_CURRENT_SOURCE_DIR}/support/sedml/sedmlfile_p.h ${CMAKE_CURRENT_SOURCE_DIR}/support/sedml/sedmlfile.h ${CMAKE_CURRENT_SOURCE_DIR}/unittestingexport.h @@ -343,7 +343,7 @@ include_directories(file misc solver support/cellml - support/combine + support/omex support/sedml ${CMAKE_CURRENT_BINARY_DIR}) diff --git a/src/api/libopencor/file.h b/src/api/libopencor/file.h index 0c00ce83e..a1a404a0f 100644 --- a/src/api/libopencor/file.h +++ b/src/api/libopencor/file.h @@ -32,7 +32,7 @@ class LIBOPENCOR_EXPORT File: public Logger , public std::enable_shared_from_this { friend class CellmlFile; - friend class CombineArchive; + friend class OmexFile; friend class SedDocument; friend class SedInstanceTask; friend class SedmlFile; @@ -43,7 +43,7 @@ class LIBOPENCOR_EXPORT File: public Logger /** * @brief The type of a file. * - * The type of a file, i.e. whether it is unknown, a CellML file, a SED-ML file, a COMBINE archive, or + * The type of a file, i.e. whether it is unknown, a CellML file, a SED-ML file, an OMEX file, or * irretrievable. */ @@ -53,9 +53,9 @@ class LIBOPENCOR_EXPORT File: public Logger CELLML_FILE, /**< The file is a CellML file. */ SEDML_FILE, /**< The file is a SED-ML file. */ #ifdef __EMSCRIPTEN__ - COMBINE_ARCHIVE /**< The file is a COMBINE archive. */ + OMEX_FILE /**< The file is an OMEX file. */ #else - COMBINE_ARCHIVE, /**< The file is a COMBINE archive. */ + OMEX_FILE, /**< The file is an OMEX file. */ IRRETRIEVABLE_FILE /**< The file is irretrievable. */ #endif }; @@ -180,7 +180,7 @@ class LIBOPENCOR_EXPORT File: public Logger /** * @brief Return whether there are some child files. * - * Return whether there are some child files. This method is only relevant for COMBINE archives. + * Return whether there are some child files. This method is only relevant for OMEX files. * * @return @c true if there are some child files, @c false otherwise. */ @@ -190,7 +190,7 @@ class LIBOPENCOR_EXPORT File: public Logger /** * @brief Return the number of child files. * - * Return the number of child files. This method is only relevant for COMBINE archives. + * Return the number of child files. This method is only relevant for OMEX files. * * @return The number of child files. */ @@ -200,7 +200,7 @@ class LIBOPENCOR_EXPORT File: public Logger /** * @brief Return the child file names. * - * Return the child file names. This method is only relevant for COMBINE archives. + * Return the child file names. This method is only relevant for OMEX files. * * @return The child file names, as a @ref Strings. */ @@ -210,7 +210,7 @@ class LIBOPENCOR_EXPORT File: public Logger /** * @brief Return the child files. * - * Return the child files. This method is only relevant for COMBINE archives. + * Return the child files. This method is only relevant for OMEX files. * * @return The child files, as a @ref FilePtrs. */ @@ -220,7 +220,7 @@ class LIBOPENCOR_EXPORT File: public Logger /** * @brief Return the child file at the given index. * - * Return the child file at the given index. This method is only relevant for COMBINE archives. + * Return the child file at the given index. This method is only relevant for OMEX files. * * @param pIndex The index of the child file. * @@ -232,7 +232,7 @@ class LIBOPENCOR_EXPORT File: public Logger /** * @brief Return the child file with the given file name. * - * Return the child file with the given file name. This method is only relevant for COMBINE archives. + * Return the child file with the given file name. This method is only relevant for OMEX files. * * @param pFileName The name of the child file. * diff --git a/src/bindings/javascript/file.cpp b/src/bindings/javascript/file.cpp index 3e219405c..33514f726 100644 --- a/src/bindings/javascript/file.cpp +++ b/src/bindings/javascript/file.cpp @@ -26,7 +26,7 @@ void fileApi() .value("UNKNOWN_FILE", libOpenCOR::File::Type::UNKNOWN_FILE) .value("CELLML_FILE", libOpenCOR::File::Type::CELLML_FILE) .value("SEDML_FILE", libOpenCOR::File::Type::SEDML_FILE) - .value("COMBINE_ARCHIVE", libOpenCOR::File::Type::COMBINE_ARCHIVE); + .value("OMEX_FILE", libOpenCOR::File::Type::OMEX_FILE); emscripten::class_>("File") // clang-format off diff --git a/src/bindings/python/file.cpp b/src/bindings/python/file.cpp index 8f90737f6..e81a8b7f0 100644 --- a/src/bindings/python/file.cpp +++ b/src/bindings/python/file.cpp @@ -33,7 +33,7 @@ void fileApi(nb::module_ &m) .value("UnknownFile", libOpenCOR::File::Type::UNKNOWN_FILE) .value("CellmlFile", libOpenCOR::File::Type::CELLML_FILE) .value("SedmlFile", libOpenCOR::File::Type::SEDML_FILE) - .value("CombineArchive", libOpenCOR::File::Type::COMBINE_ARCHIVE) + .value("OmexFile", libOpenCOR::File::Type::OMEX_FILE) .value("IrretrievableFile", libOpenCOR::File::Type::IRRETRIEVABLE_FILE); // Note: we release the GIL when creating a file, as well as when retrieving managed files, since it may take a diff --git a/src/file/file.cpp b/src/file/file.cpp index 13c774e5b..69940649f 100644 --- a/src/file/file.cpp +++ b/src/file/file.cpp @@ -91,8 +91,8 @@ File::Impl::~Impl() void File::Impl::checkType(const FilePtr &pOwner, bool pResetType) { // Reset the type of the file, if needed. - // Note: we also release our previous CellML file, SED-ML file, or COMBINE archive, if any, so that we don't keep - // using it (and, for a COMBINE archive, keep its child files managed) if our new contents are of a different + // Note: we also release our previous CellML file, SED-ML file, or OMEX file, if any, so that we don't keep + // using it (and, for an OMEX file, keep its child files managed) if our new contents are of a different // type or are not recognised. if (pResetType) { @@ -102,14 +102,14 @@ void File::Impl::checkType(const FilePtr &pOwner, bool pResetType) mCellmlFile = nullptr; mSedmlFile = nullptr; - mCombineArchive = nullptr; + mOmexFile = nullptr; #ifndef __EMSCRIPTEN__ } else if (mType == Type::IRRETRIEVABLE_FILE) { return; #endif } - // Try to get a CellML file, a SED-ML file, or a COMBINE archive, but only if we have some contents. + // Try to get a CellML file, a SED-ML file, or an OMEX file, but only if we have some contents. if (!contents().empty()) { mCellmlFile = CellmlFile::create(pOwner); @@ -126,14 +126,14 @@ void File::Impl::checkType(const FilePtr &pOwner, bool pResetType) addIssues(mSedmlFile, "SED-ML file"); } else { - mCombineArchive = CombineArchive::create(pOwner); + mOmexFile = OmexFile::create(pOwner); - if (mCombineArchive != nullptr) { - mType = Type::COMBINE_ARCHIVE; + if (mOmexFile != nullptr) { + mType = Type::OMEX_FILE; - addIssues(mCombineArchive, "COMBINE archive"); + addIssues(mOmexFile, "OMEX file"); } else { - addError("The file is not a CellML file, a SED-ML file, or a COMBINE archive."); + addError("The file is not a CellML file, a SED-ML file, or an OMEX file."); } } } @@ -187,8 +187,8 @@ void File::Impl::setContents(const UnsignedChars &pContents) bool File::Impl::hasChildFiles() const { - if (mType == Type::COMBINE_ARCHIVE) { - return mCombineArchive->hasFiles(); + if (mType == Type::OMEX_FILE) { + return mOmexFile->hasFiles(); } return false; @@ -196,8 +196,8 @@ bool File::Impl::hasChildFiles() const size_t File::Impl::childFileCount() const { - if (mType == Type::COMBINE_ARCHIVE) { - return mCombineArchive->fileCount(); + if (mType == Type::OMEX_FILE) { + return mOmexFile->fileCount(); } return 0; @@ -207,8 +207,8 @@ const Strings &File::Impl::childFileNames() const { static const Strings NO_STRINGS; - if (mType == Type::COMBINE_ARCHIVE) { - return mCombineArchive->fileNames(); + if (mType == Type::OMEX_FILE) { + return mOmexFile->fileNames(); } return NO_STRINGS; @@ -218,8 +218,8 @@ const FilePtrs &File::Impl::childFiles() const { static const FilePtrs NO_FILE_PTRS; - if (mType == Type::COMBINE_ARCHIVE) { - return mCombineArchive->files(); + if (mType == Type::OMEX_FILE) { + return mOmexFile->files(); } return NO_FILE_PTRS; @@ -229,12 +229,12 @@ const FilePtr &File::Impl::childFile(size_t pIndex) const { static const FilePtr NO_FILE_PTR; - if (mType == Type::COMBINE_ARCHIVE) { - if (pIndex >= mCombineArchive->fileCount()) { + if (mType == Type::OMEX_FILE) { + if (pIndex >= mOmexFile->fileCount()) { return NO_FILE_PTR; } - return mCombineArchive->file(pIndex); + return mOmexFile->file(pIndex); } return NO_FILE_PTR; @@ -248,8 +248,8 @@ const FilePtr &File::Impl::childFile(const std::string &pFileName) const { static const FilePtr NO_FILE_PTR; - if (mType == Type::COMBINE_ARCHIVE) { - return mCombineArchive->file(pFileName); + if (mType == Type::OMEX_FILE) { + return mOmexFile->file(pFileName); } return NO_FILE_PTR; diff --git a/src/file/file_p.h b/src/file/file_p.h index 9939962fe..d49963fc5 100644 --- a/src/file/file_p.h +++ b/src/file/file_p.h @@ -19,7 +19,7 @@ limitations under the License. #include "logger_p.h" #include "cellmlfile.h" -#include "combinearchive.h" +#include "omexfile.h" #include "sedmlfile.h" #include "libopencor/file.h" @@ -45,7 +45,7 @@ class File::Impl: public Logger::Impl CellmlFilePtr mCellmlFile; SedmlFilePtr mSedmlFile; - CombineArchivePtr mCombineArchive; + OmexFilePtr mOmexFile; explicit Impl(const std::string &pFileNameOrUrl, bool pRetrieveContents); ~Impl() override; diff --git a/src/misc/utils.cpp b/src/misc/utils.cpp index 6b84f52ba..0e432d091 100644 --- a/src/misc/utils.cpp +++ b/src/misc/utils.cpp @@ -1609,9 +1609,9 @@ bool isCombineSpecificationsFormat(const std::string &pFormat, std::initializer_ { // Check whether the given format is one of the given COMBINE specifications (e.g., "cellml.2.0" for // "http://identifiers.org/combine.specifications/cellml.2.0"). - // Note: identifiers.org can be accessed using either the "http" or the "https" scheme, and both are used in COMBINE - // archives (e.g., "https://identifiers.org/combine.specifications/sed-ml.level-1.version-2" is used by some - // COMBINE archives on BioModels). + // Note: identifiers.org can be accessed using either the "http" or the "https" scheme, and both are used in OMEX + // files (e.g., "https://identifiers.org/combine.specifications/sed-ml.level-1.version-2" is used by some + // OMEX files on BioModels). static constexpr std::string_view HTTP_COMBINE_SPECIFICATIONS {"http://identifiers.org/combine.specifications/"}; static constexpr std::string_view HTTPS_COMBINE_SPECIFICATIONS {"https://identifiers.org/combine.specifications/"}; @@ -1633,7 +1633,7 @@ bool isCombineSpecificationsFormat(const std::string &pFormat, std::initializer_ bool isCellmlFormat(const std::string &pFormat) { - // Check whether the given format is the CellML format of a COMBINE archive entry, i.e. one of the CellML + // Check whether the given format is the CellML format of an OMEX file entry, i.e. one of the CellML // specifications listed in the COMBINE specifications registry (see // https://github.com/combine-org/combine-specifications/tree/main/specifications). @@ -1642,7 +1642,7 @@ bool isCellmlFormat(const std::string &pFormat) bool isSedmlFormat(const std::string &pFormat) { - // Check whether the given format is the SED-ML format of a COMBINE archive entry, i.e. one of the SED-ML + // Check whether the given format is the SED-ML format of an OMEX file entry, i.e. one of the SED-ML // specifications listed in the COMBINE specifications registry (see // https://github.com/combine-org/combine-specifications/tree/main/specifications). diff --git a/src/sed/seddocument.cpp b/src/sed/seddocument.cpp index aa1af10db..2e42047f1 100644 --- a/src/sed/seddocument.cpp +++ b/src/sed/seddocument.cpp @@ -97,8 +97,8 @@ void SedDocument::Impl::initialise(const SedDocumentPtr &pOwner, const FilePtr & initialiseFromCellmlFile(pOwner, pFile); } else if (fileType == File::Type::SEDML_FILE) { initialiseFromSedmlFile(pOwner, pFile); - } else if (fileType == File::Type::COMBINE_ARCHIVE) { - initialiseFromCombineArchive(pOwner, pFile); + } else if (fileType == File::Type::OMEX_FILE) { + initialiseFromOmexFile(pOwner, pFile); #ifndef __EMSCRIPTEN__ } else if (fileType == File::Type::IRRETRIEVABLE_FILE) { addError("A simulation experiment description cannot be created using an irretrievable file."); @@ -133,18 +133,18 @@ void SedDocument::Impl::initialiseFromSedmlFile(const SedDocumentPtr &pOwner, co addIssues(sedmlFile, "SED-ML file"); } -void SedDocument::Impl::initialiseFromCombineArchive(const SedDocumentPtr &pOwner, const FilePtr &pFile) +void SedDocument::Impl::initialiseFromOmexFile(const SedDocumentPtr &pOwner, const FilePtr &pFile) { - const auto &combineArchive {pFile->pimpl()->mCombineArchive}; - const auto &masterFile {combineArchive->masterFile()}; + const auto &omexFile {pFile->pimpl()->mOmexFile}; + const auto &masterFile {omexFile->masterFile()}; if (masterFile == nullptr) { - if (combineArchive->sedmlFileCount() > 1) { - addError("A simulation experiment description cannot be created using a COMBINE archive with no master file and several SED-ML files."); - } else if (combineArchive->cellmlFileCount() > 1) { - addError("A simulation experiment description cannot be created using a COMBINE archive with no master file, no SED-ML file, and several CellML files."); + if (omexFile->sedmlFileCount() > 1) { + addError("A simulation experiment description cannot be created using an OMEX file with no master file and several SED-ML files."); + } else if (omexFile->cellmlFileCount() > 1) { + addError("A simulation experiment description cannot be created using an OMEX file with no master file, no SED-ML file, and several CellML files."); } else { - addError("A simulation experiment description cannot be created using a COMBINE archive with no master file."); + addError("A simulation experiment description cannot be created using an OMEX file with no master file."); } } else { auto masterFileType {masterFile->type()}; @@ -154,7 +154,7 @@ void SedDocument::Impl::initialiseFromCombineArchive(const SedDocumentPtr &pOwne } else if (masterFileType == File::Type::SEDML_FILE) { initialiseFromSedmlFile(pOwner, masterFile); } else { - addError("A simulation experiment description cannot be created using a COMBINE archive with an unknown master file (only CellML and SED-ML master files are supported)."); + addError("A simulation experiment description cannot be created using an OMEX file with an unknown master file (only CellML and SED-ML master files are supported)."); } } } diff --git a/src/sed/seddocument_p.h b/src/sed/seddocument_p.h index efe44f5ab..020867e59 100644 --- a/src/sed/seddocument_p.h +++ b/src/sed/seddocument_p.h @@ -49,7 +49,7 @@ class SedDocument::Impl: public Logger::Impl void initialise(const SedDocumentPtr &pOwner, const FilePtr &pFile); static void initialiseFromCellmlFile(const SedDocumentPtr &pOwner, const FilePtr &pFile); void initialiseFromSedmlFile(const SedDocumentPtr &pOwner, const FilePtr &pFile); - void initialiseFromCombineArchive(const SedDocumentPtr &pOwner, const FilePtr &pFile); + void initialiseFromOmexFile(const SedDocumentPtr &pOwner, const FilePtr &pFile); void serialise(xmlNodePtr pNode) const; diff --git a/src/support/cellml/cellmlfile.cpp b/src/support/cellml/cellmlfile.cpp index 4f7a258f3..4c156c743 100644 --- a/src/support/cellml/cellmlfile.cpp +++ b/src/support/cellml/cellmlfile.cpp @@ -67,8 +67,8 @@ std::string pathFromUrl(const std::string &pUrl) std::optional importedFileContents(bool pIsLocalFile, const std::string &pFileNameOrUrl) { - // Use the contents of the managed file, if any, with the given file name or URL. This is the case for a file in a - // COMBINE archive or for a file which contents were set in memory (e.g., from JavaScript). + // Use the contents of the managed file, if any, with the given file name or URL. This is the case for a file in an + // OMEX file or for a file which contents were set in memory (e.g., from JavaScript). #ifdef __EMSCRIPTEN__ auto file {FileManager::instance().fileFromFileNameOrUrl(pFileNameOrUrl)}; @@ -233,7 +233,7 @@ void populateImporterLibrary(const libcellml::ImporterPtr &pImporter, const libc // Populate the library of the given importer with the models that are (directly or indirectly) imported by the // given model. // Note #1: libCellML can only resolve imports that are local files. So, we retrieve the imported models ourselves - // (be they local files, remote files, files in a COMBINE archive, or files which contents were set in + // (be they local files, remote files, files in an OMEX file, or files which contents were set in // memory) and add them to the library of its importer, which is what libCellML looks up before trying to // open a file. // Note #2: libCellML looks up an imported model using its URL as is or, if there is no such key, using the URL diff --git a/src/support/combine/combinearchive.cpp b/src/support/omex/omexfile.cpp similarity index 77% rename from src/support/combine/combinearchive.cpp rename to src/support/omex/omexfile.cpp index 56bfe4977..741916626 100644 --- a/src/support/combine/combinearchive.cpp +++ b/src/support/omex/omexfile.cpp @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -#include "combinearchive_p.h" +#include "omexfile_p.h" #include "file_p.h" #include "utils.h" @@ -33,14 +33,13 @@ namespace { std::string archiveLocation(const FilePtr &pFile) { - // Determine the location of the COMBINE archive, i.e. the location where its files are "virtually" extracted (e.g., + // Determine the location of the OMEX file, i.e. the location where its files are "virtually" extracted (e.g., // "/some/path/archive.omex.contents/"). - // Note #1: the files of a COMBINE archive are managed by the file manager using their file name, so each COMBINE - // archive must have its own location. This means that a remote COMBINE archive that has no local copy - // (i.e. it was not downloaded), and therefore no file name, must use a virtual file name that is unique to - // it. - // Note #2: we canonicalise the location since the files of the COMBINE archive have a canonical file name (see - // File::create()), which we need to be able to compare against (see CombineArchive::Impl::file()). For + // Note #1: the files of an OMEX file are managed by the file manager using their file name, so each OMEX file + // must have its own location. This means that a remote OMEX file that has no local copy (i.e. it was not + // downloaded), and therefore no file name, must use a virtual file name that is unique to it. + // Note #2: we canonicalise the location since the files of the OMEX file have a canonical file name (see + // File::create()), which we need to be able to compare against (see OmexFile::Impl::file()). For // instance, the temporary directory on macOS is a symbolic link (i.e. "/var/..." vs. "/private/var/..."). static std::atomic virtualFileNameCounter {0}; @@ -58,13 +57,13 @@ std::string archiveLocation(const FilePtr &pFile) } // namespace -CombineArchive::Impl::Impl(const FilePtr &pFile, libcombine::CombineArchive *pArchive, UnsignedChars &&pArchiveContents) +OmexFile::Impl::Impl(const FilePtr &pFile, libcombine::CombineArchive *pArchive, UnsignedChars &&pArchiveContents) : mArchiveContents(std::move(pArchiveContents)) , mArchive(pArchive) , mArchiveLocation(archiveLocation(pFile)) , mArchiveLocationSize(mArchiveLocation.size()) { - // Extract all the files contained in the COMBINE archive. + // Extract all the files contained in the OMEX file. auto fileCount {static_cast(mArchive->getNumEntries())}; @@ -82,18 +81,18 @@ CombineArchive::Impl::Impl(const FilePtr &pFile, libcombine::CombineArchive *pAr const auto *entry {mArchive->getEntry(i)}; auto location {entry->getLocation()}; - // Make sure that the file is located within the COMBINE archive. + // Make sure that the file is located within the OMEX file. // Note #1: a location is a URI reference (see https://www.rfc-editor.org/rfc/rfc3986#section-4.1), so it may be // percent-encoded (e.g., "my%20file.cellml"). Since mArchiveLocation is a local file name, we must // decode the location to get the file name of the file. // Note #2: a location may have some ".." segments (e.g., "../file.cellml"), possibly percent-encoded (e.g., - // "%2E%2E/file.cellml"), in which case the file would be located outside of the COMBINE archive. It + // "%2E%2E/file.cellml"), in which case the file would be located outside of the OMEX file. It // could then be confused with another managed file (which contents would get replaced) or even with - // the COMBINE archive itself (resulting in an infinite recursion), so we ignore such a file. To + // the OMEX file itself (resulting in an infinite recursion), so we ignore such a file. To // determine where the file is located, we use its file name as determined by File::create(). - // Note #3: the file name of a file that is located within the COMBINE archive has no ".." component after the - // location of the COMBINE archive, unless it follows a symbolic link (see canonicalFileName()), in - // which case the file may be located outside of the COMBINE archive (e.g., + // Note #3: the file name of a file that is located within the OMEX file has no ".." component after the + // location of the OMEX file, unless it follows a symbolic link (see canonicalFileName()), in + // which case the file may be located outside of the OMEX file (e.g., // "archive.omex.contents/../file.cellml" if "archive.omex.contents" is a symbolic link), so we also // ignore such a file. @@ -117,17 +116,17 @@ CombineArchive::Impl::Impl(const FilePtr &pFile, libcombine::CombineArchive *pAr warning += "The file '"; warning += location; - warning += "' is not located within the COMBINE archive. It has been ignored."; + warning += "' is not located within the OMEX file. It has been ignored."; addWarning(warning); continue; } - // Skip a location that refers to the COMBINE archive itself. - // Note: libCOMBINE skips the "." location, which is how a COMBINE archive normally refers to itself, but not + // Skip a location that refers to the OMEX file itself. + // Note: libCOMBINE skips the "." location, which is how an OMEX file normally refers to itself, but not // the other locations that refer to it (e.g., "./" or "/"), which would otherwise result in a file for - // the directory in which we extract the COMBINE archive. + // the directory in which we extract the OMEX file. if (fileName == mArchiveLocation) { continue; @@ -135,7 +134,7 @@ CombineArchive::Impl::Impl(const FilePtr &pFile, libcombine::CombineArchive *pAr // Make sure that the file is not the same as a file that we have already extracted. // Note: different locations may refer to the same file (e.g., "./my%20file.cellml" and "./my file.cellml", or - // "./file.cellml" and "file.cellml"). This is an ambiguity in the COMBINE archive itself, so we keep the + // "./file.cellml" and "file.cellml"). This is an ambiguity in the OMEX file itself, so we keep the // first file and ignore the other ones (File::create() would otherwise return the same file, which // contents would get replaced and which would be counted several times). We do, however, honour the // master attribute of an ignored entry since it still refers to the file that we kept, and we keep track @@ -203,7 +202,7 @@ CombineArchive::Impl::Impl(const FilePtr &pFile, libcombine::CombineArchive *pAr // the format specified in the manifest. This means that a broken SED-ML file is still considered to be a SED-ML // file and, as such, cannot be silently ignored in favour of a CellML file. // Note: we do this only once the contents of all the files have been set since a CellML file may import another - // CellML file from the COMBINE archive, and that file may come after it in the manifest. + // CellML file from the OMEX file, and that file may come after it in the manifest. for (size_t i {0}; i < mFiles.size(); ++i) { const auto &file {mFiles[i]}; @@ -252,47 +251,47 @@ CombineArchive::Impl::Impl(const FilePtr &pFile, libcombine::CombineArchive *pAr } } -CombineArchive::Impl::~Impl() +OmexFile::Impl::~Impl() { delete mArchive; } -const FilePtr &CombineArchive::Impl::masterFile() const +const FilePtr &OmexFile::Impl::masterFile() const { return mMasterFile; } -size_t CombineArchive::Impl::cellmlFileCount() const +size_t OmexFile::Impl::cellmlFileCount() const { return mCellmlFileCount; } -size_t CombineArchive::Impl::sedmlFileCount() const +size_t OmexFile::Impl::sedmlFileCount() const { return mSedmlFileCount; } -bool CombineArchive::Impl::hasFiles() const +bool OmexFile::Impl::hasFiles() const { return !mFiles.empty(); } -size_t CombineArchive::Impl::fileCount() const +size_t OmexFile::Impl::fileCount() const { return mFiles.size(); } -const Strings &CombineArchive::Impl::fileNames() const +const Strings &OmexFile::Impl::fileNames() const { return mFileNames; } -const FilePtrs &CombineArchive::Impl::files() const +const FilePtrs &OmexFile::Impl::files() const { return mFiles; } -const FilePtr &CombineArchive::Impl::file(size_t pIndex) const +const FilePtr &OmexFile::Impl::file(size_t pIndex) const { static const FilePtr NO_FILE_PTR; @@ -303,13 +302,13 @@ const FilePtr &CombineArchive::Impl::file(size_t pIndex) const return mFiles[pIndex]; } -const FilePtr &CombineArchive::Impl::file(const std::string &pFileName) const +const FilePtr &OmexFile::Impl::file(const std::string &pFileName) const { static const FilePtr NO_FILE_PTR; // Look for the file using its location, as returned by fileNames() (e.g., "./my%20file.cellml"), the location of an // entry that was ignored because it refers to the same file (e.g., "my%20file.cellml"), or its file name relative - // to the COMBINE archive (e.g., "my file.cellml"). + // to the OMEX file (e.g., "my file.cellml"). // Note: a file name is never decoded (see retrieveFileInfo()), so we must look for the location of an ignored entry // explicitly since it may be percent-encoded. @@ -336,7 +335,7 @@ const FilePtr &CombineArchive::Impl::file(const std::string &pFileName) const return NO_FILE_PTR; } -CombineArchive::CombineArchive(const FilePtr &pFile, libcombine::CombineArchive *pArchive, UnsignedChars &&pArchiveContents) +OmexFile::OmexFile(const FilePtr &pFile, libcombine::CombineArchive *pArchive, UnsignedChars &&pArchiveContents) : Logger(std::make_unique(pFile, pArchive, std::move(pArchiveContents))) { #ifdef CODE_COVERAGE_ENABLED @@ -344,37 +343,37 @@ CombineArchive::CombineArchive(const FilePtr &pFile, libcombine::CombineArchive #endif } -CombineArchive::~CombineArchive() = default; +OmexFile::~OmexFile() = default; -CombineArchive::Impl *CombineArchive::pimpl() +OmexFile::Impl *OmexFile::pimpl() { return static_cast(Logger::mPimpl.get()); } -const CombineArchive::Impl *CombineArchive::pimpl() const +const OmexFile::Impl *OmexFile::pimpl() const { return static_cast(Logger::mPimpl.get()); } -CombineArchivePtr CombineArchive::create(const FilePtr &pFile) +OmexFilePtr OmexFile::create(const FilePtr &pFile) { - static const CombineArchivePtr NO_COMBINE_ARCHIVE_PTR; + static const OmexFilePtr NO_OMEX_FILE_PTR; - // Check whether the file is a COMBINE archive and if so then return its CombineArchive object. + // Check whether the file is an OMEX file and if so then return its OmexFile object. - if (pFile->pimpl()->type() == File::Type::COMBINE_ARCHIVE) { - return pFile->pimpl()->mCombineArchive; + if (pFile->pimpl()->type() == File::Type::OMEX_FILE) { + return pFile->pimpl()->mOmexFile; } // Check whether the type of the file is already known and if so then return since there is no need to parse the // file contents again. if (pFile->pimpl()->mTypeChecked) { - return NO_COMBINE_ARCHIVE_PTR; + return NO_OMEX_FILE_PTR; } - // Try to retrieve a COMBINE archive. - // Note: a COMBINE archive is a ZIP file, so we make sure that it starts with 0x04034b50, which is the magic number + // Try to retrieve an OMEX file. + // Note: an OMEX file is a ZIP file, so we make sure that it starts with 0x04034b50, which is the magic number // used by a ZIP file (we ignore empty and spanned ZIP files). Indeed, libCOMBINE may crash depending on the // file contents that is given to it. @@ -391,56 +390,56 @@ CombineArchivePtr CombineArchive::create(const FilePtr &pFile) archive->initializeFromBuffer(fileContents); - return CombineArchivePtr {new CombineArchive {pFile, archive, std::move(fileContents)}}; + return OmexFilePtr {new OmexFile {pFile, archive, std::move(fileContents)}}; // Note: libCOMBINE retains pointers into the supplied buffer, so we must not destroy it until the archive is // gone hence we keep the original ZIP buffer alive for the lifetime of the archive by moving it into the - // CombineArchive::Impl object. + // OmexFile::Impl object. } - return NO_COMBINE_ARCHIVE_PTR; + return NO_OMEX_FILE_PTR; } -const FilePtr &CombineArchive::masterFile() const +const FilePtr &OmexFile::masterFile() const { return pimpl()->masterFile(); } -size_t CombineArchive::cellmlFileCount() const +size_t OmexFile::cellmlFileCount() const { return pimpl()->cellmlFileCount(); } -size_t CombineArchive::sedmlFileCount() const +size_t OmexFile::sedmlFileCount() const { return pimpl()->sedmlFileCount(); } -bool CombineArchive::hasFiles() const +bool OmexFile::hasFiles() const { return pimpl()->hasFiles(); } -size_t CombineArchive::fileCount() const +size_t OmexFile::fileCount() const { return pimpl()->fileCount(); } -const Strings &CombineArchive::fileNames() const +const Strings &OmexFile::fileNames() const { return pimpl()->fileNames(); } -const FilePtrs &CombineArchive::files() const +const FilePtrs &OmexFile::files() const { return pimpl()->files(); } -const FilePtr &CombineArchive::file(size_t pIndex) const +const FilePtr &OmexFile::file(size_t pIndex) const { return pimpl()->file(pIndex); } -const FilePtr &CombineArchive::file(const std::string &pFileName) const +const FilePtr &OmexFile::file(const std::string &pFileName) const { return pimpl()->file(pFileName); } diff --git a/src/support/combine/combinearchive.h b/src/support/omex/omexfile.h similarity index 64% rename from src/support/combine/combinearchive.h rename to src/support/omex/omexfile.h index 6e18485ae..591038efd 100644 --- a/src/support/combine/combinearchive.h +++ b/src/support/omex/omexfile.h @@ -26,22 +26,22 @@ class CombineArchive; namespace libOpenCOR { -class CombineArchive; -using CombineArchivePtr = std::shared_ptr; +class OmexFile; +using OmexFilePtr = std::shared_ptr; -class LIBOPENCOR_UNIT_TESTING_EXPORT CombineArchive: public Logger +class LIBOPENCOR_UNIT_TESTING_EXPORT OmexFile: public Logger { public: - CombineArchive() = delete; - ~CombineArchive() override; + OmexFile() = delete; + ~OmexFile() override; - CombineArchive(const CombineArchive &pOther) = delete; - CombineArchive(CombineArchive &&pOther) noexcept = delete; + OmexFile(const OmexFile &pOther) = delete; + OmexFile(OmexFile &&pOther) noexcept = delete; - CombineArchive &operator=(const CombineArchive &pRhs) = delete; - CombineArchive &operator=(CombineArchive &&pRhs) noexcept = delete; + OmexFile &operator=(const OmexFile &pRhs) = delete; + OmexFile &operator=(OmexFile &&pRhs) noexcept = delete; - static CombineArchivePtr create(const FilePtr &pFile); + static OmexFilePtr create(const FilePtr &pFile); const FilePtr &masterFile() const; size_t cellmlFileCount() const; @@ -57,7 +57,7 @@ class LIBOPENCOR_UNIT_TESTING_EXPORT CombineArchive: public Logger private: class Impl; - explicit CombineArchive(const FilePtr &pFile, libcombine::CombineArchive *pArchive, UnsignedChars &&pArchiveContents); + explicit OmexFile(const FilePtr &pFile, libcombine::CombineArchive *pArchive, UnsignedChars &&pArchiveContents); Impl *pimpl(); const Impl *pimpl() const; diff --git a/src/support/combine/combinearchive_p.h b/src/support/omex/omexfile_p.h similarity index 95% rename from src/support/combine/combinearchive_p.h rename to src/support/omex/omexfile_p.h index 6084a9d43..80c1919cd 100644 --- a/src/support/combine/combinearchive_p.h +++ b/src/support/omex/omexfile_p.h @@ -18,13 +18,13 @@ limitations under the License. #include "logger_p.h" -#include "combinearchive.h" +#include "omexfile.h" #include namespace libOpenCOR { -class CombineArchive::Impl: public Logger::Impl +class OmexFile::Impl: public Logger::Impl { public: UnsignedChars mArchiveContents; diff --git a/src/support/sedml/sedmlfile.cpp b/src/support/sedml/sedmlfile.cpp index 8f6cd3856..d685a54e6 100644 --- a/src/support/sedml/sedmlfile.cpp +++ b/src/support/sedml/sedmlfile.cpp @@ -726,7 +726,7 @@ SedmlFilePtr SedmlFile::create(const FilePtr &pFile) auto *document {libsedml::readSedMLFromString(toString(pFile->contents()).c_str())}; // A non-SED-ML file results in our SED-ML document having at least one error. That error may be the result of a - // malformed XML file (e.g., an HTML file is an XML-like file but not actually an XML file or a COMBINE archive + // malformed XML file (e.g., an HTML file is an XML-like file but not actually an XML file or an OMEX file // which is just not an XML file) or a valid XML file but not a SED-ML file (e.g., a CellML file is an XML file but // not a SED-ML file). So, we use these facts to determine whether our current SED-ML document is indeed a SED-ML // file. diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt index 373a838b1..e1bddde7e 100644 --- a/tests/CMakeLists.txt +++ b/tests/CMakeLists.txt @@ -46,7 +46,7 @@ include(api/version/tests.cmake) include(misc/tests.cmake) include(support/cellml/tests.cmake) -include(support/combine/tests.cmake) +include(support/omex/tests.cmake) include(support/sedml/tests.cmake) # Prepare our different tests. @@ -70,7 +70,7 @@ string(REPLACE "\"" "\\\"" SEDML_CONTENTS "${SEDML_CONTENTS}") string(REGEX REPLACE "\n" "\" \\n\"" SEDML_CONTENTS_C "${SEDML_CONTENTS}") execute_process(COMMAND ${BASE64ENCODER} "${CMAKE_CURRENT_SOURCE_DIR}/res/cellml_2.omex" - OUTPUT_VARIABLE BASE64_COMBINE_ARCHIVE_CONTENTS + OUTPUT_VARIABLE BASE64_OMEX_FILE_CONTENTS OUTPUT_STRIP_TRAILING_WHITESPACE) configure_file(${UTILS_HEADER_FILE_IN} ${UTILS_HEADER_FILE}) @@ -78,7 +78,7 @@ configure_file(${UTILS_HEADER_FILE_IN} ${UTILS_HEADER_FILE}) include_directories(${CMAKE_SOURCE_DIR}/src/misc ${CMAKE_SOURCE_DIR}/src/solver ${CMAKE_SOURCE_DIR}/src/support/cellml - ${CMAKE_SOURCE_DIR}/src/support/combine + ${CMAKE_SOURCE_DIR}/src/support/omex ${CMAKE_SOURCE_DIR}/src/support/sedml ${CMAKE_BINARY_DIR}) diff --git a/tests/api/file/basictests.cpp b/tests/api/file/basictests.cpp index 9cc65ea18..a51e2f7a8 100644 --- a/tests/api/file/basictests.cpp +++ b/tests/api/file/basictests.cpp @@ -42,7 +42,7 @@ libOpenCOR::ExpectedIssues expectedNonExistingFileIssues() libOpenCOR::ExpectedIssues expectedUnknownFileIssues() { return {{ - {libOpenCOR::Issue::Type::ERROR, "The file is not a CellML file, a SED-ML file, or a COMBINE archive."}, + {libOpenCOR::Issue::Type::ERROR, "The file is not a CellML file, a SED-ML file, or an OMEX file."}, }}; } diff --git a/tests/api/file/childtests.cpp b/tests/api/file/childtests.cpp index 0d31d83c0..2b019e0f3 100644 --- a/tests/api/file/childtests.cpp +++ b/tests/api/file/childtests.cpp @@ -74,9 +74,9 @@ TEST(ChildFileTest, dataset157) doTestDataset("157", {"fabbri_et_al_based_composite_SAN_model.cellml", "fabbri_et_al_based_composite_SAN_model.sedml"}); } -TEST(ChildFileTest, remoteVirtualCombineArchives) +TEST(ChildFileTest, remoteVirtualOmexFiles) { - // Two remote COMBINE archives that are not downloaded must not share their child files. + // Two remote OMEX files that are not downloaded must not share their child files. auto file135 {libOpenCOR::File::create(std::string(libOpenCOR::REMOTE_BASE_PATH) + "/api/file/dataset_135.omex", false)}; auto file157 {libOpenCOR::File::create(std::string(libOpenCOR::REMOTE_BASE_PATH) + "/api/file/dataset_157.omex", false)}; @@ -84,8 +84,8 @@ TEST(ChildFileTest, remoteVirtualCombineArchives) file135->setContents(libOpenCOR::fileContents(libOpenCOR::resourcePath("api/file/dataset_135.omex"))); file157->setContents(libOpenCOR::fileContents(libOpenCOR::resourcePath("api/file/dataset_157.omex"))); - EXPECT_EQ(file135->type(), libOpenCOR::File::Type::COMBINE_ARCHIVE); - EXPECT_EQ(file157->type(), libOpenCOR::File::Type::COMBINE_ARCHIVE); + EXPECT_EQ(file135->type(), libOpenCOR::File::Type::OMEX_FILE); + EXPECT_EQ(file157->type(), libOpenCOR::File::Type::OMEX_FILE); auto simulationFile135 {file135->childFile("simulation.json")}; auto simulationFile157 {file157->childFile("simulation.json")}; @@ -97,10 +97,10 @@ TEST(ChildFileTest, remoteVirtualCombineArchives) EXPECT_EQ(libOpenCOR::toString(simulationFile157->contents()), libOpenCOR::textFileContents(libOpenCOR::resourcePath("api/file/dataset_157.json"))); } -TEST(ChildFileTest, remoteCombineArchive) +TEST(ChildFileTest, remoteOmexFile) { - // The child files of a remote COMBINE archive must be retrievable using their file name, even if the local copy of - // the COMBINE archive is in a directory that is accessed through a symbolic link (e.g., on macOS, the temporary + // The child files of a remote OMEX file must be retrievable using their file name, even if the local copy of + // the OMEX file is in a directory that is accessed through a symbolic link (e.g., on macOS, the temporary // directory is "/var/...", which is a symbolic link to "/private/var/..."). // Note: this has no JavaScript equivalent since our JavaScript bindings never retrieve the contents of a file, so a // remote file is never downloaded. @@ -108,14 +108,14 @@ TEST(ChildFileTest, remoteCombineArchive) auto file {libOpenCOR::File::create(std::string(libOpenCOR::REMOTE_BASE_PATH) + "/api/file/dataset_135.omex")}; auto simulationFile {file->childFile("simulation.json")}; - EXPECT_EQ(file->type(), libOpenCOR::File::Type::COMBINE_ARCHIVE); + EXPECT_EQ(file->type(), libOpenCOR::File::Type::OMEX_FILE); GTEST_ASSERT_NE(simulationFile, nullptr); EXPECT_EQ(libOpenCOR::toString(simulationFile->contents()), libOpenCOR::textFileContents(libOpenCOR::resourcePath("api/file/dataset_135.json"))); } -TEST(ChildFileTest, combineArchiveReplacedWithOtherContents) +TEST(ChildFileTest, omexFileReplacedWithOtherContents) { - // Replacing the contents of a COMBINE archive with some other contents must release its child files. + // Replacing the contents of an OMEX file with some other contents must release its child files. auto file {libOpenCOR::File::create(libOpenCOR::resourcePath("cellml_2.omex"))}; auto &fileManager {libOpenCOR::FileManager::instance()}; @@ -129,16 +129,16 @@ TEST(ChildFileTest, combineArchiveReplacedWithOtherContents) EXPECT_EQ(fileManager.fileCount(), 1U); } -TEST(ChildFileTest, combineArchiveWithFilesOutsideOfIt) +TEST(ChildFileTest, omexFileWithFilesOutsideOfIt) { - // A COMBINE archive may reference files that are located outside of it (e.g., "../sibling.cellml" or even the - // COMBINE archive itself), in which case they must be ignored rather than replace the contents of another managed + // An OMEX file may reference files that are located outside of it (e.g., "../sibling.cellml" or even the + // OMEX file itself), in which case they must be ignored rather than replace the contents of another managed // file (or result in an infinite recursion). static const libOpenCOR::ExpectedIssues EXPECTED_ISSUES {{ - {libOpenCOR::Issue::Type::WARNING, "COMBINE archive: the file '../sibling.cellml' is not located within the COMBINE archive. It has been ignored."}, - {libOpenCOR::Issue::Type::WARNING, "COMBINE archive: the file '%2E%2E/encoded_sibling.cellml' is not located within the COMBINE archive. It has been ignored."}, - {libOpenCOR::Issue::Type::WARNING, "COMBINE archive: the file '../entries_outside_of_archive.omex' is not located within the COMBINE archive. It has been ignored."}, + {libOpenCOR::Issue::Type::WARNING, "OMEX file: the file '../sibling.cellml' is not located within the OMEX file. It has been ignored."}, + {libOpenCOR::Issue::Type::WARNING, "OMEX file: the file '%2E%2E/encoded_sibling.cellml' is not located within the OMEX file. It has been ignored."}, + {libOpenCOR::Issue::Type::WARNING, "OMEX file: the file '../entries_outside_of_archive.omex' is not located within the OMEX file. It has been ignored."}, }}; auto sibling {libOpenCOR::File::create(libOpenCOR::resourcePath("api/file/sibling.cellml"), false)}; @@ -148,7 +148,7 @@ TEST(ChildFileTest, combineArchiveWithFilesOutsideOfIt) auto file {libOpenCOR::File::create(libOpenCOR::resourcePath("api/file/entries_outside_of_archive.omex"))}; - EXPECT_EQ(file->type(), libOpenCOR::File::Type::COMBINE_ARCHIVE); + EXPECT_EQ(file->type(), libOpenCOR::File::Type::OMEX_FILE); EXPECT_EQ(file->childFileCount(), 1U); EXPECT_NE(file->childFile("model.cellml"), nullptr); EXPECT_EQ_ISSUES(file, EXPECTED_ISSUES); @@ -157,21 +157,21 @@ TEST(ChildFileTest, combineArchiveWithFilesOutsideOfIt) } #ifndef BUILDING_ON_WINDOWS -TEST(ChildFileTest, combineArchiveWithFilesOutsideOfItThroughSymbolicLink) +TEST(ChildFileTest, omexFileWithFilesOutsideOfItThroughSymbolicLink) { - // The files of a COMBINE archive are located in a directory which name is that of the COMBINE archive followed by + // The files of an OMEX file are located in a directory which name is that of the OMEX file followed by // ".contents". If such a directory happens to exist and to be a symbolic link then the ".." components that follow - // it are kept (see canonicalFileName()), but the files they refer to are still located outside of the COMBINE - // archive, so they must still be ignored. + // it are kept (see canonicalFileName()), but the files they refer to are still located outside of the OMEX + // file, so they must still be ignored. // Note: a symbolic link usually requires some special privileges on Windows. static const libOpenCOR::ExpectedIssues EXPECTED_ISSUES {{ - {libOpenCOR::Issue::Type::WARNING, "COMBINE archive: the file '../sibling.cellml' is not located within the COMBINE archive. It has been ignored."}, - {libOpenCOR::Issue::Type::WARNING, "COMBINE archive: the file '%2E%2E/encoded_sibling.cellml' is not located within the COMBINE archive. It has been ignored."}, - {libOpenCOR::Issue::Type::WARNING, "COMBINE archive: the file '../entries_outside_of_archive.omex' is not located within the COMBINE archive. It has been ignored."}, + {libOpenCOR::Issue::Type::WARNING, "OMEX file: the file '../sibling.cellml' is not located within the OMEX file. It has been ignored."}, + {libOpenCOR::Issue::Type::WARNING, "OMEX file: the file '%2E%2E/encoded_sibling.cellml' is not located within the OMEX file. It has been ignored."}, + {libOpenCOR::Issue::Type::WARNING, "OMEX file: the file '../entries_outside_of_archive.omex' is not located within the OMEX file. It has been ignored."}, }}; - auto dir {std::filesystem::temp_directory_path() / "libopencor_combine_archive_with_files_outside_of_it_through_symbolic_link"}; + auto dir {std::filesystem::temp_directory_path() / "libopencor_omex_file_with_files_outside_of_it_through_symbolic_link"}; std::filesystem::remove_all(dir); std::filesystem::create_directories(dir / "real"); @@ -187,7 +187,7 @@ TEST(ChildFileTest, combineArchiveWithFilesOutsideOfItThroughSymbolicLink) std::filesystem::current_path(origDir); - EXPECT_EQ(file->type(), libOpenCOR::File::Type::COMBINE_ARCHIVE); + EXPECT_EQ(file->type(), libOpenCOR::File::Type::OMEX_FILE); EXPECT_EQ(file->childFileCount(), 1U); EXPECT_NE(file->childFile("model.cellml"), nullptr); EXPECT_EQ_ISSUES(file, EXPECTED_ISSUES); @@ -197,7 +197,7 @@ TEST(ChildFileTest, combineArchiveWithFilesOutsideOfItThroughSymbolicLink) } #endif -TEST(ChildFileTest, combineArchiveWithPercentEncodedLocations) +TEST(ChildFileTest, omexFileWithPercentEncodedLocations) { // A location is a URI reference, so it may be percent-encoded (e.g., "./my%20file.txt"), in which case the name of // its ZIP entry should be its decoded location (e.g., "my file.txt"), although some tools use the location itself @@ -214,7 +214,7 @@ TEST(ChildFileTest, combineArchiveWithPercentEncodedLocations) auto file {libOpenCOR::File::create(libOpenCOR::resourcePath("api/file/percent_encoded_locations.omex"))}; - EXPECT_EQ(file->type(), libOpenCOR::File::Type::COMBINE_ARCHIVE); + EXPECT_EQ(file->type(), libOpenCOR::File::Type::OMEX_FILE); EXPECT_FALSE(file->hasIssues()); EXPECT_EQ(file->childFileCount(), LOCATIONS_AND_FILE_NAMES.size()); @@ -230,7 +230,7 @@ TEST(ChildFileTest, combineArchiveWithPercentEncodedLocations) } } -TEST(ChildFileTest, combineArchiveWithNonUtf8Locations) +TEST(ChildFileTest, omexFileWithNonUtf8Locations) { // A location may get percent-decoded to a file name that is not valid UTF-8 (e.g., "./%FF.txt" gets decoded to // "\xFF.txt") or that has a character outside of the Basic Multilingual Plane (e.g., "./%F0%9F%98%80.txt" gets @@ -245,7 +245,7 @@ TEST(ChildFileTest, combineArchiveWithNonUtf8Locations) auto file {libOpenCOR::File::create(libOpenCOR::resourcePath("api/file/non_utf8_locations.omex"))}; - EXPECT_EQ(file->type(), libOpenCOR::File::Type::COMBINE_ARCHIVE); + EXPECT_EQ(file->type(), libOpenCOR::File::Type::OMEX_FILE); EXPECT_FALSE(file->hasIssues()); EXPECT_EQ(file->childFileCount(), LOCATIONS_AND_FILE_NAMES.size()); @@ -262,16 +262,16 @@ TEST(ChildFileTest, combineArchiveWithNonUtf8Locations) } } -TEST(ChildFileTest, combineArchiveWithDuplicateLocations) +TEST(ChildFileTest, omexFileWithDuplicateLocations) { // Different locations may refer to the same file (e.g., "./my%20file.txt" and "./my file.txt", or "./file.txt" and // "file.txt"), in which case only the first one is kept and the other ones are ignored. The ignored locations can, // however, still be used to retrieve the child file since they refer to the same file. static const libOpenCOR::ExpectedIssues EXPECTED_ISSUES {{ - {libOpenCOR::Issue::Type::WARNING, "COMBINE archive: the file 'file.txt' is the same as the file './file.txt'. It has been ignored."}, - {libOpenCOR::Issue::Type::WARNING, "COMBINE archive: the file './my file.txt' is the same as the file './my%20file.txt'. It has been ignored."}, - {libOpenCOR::Issue::Type::WARNING, "COMBINE archive: the file './other%20file.txt' is the same as the file './other file.txt'. It has been ignored."}, + {libOpenCOR::Issue::Type::WARNING, "OMEX file: the file 'file.txt' is the same as the file './file.txt'. It has been ignored."}, + {libOpenCOR::Issue::Type::WARNING, "OMEX file: the file './my file.txt' is the same as the file './my%20file.txt'. It has been ignored."}, + {libOpenCOR::Issue::Type::WARNING, "OMEX file: the file './other%20file.txt' is the same as the file './other file.txt'. It has been ignored."}, }}; static const std::vector> LOCATIONS_FILE_NAMES_AND_DUPLICATE_LOCATIONS { {"./file.txt", "file.txt", "file.txt"}, @@ -281,7 +281,7 @@ TEST(ChildFileTest, combineArchiveWithDuplicateLocations) auto file {libOpenCOR::File::create(libOpenCOR::resourcePath("api/file/duplicate_locations.omex"))}; - EXPECT_EQ(file->type(), libOpenCOR::File::Type::COMBINE_ARCHIVE); + EXPECT_EQ(file->type(), libOpenCOR::File::Type::OMEX_FILE); EXPECT_EQ_ISSUES(file, EXPECTED_ISSUES); EXPECT_EQ(file->childFileCount(), LOCATIONS_FILE_NAMES_AND_DUPLICATE_LOCATIONS.size()); @@ -300,14 +300,14 @@ TEST(ChildFileTest, combineArchiveWithDuplicateLocations) EXPECT_EQ(libOpenCOR::FileManager::instance().fileCount(), 4U); } -TEST(ChildFileTest, combineArchiveWithSelfReferencingLocations) +TEST(ChildFileTest, omexFileWithSelfReferencingLocations) { - // Locations that refer to the COMBINE archive itself (e.g., ".", "./", or "/") are not child files of the COMBINE - // archive. + // Locations that refer to the OMEX file itself (e.g., ".", "./", or "/") are not child files of the OMEX + // file. auto file {libOpenCOR::File::create(libOpenCOR::resourcePath("api/file/self_referencing_locations.omex"))}; - EXPECT_EQ(file->type(), libOpenCOR::File::Type::COMBINE_ARCHIVE); + EXPECT_EQ(file->type(), libOpenCOR::File::Type::OMEX_FILE); EXPECT_FALSE(file->hasIssues()); EXPECT_EQ(file->childFileCount(), 1U); EXPECT_EQ(file->childFileNames()[0], "./file.txt"); diff --git a/tests/api/file/i18ntests.cpp b/tests/api/file/i18ntests.cpp index b73e48dfb..f79b109c0 100644 --- a/tests/api/file/i18ntests.cpp +++ b/tests/api/file/i18ntests.cpp @@ -22,33 +22,33 @@ TEST(I18nFileTest, arabicFiles) { EXPECT_EQ(libOpenCOR::File::create(libOpenCOR::resourcePath("i18n/ملف/file.cellml"))->type(), libOpenCOR::File::Type::CELLML_FILE); EXPECT_EQ(libOpenCOR::File::create(libOpenCOR::resourcePath("i18n/ملف/file.sedml"))->type(), libOpenCOR::File::Type::SEDML_FILE); - EXPECT_EQ(libOpenCOR::File::create(libOpenCOR::resourcePath("i18n/ملف/file.omex"))->type(), libOpenCOR::File::Type::COMBINE_ARCHIVE); + EXPECT_EQ(libOpenCOR::File::create(libOpenCOR::resourcePath("i18n/ملف/file.omex"))->type(), libOpenCOR::File::Type::OMEX_FILE); } TEST(I18nFileTest, chineseFiles) { EXPECT_EQ(libOpenCOR::File::create(libOpenCOR::resourcePath("i18n/文件夹/file.cellml"))->type(), libOpenCOR::File::Type::CELLML_FILE); EXPECT_EQ(libOpenCOR::File::create(libOpenCOR::resourcePath("i18n/文件夹/file.sedml"))->type(), libOpenCOR::File::Type::SEDML_FILE); - EXPECT_EQ(libOpenCOR::File::create(libOpenCOR::resourcePath("i18n/文件夹/file.omex"))->type(), libOpenCOR::File::Type::COMBINE_ARCHIVE); + EXPECT_EQ(libOpenCOR::File::create(libOpenCOR::resourcePath("i18n/文件夹/file.omex"))->type(), libOpenCOR::File::Type::OMEX_FILE); } TEST(I18nFileTest, hindiFiles) { EXPECT_EQ(libOpenCOR::File::create(libOpenCOR::resourcePath("i18n/फोल्डर/file.cellml"))->type(), libOpenCOR::File::Type::CELLML_FILE); EXPECT_EQ(libOpenCOR::File::create(libOpenCOR::resourcePath("i18n/फोल्डर/file.sedml"))->type(), libOpenCOR::File::Type::SEDML_FILE); - EXPECT_EQ(libOpenCOR::File::create(libOpenCOR::resourcePath("i18n/फोल्डर/file.omex"))->type(), libOpenCOR::File::Type::COMBINE_ARCHIVE); + EXPECT_EQ(libOpenCOR::File::create(libOpenCOR::resourcePath("i18n/फोल्डर/file.omex"))->type(), libOpenCOR::File::Type::OMEX_FILE); } TEST(I18nFileTest, japaneseFiles) { EXPECT_EQ(libOpenCOR::File::create(libOpenCOR::resourcePath("i18n/フォルダ/file.cellml"))->type(), libOpenCOR::File::Type::CELLML_FILE); EXPECT_EQ(libOpenCOR::File::create(libOpenCOR::resourcePath("i18n/フォルダ/file.sedml"))->type(), libOpenCOR::File::Type::SEDML_FILE); - EXPECT_EQ(libOpenCOR::File::create(libOpenCOR::resourcePath("i18n/フォルダ/file.omex"))->type(), libOpenCOR::File::Type::COMBINE_ARCHIVE); + EXPECT_EQ(libOpenCOR::File::create(libOpenCOR::resourcePath("i18n/フォルダ/file.omex"))->type(), libOpenCOR::File::Type::OMEX_FILE); } TEST(I18nFileTest, russianFiles) { EXPECT_EQ(libOpenCOR::File::create(libOpenCOR::resourcePath("i18n/папка/file.cellml"))->type(), libOpenCOR::File::Type::CELLML_FILE); EXPECT_EQ(libOpenCOR::File::create(libOpenCOR::resourcePath("i18n/папка/file.sedml"))->type(), libOpenCOR::File::Type::SEDML_FILE); - EXPECT_EQ(libOpenCOR::File::create(libOpenCOR::resourcePath("i18n/папка/file.omex"))->type(), libOpenCOR::File::Type::COMBINE_ARCHIVE); + EXPECT_EQ(libOpenCOR::File::create(libOpenCOR::resourcePath("i18n/папка/file.omex"))->type(), libOpenCOR::File::Type::OMEX_FILE); } diff --git a/tests/api/file/typetests.cpp b/tests/api/file/typetests.cpp index e971d4e95..8209d9d31 100644 --- a/tests/api/file/typetests.cpp +++ b/tests/api/file/typetests.cpp @@ -24,7 +24,7 @@ namespace { libOpenCOR::ExpectedIssues expectedUnknownFileIssues() { return {{ - {libOpenCOR::Issue::Type::ERROR, "The file is not a CellML file, a SED-ML file, or a COMBINE archive."}, + {libOpenCOR::Issue::Type::ERROR, "The file is not a CellML file, a SED-ML file, or an OMEX file."}, }}; } @@ -82,11 +82,11 @@ TEST(TypeFileTest, sedml1xFile) EXPECT_EQ(file->type(), libOpenCOR::File::Type::SEDML_FILE); } -TEST(TypeFileTest, combine1xArchive) +TEST(TypeFileTest, omex1xFile) { auto file {libOpenCOR::File::create(libOpenCOR::resourcePath("cellml_1_x.omex"))}; - EXPECT_EQ(file->type(), libOpenCOR::File::Type::COMBINE_ARCHIVE); + EXPECT_EQ(file->type(), libOpenCOR::File::Type::OMEX_FILE); } TEST(TypeFileTest, cellml2File) @@ -103,11 +103,11 @@ TEST(TypeFileTest, sedml2File) EXPECT_EQ(file->type(), libOpenCOR::File::Type::SEDML_FILE); } -TEST(TypeFileTest, combine2Archive) +TEST(TypeFileTest, omex2File) { auto file {libOpenCOR::File::create(libOpenCOR::resourcePath("cellml_2.omex"))}; - EXPECT_EQ(file->type(), libOpenCOR::File::Type::COMBINE_ARCHIVE); + EXPECT_EQ(file->type(), libOpenCOR::File::Type::OMEX_FILE); } TEST(TypeFileTest, unknownVirtualFile) @@ -150,7 +150,7 @@ TEST(TypeFileTest, sedmlVirtualFile) EXPECT_EQ(file->type(), libOpenCOR::File::Type::SEDML_FILE); } -TEST(TypeFileTest, combineVirtualArchive) +TEST(TypeFileTest, omexVirtualFile) { auto filePath {libOpenCOR::resourcePath("cellml_2.omex")}; auto file {libOpenCOR::File::create(filePath, false)}; @@ -160,5 +160,5 @@ TEST(TypeFileTest, combineVirtualArchive) file->setContents(libOpenCOR::fileContents(filePath)); - EXPECT_EQ(file->type(), libOpenCOR::File::Type::COMBINE_ARCHIVE); + EXPECT_EQ(file->type(), libOpenCOR::File::Type::OMEX_FILE); } diff --git a/tests/api/sed/basictests.cpp b/tests/api/sed/basictests.cpp index 00c266ff1..d129c882c 100644 --- a/tests/api/sed/basictests.cpp +++ b/tests/api/sed/basictests.cpp @@ -488,7 +488,7 @@ TEST(BasicSedTest, sedmlFileWithRemoteCellmlFile) EXPECT_FALSE(document->hasIssues()); } -TEST(BasicSedTest, combineArchive) +TEST(BasicSedTest, omexFile) { auto file {libOpenCOR::File::create(libOpenCOR::resourcePath("cellml_2.omex"))}; auto document {libOpenCOR::SedDocument::create(file)}; @@ -496,10 +496,10 @@ TEST(BasicSedTest, combineArchive) EXPECT_FALSE(document->hasIssues()); } -TEST(BasicSedTest, combineArchiveWithNoManifestFile) +TEST(BasicSedTest, omexFileWithNoManifestFile) { static const libOpenCOR::ExpectedIssues EXPECTED_ISSUES {{ - {libOpenCOR::Issue::Type::ERROR, "A simulation experiment description cannot be created using a COMBINE archive with no master file."}, + {libOpenCOR::Issue::Type::ERROR, "A simulation experiment description cannot be created using an OMEX file with no master file."}, }}; auto file {libOpenCOR::File::create(libOpenCOR::resourcePath("api/sed/no_manifest_file.omex"))}; @@ -508,7 +508,7 @@ TEST(BasicSedTest, combineArchiveWithNoManifestFile) EXPECT_EQ_ISSUES(document, EXPECTED_ISSUES); } -TEST(BasicSedTest, combineArchiveWithNoMasterFileAndOneCellmlFile) +TEST(BasicSedTest, omexFileWithNoMasterFileAndOneCellmlFile) { auto file {libOpenCOR::File::create(libOpenCOR::resourcePath("api/sed/no_master_file_with_one_cellml_file.omex"))}; auto document {libOpenCOR::SedDocument::create(file)}; @@ -523,10 +523,10 @@ TEST(BasicSedTest, combineArchiveWithNoMasterFileAndOneCellmlFile) EXPECT_FALSE(instance->hasIssues()); } -TEST(BasicSedTest, combineArchiveWithNoMasterFileAndOneUnknownCellmlFile) +TEST(BasicSedTest, omexFileWithNoMasterFileAndOneUnknownCellmlFile) { static const libOpenCOR::ExpectedIssues EXPECTED_ISSUES {{ - {libOpenCOR::Issue::Type::ERROR, "A simulation experiment description cannot be created using a COMBINE archive with an unknown master file (only CellML and SED-ML master files are supported)."}, + {libOpenCOR::Issue::Type::ERROR, "A simulation experiment description cannot be created using an OMEX file with an unknown master file (only CellML and SED-ML master files are supported)."}, }}; auto file {libOpenCOR::File::create(libOpenCOR::resourcePath("api/sed/no_master_file_with_one_unknown_cellml_file.omex"))}; @@ -535,13 +535,13 @@ TEST(BasicSedTest, combineArchiveWithNoMasterFileAndOneUnknownCellmlFile) EXPECT_EQ_ISSUES(document, EXPECTED_ISSUES); } -TEST(BasicSedTest, combineArchiveWithNoMasterFileAndOneUnknownHttpsCellmlFile) +TEST(BasicSedTest, omexFileWithNoMasterFileAndOneUnknownHttpsCellmlFile) { // The format of an unknown file is used to determine its type, and a format may use the "https" scheme (e.g., // "https://identifiers.org/combine.specifications/cellml.1.1"). static const libOpenCOR::ExpectedIssues EXPECTED_ISSUES {{ - {libOpenCOR::Issue::Type::ERROR, "A simulation experiment description cannot be created using a COMBINE archive with an unknown master file (only CellML and SED-ML master files are supported)."}, + {libOpenCOR::Issue::Type::ERROR, "A simulation experiment description cannot be created using an OMEX file with an unknown master file (only CellML and SED-ML master files are supported)."}, }}; auto file {libOpenCOR::File::create(libOpenCOR::resourcePath("api/sed/no_master_file_with_one_unknown_https_cellml_file.omex"))}; @@ -550,10 +550,10 @@ TEST(BasicSedTest, combineArchiveWithNoMasterFileAndOneUnknownHttpsCellmlFile) EXPECT_EQ_ISSUES(document, EXPECTED_ISSUES); } -TEST(BasicSedTest, combineArchiveWithNoMasterFileAndSeveralCellmlFiles) +TEST(BasicSedTest, omexFileWithNoMasterFileAndSeveralCellmlFiles) { static const libOpenCOR::ExpectedIssues EXPECTED_ISSUES {{ - {libOpenCOR::Issue::Type::ERROR, "A simulation experiment description cannot be created using a COMBINE archive with no master file, no SED-ML file, and several CellML files."}, + {libOpenCOR::Issue::Type::ERROR, "A simulation experiment description cannot be created using an OMEX file with no master file, no SED-ML file, and several CellML files."}, }}; auto file {libOpenCOR::File::create(libOpenCOR::resourcePath("api/sed/no_master_file_with_several_cellml_files.omex"))}; @@ -562,13 +562,13 @@ TEST(BasicSedTest, combineArchiveWithNoMasterFileAndSeveralCellmlFiles) EXPECT_EQ_ISSUES(document, EXPECTED_ISSUES); } -TEST(BasicSedTest, combineArchiveWithMasterFileWithDuplicateLocation) +TEST(BasicSedTest, omexFileWithMasterFileWithDuplicateLocation) { // The master attribute of an entry that is ignored because its location refers to the same file as another entry // still applies to that file. static const libOpenCOR::ExpectedIssues EXPECTED_ISSUES {{ - {libOpenCOR::Issue::Type::WARNING, "COMBINE archive: the file 'cellml_2_b.cellml' is the same as the file './cellml_2_b.cellml'. It has been ignored."}, + {libOpenCOR::Issue::Type::WARNING, "OMEX file: the file 'cellml_2_b.cellml' is the same as the file './cellml_2_b.cellml'. It has been ignored."}, }}; auto file {libOpenCOR::File::create(libOpenCOR::resourcePath("api/sed/master_file_with_duplicate_location.omex"))}; @@ -580,7 +580,7 @@ TEST(BasicSedTest, combineArchiveWithMasterFileWithDuplicateLocation) EXPECT_EQ(document->models()[0]->file(), file->childFile("./cellml_2_b.cellml")); } -TEST(BasicSedTest, combineArchiveWithNoMasterFileAndOneSedmlFile) +TEST(BasicSedTest, omexFileWithNoMasterFileAndOneSedmlFile) { auto file {libOpenCOR::File::create(libOpenCOR::resourcePath("api/sed/no_master_file_with_one_sedml_file.omex"))}; auto document {libOpenCOR::SedDocument::create(file)}; @@ -595,10 +595,10 @@ TEST(BasicSedTest, combineArchiveWithNoMasterFileAndOneSedmlFile) EXPECT_FALSE(instance->hasIssues()); } -TEST(BasicSedTest, combineArchiveWithNoMasterFileAndOneUnknownSedmlFile) +TEST(BasicSedTest, omexFileWithNoMasterFileAndOneUnknownSedmlFile) { static const libOpenCOR::ExpectedIssues EXPECTED_ISSUES {{ - {libOpenCOR::Issue::Type::ERROR, "A simulation experiment description cannot be created using a COMBINE archive with an unknown master file (only CellML and SED-ML master files are supported)."}, + {libOpenCOR::Issue::Type::ERROR, "A simulation experiment description cannot be created using an OMEX file with an unknown master file (only CellML and SED-ML master files are supported)."}, }}; auto file {libOpenCOR::File::create(libOpenCOR::resourcePath("api/sed/no_master_file_with_one_unknown_sedml_file.omex"))}; @@ -607,14 +607,14 @@ TEST(BasicSedTest, combineArchiveWithNoMasterFileAndOneUnknownSedmlFile) EXPECT_EQ_ISSUES(document, EXPECTED_ISSUES); } -TEST(BasicSedTest, combineArchiveWithNoMasterFileAndOneUnknownVersionedSedmlFile) +TEST(BasicSedTest, omexFileWithNoMasterFileAndOneUnknownVersionedSedmlFile) { // The format of an unknown file is used to determine its type, and a format may be versioned and use the "https" // scheme (e.g., "https://identifiers.org/combine.specifications/sed-ml.level-1.version-3"). So, the unknown SED-ML // file is the master file, rather than the CellML file. static const libOpenCOR::ExpectedIssues EXPECTED_ISSUES {{ - {libOpenCOR::Issue::Type::ERROR, "A simulation experiment description cannot be created using a COMBINE archive with an unknown master file (only CellML and SED-ML master files are supported)."}, + {libOpenCOR::Issue::Type::ERROR, "A simulation experiment description cannot be created using an OMEX file with an unknown master file (only CellML and SED-ML master files are supported)."}, }}; auto file {libOpenCOR::File::create(libOpenCOR::resourcePath("api/sed/no_master_file_with_one_unknown_versioned_sedml_file.omex"))}; @@ -623,10 +623,10 @@ TEST(BasicSedTest, combineArchiveWithNoMasterFileAndOneUnknownVersionedSedmlFile EXPECT_EQ_ISSUES(document, EXPECTED_ISSUES); } -TEST(BasicSedTest, combineArchiveWithNoMasterFileAndSeveralSedmlFiles) +TEST(BasicSedTest, omexFileWithNoMasterFileAndSeveralSedmlFiles) { static const libOpenCOR::ExpectedIssues EXPECTED_ISSUES {{ - {libOpenCOR::Issue::Type::ERROR, "A simulation experiment description cannot be created using a COMBINE archive with no master file and several SED-ML files."}, + {libOpenCOR::Issue::Type::ERROR, "A simulation experiment description cannot be created using an OMEX file with no master file and several SED-ML files."}, }}; auto file {libOpenCOR::File::create(libOpenCOR::resourcePath("api/sed/no_master_file_with_several_sedml_files.omex"))}; @@ -635,10 +635,10 @@ TEST(BasicSedTest, combineArchiveWithNoMasterFileAndSeveralSedmlFiles) EXPECT_EQ_ISSUES(document, EXPECTED_ISSUES); } -TEST(BasicSedTest, combineArchiveWithUnknownDirectCellmlFile) +TEST(BasicSedTest, omexFileWithUnknownDirectCellmlFile) { static const libOpenCOR::ExpectedIssues EXPECTED_ISSUES {{ - {libOpenCOR::Issue::Type::ERROR, "A simulation experiment description cannot be created using a COMBINE archive with an unknown master file (only CellML and SED-ML master files are supported)."}, + {libOpenCOR::Issue::Type::ERROR, "A simulation experiment description cannot be created using an OMEX file with an unknown master file (only CellML and SED-ML master files are supported)."}, }}; auto file {libOpenCOR::File::create(libOpenCOR::resourcePath("api/sed/unknown_direct_cellml_file.omex"))}; @@ -647,7 +647,7 @@ TEST(BasicSedTest, combineArchiveWithUnknownDirectCellmlFile) EXPECT_EQ_ISSUES(document, EXPECTED_ISSUES); } -TEST(BasicSedTest, combineArchiveWithUnknownIndirectCellmlFile) +TEST(BasicSedTest, omexFileWithUnknownIndirectCellmlFile) { static const libOpenCOR::ExpectedIssues EXPECTED_ISSUES {{ {libOpenCOR::Issue::Type::ERROR, "Task: task 'task1' requires a model of CellML type."}, @@ -665,10 +665,10 @@ TEST(BasicSedTest, combineArchiveWithUnknownIndirectCellmlFile) EXPECT_EQ_ISSUES(instance, EXPECTED_ISSUES); } -TEST(BasicSedTest, combineArchiveWithUnknownSedmlFile) +TEST(BasicSedTest, omexFileWithUnknownSedmlFile) { static const libOpenCOR::ExpectedIssues EXPECTED_ISSUES {{ - {libOpenCOR::Issue::Type::ERROR, "A simulation experiment description cannot be created using a COMBINE archive with an unknown master file (only CellML and SED-ML master files are supported)."}, + {libOpenCOR::Issue::Type::ERROR, "A simulation experiment description cannot be created using an OMEX file with an unknown master file (only CellML and SED-ML master files are supported)."}, }}; auto file {libOpenCOR::File::create(libOpenCOR::resourcePath("api/sed/unknown_sedml_file.omex"))}; diff --git a/tests/api/sed/instancetests.cpp b/tests/api/sed/instancetests.cpp index 85d13c5de..7ea9ef72d 100644 --- a/tests/api/sed/instancetests.cpp +++ b/tests/api/sed/instancetests.cpp @@ -139,13 +139,13 @@ TEST(InstanceSedTest, cellmlFileWithInMemoryImports) } } -TEST(InstanceSedTest, combineArchiveWithCellmlFileWithImports) +TEST(InstanceSedTest, omexFileWithCellmlFileWithImports) { // Note: the model is such that dx/dt = -x with x(0) = 1, i.e. x(t) = exp(-t). static constexpr auto ABS_TOL {1e-5}; - auto file {libOpenCOR::File::create(libOpenCOR::resourcePath("support/combine/model_with_nested_imports.omex"))}; + auto file {libOpenCOR::File::create(libOpenCOR::resourcePath("support/omex/model_with_nested_imports.omex"))}; auto document {libOpenCOR::SedDocument::create(file)}; auto instance {document->instantiate()}; @@ -2061,7 +2061,7 @@ TEST(InstanceSedTest, daeModelWithFailingOdeSolver) EXPECT_EQ_ISSUES(instance, EXPECTED_ISSUES); } -TEST(InstanceSedTest, combineArchive) +TEST(InstanceSedTest, omexFile) { auto file {libOpenCOR::File::create(libOpenCOR::resourcePath("cellml_2.omex"))}; auto document {libOpenCOR::SedDocument::create(file)}; @@ -2072,7 +2072,7 @@ TEST(InstanceSedTest, combineArchive) EXPECT_FALSE(instance->hasIssues()); } -TEST(InstanceSedTest, combineArchiveWithCellmlFileAsMasterFile) +TEST(InstanceSedTest, omexFileWithCellmlFileAsMasterFile) { auto file {libOpenCOR::File::create(libOpenCOR::resourcePath("api/sed/cellml_file_as_master_file.omex"))}; auto document {libOpenCOR::SedDocument::create(file)}; @@ -2121,7 +2121,7 @@ TEST(InstanceSedTest, daeModelFromSedmlFile) EXPECT_FALSE(instance->hasIssues()); } -TEST(InstanceSedTest, daeModelFromCombineArchive) +TEST(InstanceSedTest, daeModelFromOmexFile) { auto file {libOpenCOR::File::create(libOpenCOR::resourcePath("api/sed/dae/model.omex"))}; auto document {libOpenCOR::SedDocument::create(file)}; @@ -2168,7 +2168,7 @@ TEST(InstanceSedTest, daeModelFromLegacySedmlFile) EXPECT_FALSE(instance->hasIssues()); } -TEST(InstanceSedTest, daeModelFromLegacyCombineArchive) +TEST(InstanceSedTest, daeModelFromLegacyOmexFile) { auto file {libOpenCOR::File::create(libOpenCOR::resourcePath("api/sed/dae/model_legacy.omex"))}; auto document {libOpenCOR::SedDocument::create(file)}; diff --git a/tests/bindings/javascript/file.basic.test.js b/tests/bindings/javascript/file.basic.test.js index b9b29a138..e3c7a31d2 100644 --- a/tests/bindings/javascript/file.basic.test.js +++ b/tests/bindings/javascript/file.basic.test.js @@ -28,7 +28,7 @@ const loc = await libOpenCOR(); const expectedNoIssues = []; const expectedUnknownFileIssues = [ - [loc.Issue.Type.ERROR, 'The file is not a CellML file, a SED-ML file, or a COMBINE archive.'] + [loc.Issue.Type.ERROR, 'The file is not a CellML file, a SED-ML file, or an OMEX file.'] ]; test.describe('File basic tests', () => { diff --git a/tests/bindings/javascript/file.child.test.js b/tests/bindings/javascript/file.child.test.js index 929ad086c..12886a3ee 100644 --- a/tests/bindings/javascript/file.child.test.js +++ b/tests/bindings/javascript/file.child.test.js @@ -83,8 +83,8 @@ test.describe('File child tests', () => { ]); }); - test('Remote virtual COMBINE archives', () => { - // Two remote COMBINE archives that are not downloaded must not share their child files. + test('Remote virtual OMEX files', () => { + // Two remote OMEX files that are not downloaded must not share their child files. const file135 = new loc.File(`${utils.REMOTE_BASE_PATH}/api/file/dataset_135.omex`); const file157 = new loc.File(`${utils.REMOTE_BASE_PATH}/api/file/dataset_157.omex`); @@ -92,8 +92,8 @@ test.describe('File child tests', () => { file135.setContents(utils.fileContents(utils.resourcePath('api/file/dataset_135.omex'))); file157.setContents(utils.fileContents(utils.resourcePath('api/file/dataset_157.omex'))); - assert.strictEqual(file135.type.value, loc.File.Type.COMBINE_ARCHIVE.value); - assert.strictEqual(file157.type.value, loc.File.Type.COMBINE_ARCHIVE.value); + assert.strictEqual(file135.type.value, loc.File.Type.OMEX_FILE.value); + assert.strictEqual(file157.type.value, loc.File.Type.OMEX_FILE.value); const simulationFile135 = file135.childFileFromFileName('simulation.json'); const simulationFile157 = file157.childFileFromFileName('simulation.json'); @@ -111,8 +111,8 @@ test.describe('File child tests', () => { ); }); - test('COMBINE archive replaced with other contents', () => { - // Replacing the contents of a COMBINE archive with some other contents must release its child files. + test('OMEX file replaced with other contents', () => { + // Replacing the contents of an OMEX file with some other contents must release its child files. const file = new loc.File(utils.resourcePath('cellml_2.omex')); const fileManager = loc.FileManager.instance(); @@ -128,23 +128,23 @@ test.describe('File child tests', () => { assert.strictEqual(fileManager.fileCount, 1); }); - test('COMBINE archive with files outside of it', () => { - // A COMBINE archive may reference files that are located outside of it (e.g., "../sibling.cellml" or even the - // COMBINE archive itself), in which case they must be ignored rather than replace the contents of another managed + test('OMEX file with files outside of it', () => { + // An OMEX file may reference files that are located outside of it (e.g., "../sibling.cellml" or even the + // OMEX file itself), in which case they must be ignored rather than replace the contents of another managed // file (or result in an infinite recursion). const expectedIssues = [ [ loc.Issue.Type.WARNING, - "COMBINE archive: the file '../sibling.cellml' is not located within the COMBINE archive. It has been ignored." + "OMEX file: the file '../sibling.cellml' is not located within the OMEX file. It has been ignored." ], [ loc.Issue.Type.WARNING, - "COMBINE archive: the file '%2E%2E/encoded_sibling.cellml' is not located within the COMBINE archive. It has been ignored." + "OMEX file: the file '%2E%2E/encoded_sibling.cellml' is not located within the OMEX file. It has been ignored." ], [ loc.Issue.Type.WARNING, - "COMBINE archive: the file '../entries_outside_of_archive.omex' is not located within the COMBINE archive. It has been ignored." + "OMEX file: the file '../entries_outside_of_archive.omex' is not located within the OMEX file. It has been ignored." ] ]; const sibling = new loc.File(utils.resourcePath('api/file/sibling.cellml')); @@ -156,7 +156,7 @@ test.describe('File child tests', () => { file.setContents(utils.fileContents(file.path)); - assert.strictEqual(file.type.value, loc.File.Type.COMBINE_ARCHIVE.value); + assert.strictEqual(file.type.value, loc.File.Type.OMEX_FILE.value); assert.strictEqual(file.childFileCount, 1); assert.notStrictEqual(file.childFileFromFileName('model.cellml'), null); utils.assertIssues(loc, file, expectedIssues); @@ -164,29 +164,29 @@ test.describe('File child tests', () => { assert.strictEqual(loc.FileManager.instance().fileCount, 3); }); - test('COMBINE archive with files outside of it through symbolic link', () => { - // The files of a COMBINE archive are located in a directory which name is that of the COMBINE archive followed by + test('OMEX file with files outside of it through symbolic link', () => { + // The files of an OMEX file are located in a directory which name is that of the OMEX file followed by // ".contents". If such a directory happens to exist and to be a symbolic link then the ".." components that follow - // it are kept (see canonicalFileName()), but the files they refer to are still located outside of the COMBINE - // archive, so they must still be ignored. + // it are kept (see canonicalFileName()), but the files they refer to are still located outside of the OMEX + // file, so they must still be ignored. // Note: our JavaScript bindings use a virtual file system, so a symbolic link is never followed (i.e. the ".." // components are normalised lexically), but the result must be the same. const expectedIssues = [ [ loc.Issue.Type.WARNING, - "COMBINE archive: the file '../sibling.cellml' is not located within the COMBINE archive. It has been ignored." + "OMEX file: the file '../sibling.cellml' is not located within the OMEX file. It has been ignored." ], [ loc.Issue.Type.WARNING, - "COMBINE archive: the file '%2E%2E/encoded_sibling.cellml' is not located within the COMBINE archive. It has been ignored." + "OMEX file: the file '%2E%2E/encoded_sibling.cellml' is not located within the OMEX file. It has been ignored." ], [ loc.Issue.Type.WARNING, - "COMBINE archive: the file '../entries_outside_of_archive.omex' is not located within the COMBINE archive. It has been ignored." + "OMEX file: the file '../entries_outside_of_archive.omex' is not located within the OMEX file. It has been ignored." ] ]; - const dir = path.join(os.tmpdir(), 'libopencor_combine_archive_with_files_outside_of_it_through_symbolic_link'); + const dir = path.join(os.tmpdir(), 'libopencor_omex_file_with_files_outside_of_it_through_symbolic_link'); fs.rmSync(dir, { recursive: true, force: true }); fs.mkdirSync(path.join(dir, 'real'), { recursive: true }); @@ -207,7 +207,7 @@ test.describe('File child tests', () => { process.chdir(origDir); - assert.strictEqual(file.type.value, loc.File.Type.COMBINE_ARCHIVE.value); + assert.strictEqual(file.type.value, loc.File.Type.OMEX_FILE.value); assert.strictEqual(file.childFileCount, 1); assert.notStrictEqual(file.childFileFromFileName('model.cellml'), null); utils.assertIssues(loc, file, expectedIssues); @@ -216,7 +216,7 @@ test.describe('File child tests', () => { fs.rmSync(dir, { recursive: true, force: true }); }); - test('COMBINE archive with percent-encoded locations', () => { + test('OMEX file with percent-encoded locations', () => { // A location is a URI reference, so it may be percent-encoded (e.g., "./my%20file.txt"), in which case the name of // its ZIP entry should be its decoded location (e.g., "my file.txt"), although some tools use the location itself // (e.g., "other%20file.txt"). Either way, a child file must have the contents of its ZIP entry and be retrievable @@ -233,7 +233,7 @@ test.describe('File child tests', () => { file.setContents(utils.fileContents(file.path)); - assert.strictEqual(file.type.value, loc.File.Type.COMBINE_ARCHIVE.value); + assert.strictEqual(file.type.value, loc.File.Type.OMEX_FILE.value); assert.strictEqual(file.hasIssues, false); assert.strictEqual(file.childFileCount, locationsAndFileNames.length); @@ -248,7 +248,7 @@ test.describe('File child tests', () => { } }); - test('COMBINE archive with non-UTF-8 locations', () => { + test('OMEX file with non-UTF-8 locations', () => { // A location may get percent-decoded to a file name that is not valid UTF-8 (e.g., "./%FF.txt" gets decoded to // "\xFF.txt") or that has a character outside of the Basic Multilingual Plane (e.g., "./%F0%9F%98%80.txt" gets // decoded to an emoji), which must not result in an exception being thrown. Either way, a child file must have the @@ -263,7 +263,7 @@ test.describe('File child tests', () => { file.setContents(utils.fileContents(file.path)); - assert.strictEqual(file.type.value, loc.File.Type.COMBINE_ARCHIVE.value); + assert.strictEqual(file.type.value, loc.File.Type.OMEX_FILE.value); assert.strictEqual(file.hasIssues, false); assert.strictEqual(file.childFileCount, locationsAndFileNames.length); @@ -279,7 +279,7 @@ test.describe('File child tests', () => { } }); - test('COMBINE archive with duplicate locations', () => { + test('OMEX file with duplicate locations', () => { // Different locations may refer to the same file (e.g., "./my%20file.txt" and "./my file.txt", or "./file.txt" and // "file.txt"), in which case only the first one is kept and the other ones are ignored. The ignored locations can, // however, still be used to retrieve the child file since they refer to the same file. @@ -287,15 +287,15 @@ test.describe('File child tests', () => { const expectedIssues = [ [ loc.Issue.Type.WARNING, - "COMBINE archive: the file 'file.txt' is the same as the file './file.txt'. It has been ignored." + "OMEX file: the file 'file.txt' is the same as the file './file.txt'. It has been ignored." ], [ loc.Issue.Type.WARNING, - "COMBINE archive: the file './my file.txt' is the same as the file './my%20file.txt'. It has been ignored." + "OMEX file: the file './my file.txt' is the same as the file './my%20file.txt'. It has been ignored." ], [ loc.Issue.Type.WARNING, - "COMBINE archive: the file './other%20file.txt' is the same as the file './other file.txt'. It has been ignored." + "OMEX file: the file './other%20file.txt' is the same as the file './other file.txt'. It has been ignored." ] ]; const locationsFileNamesAndDuplicateLocations = [ @@ -307,7 +307,7 @@ test.describe('File child tests', () => { file.setContents(utils.fileContents(file.path)); - assert.strictEqual(file.type.value, loc.File.Type.COMBINE_ARCHIVE.value); + assert.strictEqual(file.type.value, loc.File.Type.OMEX_FILE.value); utils.assertIssues(loc, file, expectedIssues); assert.strictEqual(file.childFileCount, locationsFileNamesAndDuplicateLocations.length); @@ -325,15 +325,15 @@ test.describe('File child tests', () => { assert.strictEqual(loc.FileManager.instance().fileCount, 4); }); - test('COMBINE archive with self-referencing locations', () => { - // Locations that refer to the COMBINE archive itself (e.g., ".", "./", or "/") are not child files of the COMBINE - // archive. + test('OMEX file with self-referencing locations', () => { + // Locations that refer to the OMEX file itself (e.g., ".", "./", or "/") are not child files of the OMEX + // file. const file = new loc.File(utils.resourcePath('api/file/self_referencing_locations.omex')); file.setContents(utils.fileContents(file.path)); - assert.strictEqual(file.type.value, loc.File.Type.COMBINE_ARCHIVE.value); + assert.strictEqual(file.type.value, loc.File.Type.OMEX_FILE.value); assert.strictEqual(file.hasIssues, false); assert.strictEqual(file.childFileCount, 1); assert.strictEqual(file.childFileNames.get(0), './file.txt'); diff --git a/tests/bindings/javascript/file.i18n.test.js b/tests/bindings/javascript/file.i18n.test.js index 00f3ca327..ac09a4e14 100644 --- a/tests/bindings/javascript/file.i18n.test.js +++ b/tests/bindings/javascript/file.i18n.test.js @@ -38,7 +38,7 @@ test.describe('File i18n tests', () => { assert.strictEqual(cellmlFile.type.value, loc.File.Type.CELLML_FILE.value); assert.strictEqual(sedmlFile.type.value, loc.File.Type.SEDML_FILE.value); - assert.strictEqual(omexFile.type.value, loc.File.Type.COMBINE_ARCHIVE.value); + assert.strictEqual(omexFile.type.value, loc.File.Type.OMEX_FILE.value); }); test('Chinese files', () => { @@ -52,7 +52,7 @@ test.describe('File i18n tests', () => { assert.strictEqual(cellmlFile.type.value, loc.File.Type.CELLML_FILE.value); assert.strictEqual(sedmlFile.type.value, loc.File.Type.SEDML_FILE.value); - assert.strictEqual(omexFile.type.value, loc.File.Type.COMBINE_ARCHIVE.value); + assert.strictEqual(omexFile.type.value, loc.File.Type.OMEX_FILE.value); }); test('Hindi files', () => { @@ -66,7 +66,7 @@ test.describe('File i18n tests', () => { assert.strictEqual(cellmlFile.type.value, loc.File.Type.CELLML_FILE.value); assert.strictEqual(sedmlFile.type.value, loc.File.Type.SEDML_FILE.value); - assert.strictEqual(omexFile.type.value, loc.File.Type.COMBINE_ARCHIVE.value); + assert.strictEqual(omexFile.type.value, loc.File.Type.OMEX_FILE.value); }); test('Japanese files', () => { @@ -80,7 +80,7 @@ test.describe('File i18n tests', () => { assert.strictEqual(cellmlFile.type.value, loc.File.Type.CELLML_FILE.value); assert.strictEqual(sedmlFile.type.value, loc.File.Type.SEDML_FILE.value); - assert.strictEqual(omexFile.type.value, loc.File.Type.COMBINE_ARCHIVE.value); + assert.strictEqual(omexFile.type.value, loc.File.Type.OMEX_FILE.value); }); test('Russian files', () => { @@ -94,6 +94,6 @@ test.describe('File i18n tests', () => { assert.strictEqual(cellmlFile.type.value, loc.File.Type.CELLML_FILE.value); assert.strictEqual(sedmlFile.type.value, loc.File.Type.SEDML_FILE.value); - assert.strictEqual(omexFile.type.value, loc.File.Type.COMBINE_ARCHIVE.value); + assert.strictEqual(omexFile.type.value, loc.File.Type.OMEX_FILE.value); }); }); diff --git a/tests/bindings/javascript/file.type.test.js b/tests/bindings/javascript/file.type.test.js index f22f8d3ae..d975b98db 100644 --- a/tests/bindings/javascript/file.type.test.js +++ b/tests/bindings/javascript/file.type.test.js @@ -24,7 +24,7 @@ import { assertIssues } from './utils.js'; const loc = await libOpenCOR(); const expectedUnknownFileIssues = [ - [loc.Issue.Type.ERROR, 'The file is not a CellML file, a SED-ML file, or a COMBINE archive.'] + [loc.Issue.Type.ERROR, 'The file is not a CellML file, a SED-ML file, or an OMEX file.'] ]; test.describe('File type tests', () => { @@ -84,12 +84,12 @@ test.describe('File type tests', () => { assert.strictEqual(file.type.value, loc.File.Type.SEDML_FILE.value); }); - test('COMBINE 1.x archive', () => { + test('OMEX 1.x file', () => { const file = new loc.File(utils.resourcePath('cellml_1_x.omex')); file.setContents(utils.fileContents(file.path)); - assert.strictEqual(file.type.value, loc.File.Type.COMBINE_ARCHIVE.value); + assert.strictEqual(file.type.value, loc.File.Type.OMEX_FILE.value); }); test('CellML 2 file', () => { @@ -108,12 +108,12 @@ test.describe('File type tests', () => { assert.strictEqual(file.type.value, loc.File.Type.SEDML_FILE.value); }); - test('COMBINE 2 archive', () => { + test('OMEX 2 file', () => { const file = new loc.File(utils.resourcePath('cellml_2.omex')); file.setContents(utils.fileContents(file.path)); - assert.strictEqual(file.type.value, loc.File.Type.COMBINE_ARCHIVE.value); + assert.strictEqual(file.type.value, loc.File.Type.OMEX_FILE.value); }); test('Unknown virtual file', () => { @@ -153,7 +153,7 @@ test.describe('File type tests', () => { assert.strictEqual(file.type.value, loc.File.Type.SEDML_FILE.value); }); - test('COMBINE virtual archive', () => { + test('OMEX virtual file', () => { const filePath = utils.resourcePath('cellml_2.omex'); const file = new loc.File(filePath); @@ -162,6 +162,6 @@ test.describe('File type tests', () => { file.setContents(utils.fileContents(filePath)); - assert.strictEqual(file.type.value, loc.File.Type.COMBINE_ARCHIVE.value); + assert.strictEqual(file.type.value, loc.File.Type.OMEX_FILE.value); }); }); diff --git a/tests/bindings/javascript/res/index.html b/tests/bindings/javascript/res/index.html index b86d7ad7c..81164dc39 100644 --- a/tests/bindings/javascript/res/index.html +++ b/tests/bindings/javascript/res/index.html @@ -40,7 +40,7 @@
- Choose a CellML / SED-ML file or a COMBINE archive, + Choose a CellML / SED-ML file or an OMEX file, or drag and drop such a file here. diff --git a/tests/bindings/javascript/res/res/libopencor.js b/tests/bindings/javascript/res/res/libopencor.js index 7fa4bb871..eb2aa4dd9 100644 --- a/tests/bindings/javascript/res/res/libopencor.js +++ b/tests/bindings/javascript/res/res/libopencor.js @@ -665,7 +665,7 @@ export function updatePlottingAreaAndAxesInfo(pointCount = 0) { } function formattedIssueDescription(issue) { - if (issue.startsWith('CellML') || issue.startsWith('SED-ML') || issue.startsWith('COMBINE')) { + if (issue.startsWith('CellML') || issue.startsWith('SED-ML') || issue.startsWith('OMEX')) { return issue; } @@ -716,8 +716,8 @@ $(() => { fileType = 'a CellML file'; } else if (file.type === loc.File.Type.SEDML_FILE) { fileType = 'a SED-ML file'; - } else if (file.type === loc.File.Type.COMBINE_ARCHIVE) { - fileType = 'a COMBINE archive'; + } else if (file.type === loc.File.Type.OMEX_FILE) { + fileType = 'an OMEX file'; } else { knownFile = false; } diff --git a/tests/bindings/javascript/sed.basic.test.js b/tests/bindings/javascript/sed.basic.test.js index 3e137e546..334f977fd 100644 --- a/tests/bindings/javascript/sed.basic.test.js +++ b/tests/bindings/javascript/sed.basic.test.js @@ -479,7 +479,7 @@ test.describe('Sed basic tests', () => { assert.strictEqual(document.hasIssues, false); }); - test('COMBINE archive', () => { + test('OMEX file', () => { const file = new loc.File(utils.resourcePath('cellml_2.omex')); file.setContents(utils.fileContents(file.path)); @@ -489,7 +489,7 @@ test.describe('Sed basic tests', () => { assert.strictEqual(document.hasIssues, false); }); - test('COMBINE archive with no manifest file', () => { + test('OMEX file with no manifest file', () => { const file = new loc.File(utils.resourcePath('api/sed/no_manifest_file.omex')); file.setContents(utils.fileContents(file.path)); @@ -499,12 +499,12 @@ test.describe('Sed basic tests', () => { assertIssues(loc, document, [ [ loc.Issue.Type.ERROR, - 'A simulation experiment description cannot be created using a COMBINE archive with no master file.' + 'A simulation experiment description cannot be created using an OMEX file with no master file.' ] ]); }); - test('COMBINE archive with no master file and one CellML file', () => { + test('OMEX file with no master file and one CellML file', () => { const file = new loc.File(utils.resourcePath('api/sed/no_master_file_with_one_cellml_file.omex')); file.setContents(utils.fileContents(file.path)); @@ -521,7 +521,7 @@ test.describe('Sed basic tests', () => { assert.strictEqual(instance.hasIssues, false); }); - test('COMBINE archive with no master file and one unknown CellML file', () => { + test('OMEX file with no master file and one unknown CellML file', () => { const file = new loc.File(utils.resourcePath('api/sed/no_master_file_with_one_unknown_cellml_file.omex')); file.setContents(utils.fileContents(file.path)); @@ -531,12 +531,12 @@ test.describe('Sed basic tests', () => { assertIssues(loc, document, [ [ loc.Issue.Type.ERROR, - 'A simulation experiment description cannot be created using a COMBINE archive with an unknown master file (only CellML and SED-ML master files are supported).' + 'A simulation experiment description cannot be created using an OMEX file with an unknown master file (only CellML and SED-ML master files are supported).' ] ]); }); - test('COMBINE archive with no master file and one unknown HTTPS CellML file', () => { + test('OMEX file with no master file and one unknown HTTPS CellML file', () => { // The format of an unknown file is used to determine its type, and a format may use the "https" scheme (e.g., // "https://identifiers.org/combine.specifications/cellml.1.1"). @@ -549,12 +549,12 @@ test.describe('Sed basic tests', () => { assertIssues(loc, document, [ [ loc.Issue.Type.ERROR, - 'A simulation experiment description cannot be created using a COMBINE archive with an unknown master file (only CellML and SED-ML master files are supported).' + 'A simulation experiment description cannot be created using an OMEX file with an unknown master file (only CellML and SED-ML master files are supported).' ] ]); }); - test('COMBINE archive with no master file and several CellML files', () => { + test('OMEX file with no master file and several CellML files', () => { const file = new loc.File(utils.resourcePath('api/sed/no_master_file_with_several_cellml_files.omex')); file.setContents(utils.fileContents(file.path)); @@ -564,12 +564,12 @@ test.describe('Sed basic tests', () => { assertIssues(loc, document, [ [ loc.Issue.Type.ERROR, - 'A simulation experiment description cannot be created using a COMBINE archive with no master file, no SED-ML file, and several CellML files.' + 'A simulation experiment description cannot be created using an OMEX file with no master file, no SED-ML file, and several CellML files.' ] ]); }); - test('COMBINE archive with master file with duplicate location', () => { + test('OMEX file with master file with duplicate location', () => { // The master attribute of an entry that is ignored because its location refers to the same file as another entry // still applies to that file. @@ -582,7 +582,7 @@ test.describe('Sed basic tests', () => { assertIssues(loc, file, [ [ loc.Issue.Type.WARNING, - "COMBINE archive: the file 'cellml_2_b.cellml' is the same as the file './cellml_2_b.cellml'. It has been ignored." + "OMEX file: the file 'cellml_2_b.cellml' is the same as the file './cellml_2_b.cellml'. It has been ignored." ] ]); assert.strictEqual(document.hasIssues, false); @@ -590,7 +590,7 @@ test.describe('Sed basic tests', () => { assert.strictEqual(document.models[0].file.isAliasOf(file.childFileFromFileName('./cellml_2_b.cellml')), true); }); - test('COMBINE archive with no master file and one SED-ML file', () => { + test('OMEX file with no master file and one SED-ML file', () => { const file = new loc.File(utils.resourcePath('api/sed/no_master_file_with_one_sedml_file.omex')); file.setContents(utils.fileContents(file.path)); @@ -607,7 +607,7 @@ test.describe('Sed basic tests', () => { assert.strictEqual(instance.hasIssues, false); }); - test('COMBINE archive with no master file and one unknown SED-ML file', () => { + test('OMEX file with no master file and one unknown SED-ML file', () => { const file = new loc.File(utils.resourcePath('api/sed/no_master_file_with_one_unknown_sedml_file.omex')); file.setContents(utils.fileContents(file.path)); @@ -617,12 +617,12 @@ test.describe('Sed basic tests', () => { assertIssues(loc, document, [ [ loc.Issue.Type.ERROR, - 'A simulation experiment description cannot be created using a COMBINE archive with an unknown master file (only CellML and SED-ML master files are supported).' + 'A simulation experiment description cannot be created using an OMEX file with an unknown master file (only CellML and SED-ML master files are supported).' ] ]); }); - test('COMBINE archive with no master file and one unknown versioned SED-ML file', () => { + test('OMEX file with no master file and one unknown versioned SED-ML file', () => { // The format of an unknown file is used to determine its type, and a format may be versioned and use the "https" // scheme (e.g., "https://identifiers.org/combine.specifications/sed-ml.level-1.version-3"). So, the unknown SED-ML // file is the master file, rather than the CellML file. @@ -636,12 +636,12 @@ test.describe('Sed basic tests', () => { assertIssues(loc, document, [ [ loc.Issue.Type.ERROR, - 'A simulation experiment description cannot be created using a COMBINE archive with an unknown master file (only CellML and SED-ML master files are supported).' + 'A simulation experiment description cannot be created using an OMEX file with an unknown master file (only CellML and SED-ML master files are supported).' ] ]); }); - test('COMBINE archive with no master file and several SED-ML files', () => { + test('OMEX file with no master file and several SED-ML files', () => { const file = new loc.File(utils.resourcePath('api/sed/no_master_file_with_several_sedml_files.omex')); file.setContents(utils.fileContents(file.path)); @@ -651,12 +651,12 @@ test.describe('Sed basic tests', () => { assertIssues(loc, document, [ [ loc.Issue.Type.ERROR, - 'A simulation experiment description cannot be created using a COMBINE archive with no master file and several SED-ML files.' + 'A simulation experiment description cannot be created using an OMEX file with no master file and several SED-ML files.' ] ]); }); - test('COMBINE archive with unknown direct CellML file', () => { + test('OMEX file with unknown direct CellML file', () => { const file = new loc.File(utils.resourcePath('api/sed/unknown_direct_cellml_file.omex')); file.setContents(utils.fileContents(file.path)); @@ -666,12 +666,12 @@ test.describe('Sed basic tests', () => { assertIssues(loc, document, [ [ loc.Issue.Type.ERROR, - 'A simulation experiment description cannot be created using a COMBINE archive with an unknown master file (only CellML and SED-ML master files are supported).' + 'A simulation experiment description cannot be created using an OMEX file with an unknown master file (only CellML and SED-ML master files are supported).' ] ]); }); - test('COMBINE archive with unknown indirect CellML file', () => { + test('OMEX file with unknown indirect CellML file', () => { const file = new loc.File(utils.resourcePath('api/sed/unknown_indirect_cellml_file.omex')); file.setContents(utils.fileContents(file.path)); @@ -687,7 +687,7 @@ test.describe('Sed basic tests', () => { assertIssues(loc, instance, [[loc.Issue.Type.ERROR, "Task: task 'task1' requires a model of CellML type."]]); }); - test('COMBINE archive with unknown SED-ML file', () => { + test('OMEX file with unknown SED-ML file', () => { const file = new loc.File(utils.resourcePath('api/sed/unknown_sedml_file.omex')); file.setContents(utils.fileContents(file.path)); @@ -697,7 +697,7 @@ test.describe('Sed basic tests', () => { assertIssues(loc, document, [ [ loc.Issue.Type.ERROR, - 'A simulation experiment description cannot be created using a COMBINE archive with an unknown master file (only CellML and SED-ML master files are supported).' + 'A simulation experiment description cannot be created using an OMEX file with an unknown master file (only CellML and SED-ML master files are supported).' ] ]); }); diff --git a/tests/bindings/javascript/sed.instance.test.js b/tests/bindings/javascript/sed.instance.test.js index 8066aa620..e75781d03 100644 --- a/tests/bindings/javascript/sed.instance.test.js +++ b/tests/bindings/javascript/sed.instance.test.js @@ -112,10 +112,10 @@ test.describe('Sed instance tests', () => { } }); - test('COMBINE archive with CellML file with imports', () => { + test('OMEX file with CellML file with imports', () => { // Note: the model is such that dx/dt = -x with x(0) = 1, i.e. x(t) = exp(-t). - const file = new loc.File(utils.resourcePath('support/combine/model_with_nested_imports.omex')); + const file = new loc.File(utils.resourcePath('support/omex/model_with_nested_imports.omex')); file.setContents(utils.fileContents(file.path)); @@ -2231,7 +2231,7 @@ test.describe('Sed instance tests', () => { ]); }); - test('COMBINE archive', () => { + test('OMEX file', () => { const file = new loc.File(utils.resourcePath('cellml_2.omex')); file.setContents(utils.fileContents(file.path)); @@ -2244,7 +2244,7 @@ test.describe('Sed instance tests', () => { assert.strictEqual(instance.hasIssues, false); }); - test('COMBINE archive with CellML file as master file', () => { + test('OMEX file with CellML file as master file', () => { const file = new loc.File(utils.resourcePath('api/sed/cellml_file_as_master_file.omex')); file.setContents(utils.fileContents(file.path)); @@ -2302,7 +2302,7 @@ test.describe('Sed instance tests', () => { assert.strictEqual(instance.hasIssues, false); }); - test('DAE model from COMBINE archive', () => { + test('DAE model from OMEX file', () => { const file = new loc.File(utils.resourcePath('api/sed/dae/model.omex')); file.setContents(utils.fileContents(file.path)); @@ -2356,7 +2356,7 @@ test.describe('Sed instance tests', () => { assert.strictEqual(instance.hasIssues, false); }); - test('DAE model from legacy COMBINE archive', () => { + test('DAE model from legacy OMEX file', () => { const file = new loc.File(utils.resourcePath('api/sed/dae/model_legacy.omex')); file.setContents(utils.fileContents(file.path)); diff --git a/tests/bindings/python/test_file_basic.py b/tests/bindings/python/test_file_basic.py index a09798dbf..194997de1 100644 --- a/tests/bindings/python/test_file_basic.py +++ b/tests/bindings/python/test_file_basic.py @@ -30,7 +30,7 @@ expected_unknown_file_issues = [ [ loc.Issue.Type.Error, - "The file is not a CellML file, a SED-ML file, or a COMBINE archive.", + "The file is not a CellML file, a SED-ML file, or an OMEX file.", ], ] diff --git a/tests/bindings/python/test_file_child.py b/tests/bindings/python/test_file_child.py index 501e0fec9..7f2865c9c 100644 --- a/tests/bindings/python/test_file_child.py +++ b/tests/bindings/python/test_file_child.py @@ -76,8 +76,8 @@ def test_dataset_157(): ) -def test_remote_virtual_combine_archives(): - # Two remote COMBINE archives that are not downloaded must not share their child files. +def test_remote_virtual_omex_files(): + # Two remote OMEX files that are not downloaded must not share their child files. file_135 = File(utils.RemoteBasePath + "/api/file/dataset_135.omex", False) file_157 = File(utils.RemoteBasePath + "/api/file/dataset_157.omex", False) @@ -89,8 +89,8 @@ def test_remote_virtual_combine_archives(): utils.binary_file_contents(utils.resource_path("api/file/dataset_157.omex")) ) - assert file_135.type == File.Type.CombineArchive - assert file_157.type == File.Type.CombineArchive + assert file_135.type == File.Type.OmexFile + assert file_157.type == File.Type.OmexFile simulation_file_135 = file_135.child_file("simulation.json") simulation_file_157 = file_157.child_file("simulation.json") @@ -106,9 +106,9 @@ def test_remote_virtual_combine_archives(): ) -def test_remote_combine_archive(): - # The child files of a remote COMBINE archive must be retrievable using their file name, even if the local copy of - # the COMBINE archive is in a directory that is accessed through a symbolic link (e.g., on macOS, the temporary +def test_remote_omex_file(): + # The child files of a remote OMEX file must be retrievable using their file name, even if the local copy of + # the OMEX file is in a directory that is accessed through a symbolic link (e.g., on macOS, the temporary # directory is "/var/...", which is a symbolic link to "/private/var/..."). # Note: this has no JavaScript equivalent since our JavaScript bindings never retrieve the contents of a file, so a # remote file is never downloaded. @@ -116,15 +116,15 @@ def test_remote_combine_archive(): file = File(utils.RemoteBasePath + "/api/file/dataset_135.omex") simulation_file = file.child_file("simulation.json") - assert file.type == File.Type.CombineArchive + assert file.type == File.Type.OmexFile assert simulation_file is not None assert utils.to_string(simulation_file.contents) == utils.text_file_contents( utils.resource_path("api/file/dataset_135.json") ) -def test_combine_archive_replaced_with_other_contents(): - # Replacing the contents of a COMBINE archive with some other contents must release its child files. +def test_omex_file_replaced_with_other_contents(): + # Replacing the contents of an OMEX file with some other contents must release its child files. file = File(utils.resource_path("cellml_2.omex")) file_manager = FileManager.instance() @@ -140,23 +140,23 @@ def test_combine_archive_replaced_with_other_contents(): assert file_manager.file_count == 1 -def test_combine_archive_with_files_outside_of_it(): - # A COMBINE archive may reference files that are located outside of it (e.g., "../sibling.cellml" or even the - # COMBINE archive itself), in which case they must be ignored rather than replace the contents of another managed +def test_omex_file_with_files_outside_of_it(): + # An OMEX file may reference files that are located outside of it (e.g., "../sibling.cellml" or even the + # OMEX file itself), in which case they must be ignored rather than replace the contents of another managed # file (or result in an infinite recursion). expected_issues = [ [ Issue.Type.Warning, - "COMBINE archive: the file '../sibling.cellml' is not located within the COMBINE archive. It has been ignored.", + "OMEX file: the file '../sibling.cellml' is not located within the OMEX file. It has been ignored.", ], [ Issue.Type.Warning, - "COMBINE archive: the file '%2E%2E/encoded_sibling.cellml' is not located within the COMBINE archive. It has been ignored.", + "OMEX file: the file '%2E%2E/encoded_sibling.cellml' is not located within the OMEX file. It has been ignored.", ], [ Issue.Type.Warning, - "COMBINE archive: the file '../entries_outside_of_archive.omex' is not located within the COMBINE archive. It has been ignored.", + "OMEX file: the file '../entries_outside_of_archive.omex' is not located within the OMEX file. It has been ignored.", ], ] @@ -167,7 +167,7 @@ def test_combine_archive_with_files_outside_of_it(): file = File(utils.resource_path("api/file/entries_outside_of_archive.omex")) - assert file.type == File.Type.CombineArchive + assert file.type == File.Type.OmexFile assert file.child_file_count == 1 assert file.child_file("model.cellml") is not None utils.assert_issues(file, expected_issues) @@ -179,31 +179,31 @@ def test_combine_archive_with_files_outside_of_it(): platform.system() == "Windows", reason="A symbolic link usually requires some special privileges on Windows.", ) -def test_combine_archive_with_files_outside_of_it_through_symbolic_link(): - # The files of a COMBINE archive are located in a directory which name is that of the COMBINE archive followed by +def test_omex_file_with_files_outside_of_it_through_symbolic_link(): + # The files of an OMEX file are located in a directory which name is that of the OMEX file followed by # ".contents". If such a directory happens to exist and to be a symbolic link then the ".." components that follow - # it are kept (see canonicalFileName()), but the files they refer to are still located outside of the COMBINE - # archive, so they must still be ignored. + # it are kept (see canonicalFileName()), but the files they refer to are still located outside of the OMEX + # file, so they must still be ignored. # Note: a symbolic link usually requires some special privileges on Windows. expected_issues = [ [ Issue.Type.Warning, - "COMBINE archive: the file '../sibling.cellml' is not located within the COMBINE archive. It has been ignored.", + "OMEX file: the file '../sibling.cellml' is not located within the OMEX file. It has been ignored.", ], [ Issue.Type.Warning, - "COMBINE archive: the file '%2E%2E/encoded_sibling.cellml' is not located within the COMBINE archive. It has been ignored.", + "OMEX file: the file '%2E%2E/encoded_sibling.cellml' is not located within the OMEX file. It has been ignored.", ], [ Issue.Type.Warning, - "COMBINE archive: the file '../entries_outside_of_archive.omex' is not located within the COMBINE archive. It has been ignored.", + "OMEX file: the file '../entries_outside_of_archive.omex' is not located within the OMEX file. It has been ignored.", ], ] dir_path = os.path.join( tempfile.gettempdir(), - "libopencor_combine_archive_with_files_outside_of_it_through_symbolic_link", + "libopencor_omex_file_with_files_outside_of_it_through_symbolic_link", ) shutil.rmtree(dir_path, ignore_errors=True) @@ -226,7 +226,7 @@ def test_combine_archive_with_files_outside_of_it_through_symbolic_link(): os.chdir(orig_dir) - assert file.type == File.Type.CombineArchive + assert file.type == File.Type.OmexFile assert file.child_file_count == 1 assert file.child_file("model.cellml") is not None utils.assert_issues(file, expected_issues) @@ -235,7 +235,7 @@ def test_combine_archive_with_files_outside_of_it_through_symbolic_link(): shutil.rmtree(dir_path) -def test_combine_archive_with_percent_encoded_locations(): +def test_omex_file_with_percent_encoded_locations(): # A location is a URI reference, so it may be percent-encoded (e.g., "./my%20file.txt"), in which case the name of # its ZIP entry should be its decoded location (e.g., "my file.txt"), although some tools use the location itself # (e.g., "other%20file.txt"). Either way, a child file must have the contents of its ZIP entry and be retrievable @@ -250,7 +250,7 @@ def test_combine_archive_with_percent_encoded_locations(): ] file = File(utils.resource_path("api/file/percent_encoded_locations.omex")) - assert file.type == File.Type.CombineArchive + assert file.type == File.Type.OmexFile assert not file.has_issues assert file.child_file_count == len(locations_and_file_names) @@ -264,7 +264,7 @@ def test_combine_archive_with_percent_encoded_locations(): assert child_file.contents == utils.text_to_list(file_name) -def test_combine_archive_with_non_utf8_locations(): +def test_omex_file_with_non_utf8_locations(): # A location may get percent-decoded to a file name that is not valid UTF-8 (e.g., "./%FF.txt" gets decoded to # "\xFF.txt") or that has a character outside of the Basic Multilingual Plane (e.g., "./%F0%9F%98%80.txt" gets # decoded to an emoji), which must not result in an exception being thrown. Either way, a child file must have the @@ -277,7 +277,7 @@ def test_combine_archive_with_non_utf8_locations(): ] file = File(utils.resource_path("api/file/non_utf8_locations.omex")) - assert file.type == File.Type.CombineArchive + assert file.type == File.Type.OmexFile assert not file.has_issues assert file.child_file_count == len(locations_and_file_names) @@ -292,7 +292,7 @@ def test_combine_archive_with_non_utf8_locations(): assert child_file.contents == utils.text_to_list(location) -def test_combine_archive_with_duplicate_locations(): +def test_omex_file_with_duplicate_locations(): # Different locations may refer to the same file (e.g., "./my%20file.txt" and "./my file.txt", or "./file.txt" and # "file.txt"), in which case only the first one is kept and the other ones are ignored. The ignored locations can, # however, still be used to retrieve the child file since they refer to the same file. @@ -300,15 +300,15 @@ def test_combine_archive_with_duplicate_locations(): expected_issues = [ [ Issue.Type.Warning, - "COMBINE archive: the file 'file.txt' is the same as the file './file.txt'. It has been ignored.", + "OMEX file: the file 'file.txt' is the same as the file './file.txt'. It has been ignored.", ], [ Issue.Type.Warning, - "COMBINE archive: the file './my file.txt' is the same as the file './my%20file.txt'. It has been ignored.", + "OMEX file: the file './my file.txt' is the same as the file './my%20file.txt'. It has been ignored.", ], [ Issue.Type.Warning, - "COMBINE archive: the file './other%20file.txt' is the same as the file './other file.txt'. It has been ignored.", + "OMEX file: the file './other%20file.txt' is the same as the file './other file.txt'. It has been ignored.", ], ] locations_file_names_and_duplicate_locations = [ @@ -318,7 +318,7 @@ def test_combine_archive_with_duplicate_locations(): ] file = File(utils.resource_path("api/file/duplicate_locations.omex")) - assert file.type == File.Type.CombineArchive + assert file.type == File.Type.OmexFile utils.assert_issues(file, expected_issues) assert file.child_file_count == len(locations_file_names_and_duplicate_locations) @@ -337,13 +337,13 @@ def test_combine_archive_with_duplicate_locations(): assert FileManager.instance().file_count == 4 -def test_combine_archive_with_self_referencing_locations(): - # Locations that refer to the COMBINE archive itself (e.g., ".", "./", or "/") are not child files of the COMBINE - # archive. +def test_omex_file_with_self_referencing_locations(): + # Locations that refer to the OMEX file itself (e.g., ".", "./", or "/") are not child files of the OMEX + # file. file = File(utils.resource_path("api/file/self_referencing_locations.omex")) - assert file.type == File.Type.CombineArchive + assert file.type == File.Type.OmexFile assert not file.has_issues assert file.child_file_count == 1 assert file.child_file_names[0] == "./file.txt" diff --git a/tests/bindings/python/test_file_i18n.py b/tests/bindings/python/test_file_i18n.py index 531173d95..3ff7c6339 100644 --- a/tests/bindings/python/test_file_i18n.py +++ b/tests/bindings/python/test_file_i18n.py @@ -27,7 +27,7 @@ def test_arabic_files(): ) assert ( loc.File(utils.resource_path("i18n/ملف/file.omex")).type - == loc.File.Type.CombineArchive + == loc.File.Type.OmexFile ) @@ -42,7 +42,7 @@ def test_chinese_files(): ) assert ( loc.File(utils.resource_path("i18n/文件夹/file.omex")).type - == loc.File.Type.CombineArchive + == loc.File.Type.OmexFile ) @@ -57,7 +57,7 @@ def test_hindi_files(): ) assert ( loc.File(utils.resource_path("i18n/फोल्डर/file.omex")).type - == loc.File.Type.CombineArchive + == loc.File.Type.OmexFile ) @@ -72,7 +72,7 @@ def test_japanese_files(): ) assert ( loc.File(utils.resource_path("i18n/フォルダ/file.omex")).type - == loc.File.Type.CombineArchive + == loc.File.Type.OmexFile ) @@ -87,5 +87,5 @@ def test_russian_files(): ) assert ( loc.File(utils.resource_path("i18n/папка/file.omex")).type - == loc.File.Type.CombineArchive + == loc.File.Type.OmexFile ) diff --git a/tests/bindings/python/test_file_type.py b/tests/bindings/python/test_file_type.py index 468fd695e..71864f556 100644 --- a/tests/bindings/python/test_file_type.py +++ b/tests/bindings/python/test_file_type.py @@ -20,7 +20,7 @@ expected_unknown_file_issues = [ [ loc.Issue.Type.Error, - "The file is not a CellML file, a SED-ML file, or a COMBINE archive.", + "The file is not a CellML file, a SED-ML file, or an OMEX file.", ], ] expected_irretrievable_file_issues = [ @@ -67,10 +67,10 @@ def test_sedml_1_x_file(): assert file.type == loc.File.Type.SedmlFile -def test_combine_1_x_archive(): +def test_omex_1_x_file(): file = loc.File(utils.resource_path("cellml_1_x.omex")) - assert file.type == loc.File.Type.CombineArchive + assert file.type == loc.File.Type.OmexFile def test_cellml_2_file(): @@ -85,10 +85,10 @@ def test_sedml_2_file(): assert file.type == loc.File.Type.SedmlFile -def test_combine_2_archive(): +def test_omex_2_file(): file = loc.File(utils.resource_path("cellml_2.omex")) - assert file.type == loc.File.Type.CombineArchive + assert file.type == loc.File.Type.OmexFile def test_unknown_virtual_file(): @@ -128,7 +128,7 @@ def test_sedml_virtual_file(): assert file.type == loc.File.Type.SedmlFile -def test_combine_virtual_archive(): +def test_omex_virtual_file(): file_path = utils.resource_path("cellml_2.omex") file = loc.File(file_path, False) @@ -137,4 +137,4 @@ def test_combine_virtual_archive(): file.contents = utils.binary_to_list(utils.binary_file_contents(file_path)) - assert file.type == loc.File.Type.CombineArchive + assert file.type == loc.File.Type.OmexFile diff --git a/tests/bindings/python/test_sed_basic.py b/tests/bindings/python/test_sed_basic.py index b27a7dda2..7257723cd 100644 --- a/tests/bindings/python/test_sed_basic.py +++ b/tests/bindings/python/test_sed_basic.py @@ -521,18 +521,18 @@ def test_sedml_file_with_remote_cellml_file(): assert not document.has_issues -def test_combine_archive(): +def test_omex_file(): file = loc.File(utils.resource_path("cellml_2.omex")) document = loc.SedDocument(file) assert not document.has_issues -def test_combine_archive_with_no_manifest_file(): +def test_omex_file_with_no_manifest_file(): expected_issues = [ [ loc.Issue.Type.Error, - "A simulation experiment description cannot be created using a COMBINE archive with no master file.", + "A simulation experiment description cannot be created using an OMEX file with no master file.", ], ] @@ -542,7 +542,7 @@ def test_combine_archive_with_no_manifest_file(): assert_issues(document, expected_issues) -def test_combine_archive_with_no_master_file_and_one_cellml_file(): +def test_omex_file_with_no_master_file_and_one_cellml_file(): file = loc.File( utils.resource_path("api/sed/no_master_file_with_one_cellml_file.omex") ) @@ -558,11 +558,11 @@ def test_combine_archive_with_no_master_file_and_one_cellml_file(): assert not instance.has_issues -def test_combine_archive_with_no_master_file_and_one_unknown_cellml_file(): +def test_omex_file_with_no_master_file_and_one_unknown_cellml_file(): expected_issues = [ [ loc.Issue.Type.Error, - "A simulation experiment description cannot be created using a COMBINE archive with an unknown master file (only CellML and SED-ML master files are supported).", + "A simulation experiment description cannot be created using an OMEX file with an unknown master file (only CellML and SED-ML master files are supported).", ], ] @@ -574,14 +574,14 @@ def test_combine_archive_with_no_master_file_and_one_unknown_cellml_file(): assert_issues(document, expected_issues) -def test_combine_archive_with_no_master_file_and_one_unknown_https_cellml_file(): +def test_omex_file_with_no_master_file_and_one_unknown_https_cellml_file(): # The format of an unknown file is used to determine its type, and a format may use the "https" scheme (e.g., # "https://identifiers.org/combine.specifications/cellml.1.1"). expected_issues = [ [ loc.Issue.Type.Error, - "A simulation experiment description cannot be created using a COMBINE archive with an unknown master file (only CellML and SED-ML master files are supported).", + "A simulation experiment description cannot be created using an OMEX file with an unknown master file (only CellML and SED-ML master files are supported).", ], ] @@ -595,11 +595,11 @@ def test_combine_archive_with_no_master_file_and_one_unknown_https_cellml_file() assert_issues(document, expected_issues) -def test_combine_archive_with_no_master_file_and_several_cellml_files(): +def test_omex_file_with_no_master_file_and_several_cellml_files(): expected_issues = [ [ loc.Issue.Type.Error, - "A simulation experiment description cannot be created using a COMBINE archive with no master file, no SED-ML file, and several CellML files.", + "A simulation experiment description cannot be created using an OMEX file with no master file, no SED-ML file, and several CellML files.", ], ] @@ -611,14 +611,14 @@ def test_combine_archive_with_no_master_file_and_several_cellml_files(): assert_issues(document, expected_issues) -def test_combine_archive_with_master_file_with_duplicate_location(): +def test_omex_file_with_master_file_with_duplicate_location(): # The master attribute of an entry that is ignored because its location refers to the same file as another entry # still applies to that file. expected_issues = [ [ loc.Issue.Type.Warning, - "COMBINE archive: the file 'cellml_2_b.cellml' is the same as the file './cellml_2_b.cellml'. It has been ignored.", + "OMEX file: the file 'cellml_2_b.cellml' is the same as the file './cellml_2_b.cellml'. It has been ignored.", ], ] @@ -633,7 +633,7 @@ def test_combine_archive_with_master_file_with_duplicate_location(): assert document.models[0].file == file.child_file("./cellml_2_b.cellml") -def test_combine_archive_with_no_master_file_and_one_sedml_file(): +def test_omex_file_with_no_master_file_and_one_sedml_file(): file = loc.File( utils.resource_path("api/sed/no_master_file_with_one_sedml_file.omex") ) @@ -649,11 +649,11 @@ def test_combine_archive_with_no_master_file_and_one_sedml_file(): assert not instance.has_issues -def test_combine_archive_with_no_master_file_and_one_unknown_sedml_file(): +def test_omex_file_with_no_master_file_and_one_unknown_sedml_file(): expected_issues = [ [ loc.Issue.Type.Error, - "A simulation experiment description cannot be created using a COMBINE archive with an unknown master file (only CellML and SED-ML master files are supported).", + "A simulation experiment description cannot be created using an OMEX file with an unknown master file (only CellML and SED-ML master files are supported).", ], ] @@ -665,7 +665,7 @@ def test_combine_archive_with_no_master_file_and_one_unknown_sedml_file(): assert_issues(document, expected_issues) -def test_combine_archive_with_no_master_file_and_one_unknown_versioned_sedml_file(): +def test_omex_file_with_no_master_file_and_one_unknown_versioned_sedml_file(): # The format of an unknown file is used to determine its type, and a format may be versioned and use the "https" # scheme (e.g., "https://identifiers.org/combine.specifications/sed-ml.level-1.version-3"). So, the unknown SED-ML # file is the master file, rather than the CellML file. @@ -673,7 +673,7 @@ def test_combine_archive_with_no_master_file_and_one_unknown_versioned_sedml_fil expected_issues = [ [ loc.Issue.Type.Error, - "A simulation experiment description cannot be created using a COMBINE archive with an unknown master file (only CellML and SED-ML master files are supported).", + "A simulation experiment description cannot be created using an OMEX file with an unknown master file (only CellML and SED-ML master files are supported).", ], ] @@ -687,11 +687,11 @@ def test_combine_archive_with_no_master_file_and_one_unknown_versioned_sedml_fil assert_issues(document, expected_issues) -def test_combine_archive_with_no_master_file_and_several_sedml_files(): +def test_omex_file_with_no_master_file_and_several_sedml_files(): expected_issues = [ [ loc.Issue.Type.Error, - "A simulation experiment description cannot be created using a COMBINE archive with no master file and several SED-ML files.", + "A simulation experiment description cannot be created using an OMEX file with no master file and several SED-ML files.", ], ] @@ -703,11 +703,11 @@ def test_combine_archive_with_no_master_file_and_several_sedml_files(): assert_issues(document, expected_issues) -def test_combine_archive_with_unknown_direct_cellml_file(): +def test_omex_file_with_unknown_direct_cellml_file(): expected_issues = [ [ loc.Issue.Type.Error, - "A simulation experiment description cannot be created using a COMBINE archive with an unknown master file (only CellML and SED-ML master files are supported).", + "A simulation experiment description cannot be created using an OMEX file with an unknown master file (only CellML and SED-ML master files are supported).", ], ] @@ -717,7 +717,7 @@ def test_combine_archive_with_unknown_direct_cellml_file(): assert_issues(document, expected_issues) -def test_combine_archive_with_unknown_indirect_cellml_file(): +def test_omex_file_with_unknown_indirect_cellml_file(): expected_issues = [ [ loc.Issue.Type.Error, @@ -737,11 +737,11 @@ def test_combine_archive_with_unknown_indirect_cellml_file(): assert_issues(instance, expected_issues) -def test_combine_archive_with_unknown_sedml_file(): +def test_omex_file_with_unknown_sedml_file(): expected_issues = [ [ loc.Issue.Type.Error, - "A simulation experiment description cannot be created using a COMBINE archive with an unknown master file (only CellML and SED-ML master files are supported).", + "A simulation experiment description cannot be created using an OMEX file with an unknown master file (only CellML and SED-ML master files are supported).", ], ] diff --git a/tests/bindings/python/test_sed_instance.py b/tests/bindings/python/test_sed_instance.py index 8e37fe899..9a83969ea 100644 --- a/tests/bindings/python/test_sed_instance.py +++ b/tests/bindings/python/test_sed_instance.py @@ -134,12 +134,10 @@ def test_cellml_file_with_in_memory_imports(): assert math.isclose(state[i], math.exp(-voi[i]), abs_tol=1e-5) -def test_combine_archive_with_cellml_file_with_imports(): +def test_omex_file_with_cellml_file_with_imports(): # Note: the model is such that dx/dt = -x with x(0) = 1, i.e. x(t) = exp(-t). - file = loc.File( - utils.resource_path("support/combine/model_with_nested_imports.omex") - ) + file = loc.File(utils.resource_path("support/omex/model_with_nested_imports.omex")) document = loc.SedDocument(file) instance = document.instantiate() @@ -2052,7 +2050,7 @@ def test_dae_model_with_failing_ode_solver(): assert_issues(instance, expected_issues) -def test_combine_archive(): +def test_omex_file(): file = loc.File(utils.resource_path("cellml_2.omex")) document = loc.SedDocument(file) instance = document.instantiate() @@ -2062,7 +2060,7 @@ def test_combine_archive(): assert not instance.has_issues -def test_combine_archive_with_cellml_file_as_master_file(): +def test_omex_file_with_cellml_file_as_master_file(): file = loc.File(utils.resource_path("api/sed/cellml_file_as_master_file.omex")) document = loc.SedDocument(file) instance = document.instantiate() @@ -2108,7 +2106,7 @@ def test_dae_model_from_sedml_file(): assert not instance.has_issues -def test_dae_model_from_combine_archive(): +def test_dae_model_from_omex_file(): file = loc.File(utils.resource_path("api/sed/dae/model.omex")) document = loc.SedDocument(file) @@ -2153,7 +2151,7 @@ def test_dae_model_from_legacy_sedml_file(): assert not instance.has_issues -def test_dae_model_from_legacy_combine_archive(): +def test_dae_model_from_legacy_omex_file(): file = loc.File(utils.resource_path("api/sed/dae/model_legacy.omex")) document = loc.SedDocument(file) diff --git a/tests/install/bindings/python/test_install.py b/tests/install/bindings/python/test_install.py index d976c87bc..c913ce22c 100644 --- a/tests/install/bindings/python/test_install.py +++ b/tests/install/bindings/python/test_install.py @@ -8,7 +8,7 @@ print(f"Version: {loc.version()}") print(f"Version string: {loc.version_string()}") - # Load a COMBINE archive from GitHub and output some information about it. + # Load an OMEX file from GitHub and output some information about it. file = loc.File( "https://raw.githubusercontent.com/opencor/libopencor/master/tests/res/cellml_2.omex" diff --git a/tests/install/src/main.cpp b/tests/install/src/main.cpp index b44c00b49..ad90b61e6 100644 --- a/tests/install/src/main.cpp +++ b/tests/install/src/main.cpp @@ -10,7 +10,7 @@ int main() std::cout << "Version: " << libOpenCOR::version() << "\n"; std::cout << "Version string: " << libOpenCOR::versionString() << "\n"; - // Load a COMBINE archive from GitHub and output some information about it. + // Load an OMEX file from GitHub and output some information about it. auto file {libOpenCOR::File::create("https://raw.githubusercontent.com/opencor/libopencor/master/tests/res/cellml_2.omex")}; auto document {libOpenCOR::SedDocument::create(file)}; diff --git a/tests/res/support/combine/model_with_nested_imports.omex b/tests/res/support/omex/model_with_nested_imports.omex similarity index 100% rename from tests/res/support/combine/model_with_nested_imports.omex rename to tests/res/support/omex/model_with_nested_imports.omex diff --git a/tests/support/cellml/basictests.cpp b/tests/support/cellml/basictests.cpp index b42b1dd2a..e430c831b 100644 --- a/tests/support/cellml/basictests.cpp +++ b/tests/support/cellml/basictests.cpp @@ -64,9 +64,9 @@ TEST(BasicCellmlTest, modelWithNestedImports) EXPECT_EQ(cellmlFile->type(), libcellml::AnalyserModel::Type::ODE); } -TEST(BasicCellmlTest, modelWithNestedImportsInCombineArchive) +TEST(BasicCellmlTest, modelWithNestedImportsInOmexFile) { - auto file {libOpenCOR::File::create(libOpenCOR::resourcePath("support/combine/model_with_nested_imports.omex"))}; + auto file {libOpenCOR::File::create(libOpenCOR::resourcePath("support/omex/model_with_nested_imports.omex"))}; EXPECT_FALSE(file->hasIssues()); EXPECT_EQ(file->childFileCount(), 3U); diff --git a/tests/support/combine/basictests.cpp b/tests/support/omex/basictests.cpp similarity index 78% rename from tests/support/combine/basictests.cpp rename to tests/support/omex/basictests.cpp index 83498c676..58e54c79a 100644 --- a/tests/support/combine/basictests.cpp +++ b/tests/support/omex/basictests.cpp @@ -14,16 +14,16 @@ See the License for the specific language governing permissions and limitations under the License. */ -#include "combinearchive.h" +#include "omexfile.h" #include "tests/utils.h" #include -TEST(BasicOmexTest, createCombineArchiveWithNonCombineArchive) +TEST(BasicOmexTest, createOmexFileWithNonOmexFile) { auto file = libOpenCOR::File::create(libOpenCOR::resourcePath("unknown_file.txt")); - auto combineArchive = libOpenCOR::CombineArchive::create(file); + auto omexFile = libOpenCOR::OmexFile::create(file); - EXPECT_EQ(combineArchive, nullptr); + EXPECT_EQ(omexFile, nullptr); } diff --git a/tests/support/combine/coveragetests.cpp b/tests/support/omex/coveragetests.cpp similarity index 75% rename from tests/support/combine/coveragetests.cpp rename to tests/support/omex/coveragetests.cpp index ad7e935b2..49344307b 100644 --- a/tests/support/combine/coveragetests.cpp +++ b/tests/support/omex/coveragetests.cpp @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -#include "combinearchive.h" +#include "omexfile.h" #include "tests/utils.h" @@ -23,9 +23,9 @@ limitations under the License. TEST(CoverageOmexTest, file) { auto file = libOpenCOR::File::create(libOpenCOR::resourcePath("cellml_2.omex")); - auto combineArchive = libOpenCOR::CombineArchive::create(file); + auto omexFile = libOpenCOR::OmexFile::create(file); - EXPECT_NE(combineArchive->file(0), nullptr); - EXPECT_NE(combineArchive->file(1), nullptr); - EXPECT_EQ(combineArchive->file(2), nullptr); + EXPECT_NE(omexFile->file(0), nullptr); + EXPECT_NE(omexFile->file(1), nullptr); + EXPECT_EQ(omexFile->file(2), nullptr); } diff --git a/tests/support/combine/tests.cmake b/tests/support/omex/tests.cmake similarity index 97% rename from tests/support/combine/tests.cmake rename to tests/support/omex/tests.cmake index eb7faed0e..1ba8b3b7a 100644 --- a/tests/support/combine/tests.cmake +++ b/tests/support/omex/tests.cmake @@ -12,7 +12,7 @@ # See the License for the specific language governing permissions and # limitations under the License. -set(TEST combine) +set(TEST omex) list(APPEND TESTS ${TEST}) From 6069d2f20290b40556b315b8de92b1d9e74450f5 Mon Sep 17 00:00:00 2001 From: Alan Garny Date: Thu, 26 Nov 2026 16:36:23 +1300 Subject: [PATCH 3/5] JavaScript playground: extended the delay range to 1 s. --- tests/bindings/javascript/res/res/libopencor.js | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/tests/bindings/javascript/res/res/libopencor.js b/tests/bindings/javascript/res/res/libopencor.js index eb2aa4dd9..d25a870a8 100644 --- a/tests/bindings/javascript/res/res/libopencor.js +++ b/tests/bindings/javascript/res/res/libopencor.js @@ -16,16 +16,19 @@ const chart = lightningChart() .setAnimationsEnabled(false); const lineSeries = chart.addLineSeries().setName(''); let plottedPointCount = 0; -// Our delays (in microseconds), i.e. no delay, 1 to 10 µs in steps of 1 µs, 10 to 100 µs in steps of 10 µs, and 100 µs -// to 1 ms in steps of 100 µs, with a major step for 1 µs, 10 µs, 100 µs, and 1 ms (see setupDelayWheel()). +// Our delays (in microseconds), i.e. no delay, and then 1 to 9 times a power of ten, from 1 µs to 1 s (i.e. 1 to 9 µs, +// 10 to 90 µs, ..., 100 to 900 ms, and 1 s), with a major step for each power of ten (i.e. 1 µs, 10 µs, 100 µs, 1 ms, +// 10 ms, 100 ms, and 1 s; see setupDelayWheel()). +const DELAY_DECADES = [1, 10, 100, 1000, 10000, 100000]; const DELAYS = [ 0, - ...Array.from({ length: 10 }, (_, i) => i + 1), - ...Array.from({ length: 9 }, (_, i) => 10 * (i + 2)), - ...Array.from({ length: 9 }, (_, i) => 100 * (i + 2)) + ...DELAY_DECADES.flatMap((decade) => Array.from({ length: 9 }, (_, i) => decade * (i + 1))), + 1000000 ]; const DELAY_STEPS = DELAYS.length - 1; -const DELAY_MAJOR_STEPS = DELAYS.flatMap((delay, index) => ([1, 10, 100, 1000].includes(delay) ? [index] : [])); +const DELAY_MAJOR_STEPS = DELAYS.flatMap((delay, index) => + [...DELAY_DECADES, 1000000].includes(delay) ? [index] : [] +); const DELAY_WHEEL_WIDTH = 120; // Must match the width of our wheel (see .delay-wheel in libopencor.css). const DELAY_WHEEL_HEIGHT = 28; // Must match the height of our wheel (see .delay-wheel in libopencor.css). const DELAY_WHEEL_BORDER_WIDTH = 1; // Must match the width of our border (see .delay-wheel in libopencor.css). From 370e1bbe1b7b1753b186ddc81e070f5b828eb7ac Mon Sep 17 00:00:00 2001 From: Alan Garny Date: Thu, 26 Nov 2026 16:44:00 +1300 Subject: [PATCH 4/5] Reflowed our comments to 120 characters and numbered multiple notes. --- .codespellexclude | 2 +- cmake/applypatches.cmake | 6 +-- cmake/common.cmake | 6 +-- cmake/packages.cmake | 14 +++--- src/api/libopencor/file.h | 3 +- src/api/libopencor/sedinstance.h | 6 +-- src/api/libopencor/seduniformtimecourse.h | 3 +- src/api/libopencor/version.h | 10 ++--- src/bindings/javascript/CMakeLists.txt | 5 +-- src/bindings/javascript/file.cpp | 4 +- src/bindings/javascript/postprocess.dts.mjs | 4 +- src/bindings/python/glibc_strtol.cpp | 4 +- src/bindings/python/stringcaster.h | 4 +- src/file/file.cpp | 6 +-- src/misc/compiler.cpp | 4 +- src/misc/irgenerator.cpp | 17 ++++--- src/misc/utils.cpp | 28 ++++++------ src/sed/sedinstance.cpp | 10 ++--- src/sed/sedinstancetask.cpp | 12 ++--- src/sed/seduniformtimecourse.cpp | 6 +-- src/solver/solverkinsol.cpp | 8 ++-- src/support/cellml/cellmlfile.cpp | 14 +++--- src/support/cellml/cellmlfileruntime.cpp | 10 ++--- src/support/omex/omexfile.cpp | 45 +++++++++---------- src/support/sedml/sedmlfile.cpp | 7 ++- tests/api/file/childtests.cpp | 23 +++++----- tests/api/sed/basictests.cpp | 4 +- tests/api/sed/instancetests.cpp | 6 +-- tests/api/sed/serialisetests.cpp | 8 ++-- tests/bindings/javascript/file.child.test.js | 17 ++++--- tests/bindings/javascript/sed.basic.test.js | 4 +- .../bindings/javascript/sed.coverage.test.js | 4 +- .../bindings/javascript/sed.instance.test.js | 22 ++++----- .../bindings/javascript/sed.serialise.test.js | 8 ++-- tests/bindings/python/test_file_basic.py | 4 +- tests/bindings/python/test_file_child.py | 23 +++++----- tests/bindings/python/test_sed_basic.py | 4 +- tests/bindings/python/test_sed_coverage.py | 12 ++--- tests/bindings/python/test_sed_instance.py | 14 +++--- tests/bindings/python/test_sed_serialise.py | 22 ++++----- tests/memory_checks.py | 3 +- tests/misc/utils.cpp | 7 ++- 42 files changed, 206 insertions(+), 217 deletions(-) diff --git a/.codespellexclude b/.codespellexclude index f1c5cee7c..8998d8565 100644 --- a/.codespellexclude +++ b/.codespellexclude @@ -8,7 +8,7 @@ mErrors.clear(); mTasksErrors = mErrors; mErrors.clear(); - // Note: the clearing of mIssues, mErrors, and mWarnings could be done using removeAllIssues(), but this would + // Note #1: the clearing of mIssues, mErrors, and mWarnings could be done using removeAllIssues(), but this would mErrors = mTasksErrors; mErrorCount.store(mErrors.size(), std::memory_order_release); if ((document->getNumErrors() == 0) diff --git a/cmake/applypatches.cmake b/cmake/applypatches.cmake index a9f0afbbb..3ba1a2b63 100644 --- a/cmake/applypatches.cmake +++ b/cmake/applypatches.cmake @@ -15,9 +15,9 @@ # Apply our patches to the source code of a third-party library. # Note #1: the patches are applied by build_package() when building a third-party library from source (see # patch_package_args() in packages.cmake), which is also how our prebuilt packages are built. -# Note #2: ExternalProject downloads and extracts the source code afresh whenever our patches or this script change -# (see patch_package_args() in packages.cmake), so we always patch a pristine copy of it and never need to -# revert anything. +# Note #2: ExternalProject downloads and extracts the source code afresh whenever our patches or this script change (see +# patch_package_args() in packages.cmake), so we always patch a pristine copy of it and never need to revert +# anything. # Note #3: our patches have LF line endings, whatever the platform (see .gitattributes) and so do (normally) the source # files that they patch. Still, we make sure that Git never writes CRLF line endings into the patched files # (core.autocrlf=input overrides Git for Windows' default, i.e. core.autocrlf=true), and we ask Git to ignore diff --git a/cmake/common.cmake b/cmake/common.cmake index ff807e56f..e07d654aa 100644 --- a/cmake/common.cmake +++ b/cmake/common.cmake @@ -423,9 +423,9 @@ endmacro() function(prepare_test TARGET) # Prepare the given test. - # Note: we don't want modp_b64.cc to be subjected to Clang-Tidy, hence we compile it separately. From Cmake 3.27, - # we could use the SKIP_LINTING property to exclude it from Clang-Tidy, but for some reasons it's not working, - # so we compile it separately (as suggested at https://stackoverflow.com/a/75858167). + # Note: we don't want modp_b64.cc to be subjected to Clang-Tidy, hence we compile it separately. From Cmake 3.27, we + # could use the SKIP_LINTING property to exclude it from Clang-Tidy, but for some reasons it's not working, so + # we compile it separately (as suggested at https://stackoverflow.com/a/75858167). add_executable(${TARGET} ${ARGN}) diff --git a/cmake/packages.cmake b/cmake/packages.cmake index c23aa0d78..e2ef5e4f9 100644 --- a/cmake/packages.cmake +++ b/cmake/packages.cmake @@ -234,8 +234,8 @@ function(retrieve_package PACKAGE_NAME PACKAGE_VERSION PACKAGE_REPOSITORY RELEAS # Check whether the package has already been retrieved by checking whether its installation directory contains a # marker file with the SHA-1 value of the package that we want. If the marker file is missing or if it has a # different SHA-1 value, then we remove the installation directory and retrieve the package anew. - # Note: the marker file is located at the root of the installation directory, so create_package() never includes - # it in a package since it only packages some specific subdirectories and/or files. + # Note: the marker file is located at the root of the installation directory, so create_package() never includes it + # in a package since it only packages some specific subdirectories and/or files. set(INSTALL_DIR ${PREBUILT_DIR}/${PACKAGE_NAME}) set(MARKER_FILE ${INSTALL_DIR}/.sha1) @@ -395,9 +395,9 @@ set(PREBUILT_DIR "${PREBUILT_DIR}" CACHE INTERNAL "Prebuilt directory.") include(ExternalProject) -# On Linux, build our third-party libraries as position-independent code and put each of their functions and data in -# its own section, so that the linker can remove the ones that we don't use when building libOpenCOR (see --gc-sections -# in src/CMakeLists.txt and src/bindings/python/CMakeLists.txt). Indeed, the linker can only remove whole sections and, +# On Linux, build our third-party libraries as position-independent code and put each of their functions and data in its +# own section, so that the linker can remove the ones that we don't use when building libOpenCOR (see --gc-sections in +# src/CMakeLists.txt and src/bindings/python/CMakeLists.txt). Indeed, the linker can only remove whole sections and, # without this, all the functions of an object file would be in the same section. # Note: there is no need for this on Windows (MSVC does it by default in release mode) or on macOS (the linker removes # unused functions and data anyway, see -dead_strip in src/CMakeLists.txt). @@ -454,8 +454,8 @@ endif() if(EMSCRIPTEN) # Note #1: we are using the same CMake variables that we used to build libOpenCOR, so that we can build our # third-party libraries in the same way that we built libOpenCOR. - # Note #2: with Emscripten 7, libc++ no longer includes some headers indirectly, but some third-party libraries - # may use something from them without including them (e.g., libCellML uses std::strtod() without including + # Note #2: with Emscripten 7, libc++ no longer includes some headers indirectly, but some third-party libraries may + # use something from them without including them (e.g., libCellML uses std::strtod() without including # and libSBML uses std::nothrow without including ), so we force their inclusion. list(APPEND CMAKE_ARGS diff --git a/src/api/libopencor/file.h b/src/api/libopencor/file.h index a1a404a0f..41620dd6c 100644 --- a/src/api/libopencor/file.h +++ b/src/api/libopencor/file.h @@ -43,8 +43,7 @@ class LIBOPENCOR_EXPORT File: public Logger /** * @brief The type of a file. * - * The type of a file, i.e. whether it is unknown, a CellML file, a SED-ML file, an OMEX file, or - * irretrievable. + * The type of a file, i.e. whether it is unknown, a CellML file, a SED-ML file, an OMEX file, or irretrievable. */ enum class Type diff --git a/src/api/libopencor/sedinstance.h b/src/api/libopencor/sedinstance.h index fbf30a265..f88264224 100644 --- a/src/api/libopencor/sedinstance.h +++ b/src/api/libopencor/sedinstance.h @@ -122,9 +122,9 @@ class LIBOPENCOR_EXPORT SedInstance: public Logger /** * @brief Start running, in a background thread, all the tasks associated with this instance. * - * Start running, in a background thread, all the tasks associated with this instance. The results of the tasks - * are (re)allocated before this method returns, so they can be retrieved while the tasks are being run (e.g., to - * plot them progressively). The simulation settings and model changes used are those in effect when this method is + * Start running, in a background thread, all the tasks associated with this instance. The results of the tasks are + * (re)allocated before this method returns, so they can be retrieved while the tasks are being run (e.g., to plot + * them progressively). The simulation settings and model changes used are those in effect when this method is * called. * * Note: in a Web browser, this method can only be used if the page is cross-origin isolated (i.e. served with the diff --git a/src/api/libopencor/seduniformtimecourse.h b/src/api/libopencor/seduniformtimecourse.h index be9c9579c..6bbcf3f2f 100644 --- a/src/api/libopencor/seduniformtimecourse.h +++ b/src/api/libopencor/seduniformtimecourse.h @@ -55,8 +55,7 @@ class LIBOPENCOR_EXPORT SedUniformTimeCourse: public SedSimulation * auto simulation {libOpenCOR::SedUniformTimeCourse::create(document)}; * ``` * - * @param pDocument The @ref SedDocument object to which the @ref SedUniformTimeCourse object is to - * belong. + * @param pDocument The @ref SedDocument object to which the @ref SedUniformTimeCourse object is to belong. * * @return A smart pointer to a @ref SedUniformTimeCourse object. */ diff --git a/src/api/libopencor/version.h b/src/api/libopencor/version.h index a8c274b8a..670d5f5ee 100644 --- a/src/api/libopencor/version.h +++ b/src/api/libopencor/version.h @@ -91,9 +91,9 @@ const std::string LIBOPENCOR_EXPORT &libcombineVersionString(); unsigned int LIBOPENCOR_EXPORT libcurlVersion(); /** - * Return the version of libcurl as a string. The version string is in the format x.y.z, where the "."s are literal, - * and x, y, and z represent counting numbers, in which case x is the major version, y the minor version, and z the - * patch level. + * Return the version of libcurl as a string. The version string is in the format x.y.z, where the "."s are literal, and + * x, y, and z represent counting numbers, in which case x is the major version, y the minor version, and z the patch + * level. * * @return A string that represents the version of libcurl. */ @@ -128,8 +128,8 @@ const std::string LIBOPENCOR_EXPORT &libsedmlVersionString(); unsigned int LIBOPENCOR_EXPORT llvmVersion(); /** - * Return the version of LLVM as a string. The version string is in the format x.y.z, where the "."s are literal, and - * x, y, and z represent counting numbers, in which case x is the major version, y the minor version, and z the patch + * Return the version of LLVM as a string. The version string is in the format x.y.z, where the "."s are literal, and x, + * y, and z represent counting numbers, in which case x is the major version, y the minor version, and z the patch * level. * * @return A string that represents the version of LLVM. diff --git a/src/bindings/javascript/CMakeLists.txt b/src/bindings/javascript/CMakeLists.txt index 16fb49bdd..dce4bda17 100644 --- a/src/bindings/javascript/CMakeLists.txt +++ b/src/bindings/javascript/CMakeLists.txt @@ -68,9 +68,8 @@ if(EMSCRIPTEN OR LIBOPENCOR_JAVASCRIPT_BINDINGS) # supported by all major browsers (and by Node.js). Indeed, Emscripten otherwise aborts on any C++ # exception, even one that would be caught. This means that something that works natively would abort # in our WASM version (e.g., libCellML handles a units prefix that is out of the integer range by - # catching the std::out_of_range exception thrown by std::stoi()). Unlike Emscripten's - # JavaScript-based exception handling, WebAssembly exception handling has no runtime cost when no - # exception is thrown. + # catching the std::out_of_range exception thrown by std::stoi()). Unlike Emscripten's JavaScript-based + # exception handling, WebAssembly exception handling has no runtime cost when no exception is thrown. # Note #3: the linker flags also allow the WebAssembly table to grow (-sALLOW_TABLE_GROWTH), which we need to # install the functions of the WebAssembly modules that we generate for our models (see # initialiseWorkerWasmJS()). diff --git a/src/bindings/javascript/file.cpp b/src/bindings/javascript/file.cpp index 33514f726..a7a7a12f8 100644 --- a/src/bindings/javascript/file.cpp +++ b/src/bindings/javascript/file.cpp @@ -47,8 +47,8 @@ void fileApi() // Note: we avoid using emscripten::typed_memory_view() as an intermediate step since it creates a // JavaScript's TypedArray view directly backed by wasmMemory.buffer. This is fragile since our memory - // can grow (see src/CMakeLists.txt). By performing the copy entirely within a single EM_ASM() - // block, HEAPU8 is fetched and used atomically. + // can grow (see src/CMakeLists.txt). By performing the copy entirely within a single EM_ASM() block, + // HEAPU8 is fetched and used atomically. return emscripten::val::take_ownership(static_cast(EM_ASM_PTR({ let jsArray = new Uint8Array(HEAPU8.subarray($0, $0 + $1)); diff --git a/src/bindings/javascript/postprocess.dts.mjs b/src/bindings/javascript/postprocess.dts.mjs index 60b6694c0..0b71426fb 100644 --- a/src/bindings/javascript/postprocess.dts.mjs +++ b/src/bindings/javascript/postprocess.dts.mjs @@ -35,8 +35,8 @@ function findMatchingClosingBrace(text, start) { return -1; } -// Normalise an interface declaration by adding 2 extra spaces of indentation to every non-empty line in the body -// and re-indenting the closing brace by 2 spaces. +// Normalise an interface declaration by adding 2 extra spaces of indentation to every non-empty line in the body and +// re-indenting the closing brace by 2 spaces. function normaliseInterfaceDeclaration(interfaceDeclaration) { const openingBraceIndex = interfaceDeclaration.indexOf('{'); diff --git a/src/bindings/python/glibc_strtol.cpp b/src/bindings/python/glibc_strtol.cpp index c305765d6..f1df361b7 100644 --- a/src/bindings/python/glibc_strtol.cpp +++ b/src/bindings/python/glibc_strtol.cpp @@ -31,8 +31,8 @@ limitations under the License. // #define strtoll __isoc23_strtoll // #define strtoul __isoc23_strtoul // #define strtoull __isoc23_strtoull -// which would macro-expand both our forward declarations and the return strtol() calls inside our wrappers, making -// them recursive. On ARM, glibc instead uses __asm__("__isoc23_strtol") on the declarations in , which would +// which would macro-expand both our forward declarations and the return strtol() calls inside our wrappers, making them +// recursive. On ARM, glibc instead uses __asm__("__isoc23_strtol") on the declarations in , which would // conflict with our own forward declarations (different asm labels on the same symbol). Either way, omitting // entirely avoids both problems while still allowing us to forward-declare the real symbols. diff --git a/src/bindings/python/stringcaster.h b/src/bindings/python/stringcaster.h index 8a8ac29a9..3412010f1 100644 --- a/src/bindings/python/stringcaster.h +++ b/src/bindings/python/stringcaster.h @@ -24,8 +24,8 @@ limitations under the License. // included by all our Python bindings source files that need to convert an std::string). // Note: a std::string may not be valid UTF-8 (e.g., the URL "https://example.com/%FF" gets percent-decoded to // "https://example.com/\xFF"), in which case nanobind's type caster would raise a UnicodeDecodeError. So, like -// Python does for file names (see os.fsdecode() and os.fsencode()), we use the "surrogateescape" error handler -// to map an invalid byte to a lone surrogate (e.g., 0xFF to U+DCFF) and back, meaning that a string can always be +// Python does for file names (see os.fsdecode() and os.fsencode()), we use the "surrogateescape" error handler to +// map an invalid byte to a lone surrogate (e.g., 0xFF to U+DCFF) and back, meaning that a string can always be // retrieved from libOpenCOR and given back to it without being altered. A string with any other lone surrogate // (e.g., U+D800) cannot be encoded, so it is rejected (i.e. a TypeError is raised) rather than silently altered. diff --git a/src/file/file.cpp b/src/file/file.cpp index 69940649f..e26729e13 100644 --- a/src/file/file.cpp +++ b/src/file/file.cpp @@ -91,9 +91,9 @@ File::Impl::~Impl() void File::Impl::checkType(const FilePtr &pOwner, bool pResetType) { // Reset the type of the file, if needed. - // Note: we also release our previous CellML file, SED-ML file, or OMEX file, if any, so that we don't keep - // using it (and, for an OMEX file, keep its child files managed) if our new contents are of a different - // type or are not recognised. + // Note: we also release our previous CellML file, SED-ML file, or OMEX file, if any, so that we don't keep using it + // (and, for an OMEX file, keep its child files managed) if our new contents are of a different type or are + // not recognised. if (pResetType) { removeAllIssues(); diff --git a/src/misc/compiler.cpp b/src/misc/compiler.cpp index 48be97c24..3a61c2dcd 100644 --- a/src/misc/compiler.cpp +++ b/src/misc/compiler.cpp @@ -345,8 +345,8 @@ std::string patchWasmSharedMemory(UnsignedChars &pWasmModule) // since it depends on -sMAXIMUM_MEMORY, etc. (see src/CMakeLists.txt). // Note: LLVM currently emits a 32-bit, non-shared memory import without a maximum size (i.e. flags // 0x00), but we handle a memory import with a maximum size (i.e. flags 0x01) and/or that is - // already shared (i.e. flags 0x03) in case a future version of LLVM does so. Any other - // flags (e.g., a 64-bit memory) are not supported. + // already shared (i.e. flags 0x03) in case a future version of LLVM does so. Any other flags + // (e.g., a 64-bit memory) are not supported. if (pos < sectionEnd) { static constexpr unsigned char HAS_MAXIMUM {0x01}; diff --git a/src/misc/irgenerator.cpp b/src/misc/irgenerator.cpp index 8fb6a8ee5..3e897d618 100644 --- a/src/misc/irgenerator.cpp +++ b/src/misc/irgenerator.cpp @@ -2015,8 +2015,7 @@ class Parser LLVM_ATTRIBUTE_NOINLINE ExprPtr newCall(const Token &pToken, ExprPtr pCallee, std::vector &pArgs) { - // Retrieve the type of the function that is being called (a function having been converted to a pointer to - // it). + // Retrieve the type of the function that is being called (a function having been converted to a pointer to it). auto callee {rvalue(std::move(pCallee))}; const auto *type {callee->type}; @@ -2318,8 +2317,8 @@ class CodeGenerator llvm::MDNode *tbaaAnyPointer(size_t pDepth) { - // The "any" pointer type nodes, i.e. "any pointer", "any p2 pointer", "any p3 pointer", etc., each of which - // has the previous one as its parent. + // The "any" pointer type nodes, i.e. "any pointer", "any p2 pointer", "any p3 pointer", etc., each of which has + // the previous one as its parent. while (mTbaaAnyPointers.size() < pDepth) { mTbaaAnyPointers.push_back(mTbaaAnyPointers.empty() ? @@ -2578,8 +2577,8 @@ class CodeGenerator store(arg, param->value, variableAlignment(param->type), tbaaScalarAccessTag(param->type)); } - // Generate the code for our statements, up to the first return statement (as Clang does since any code after - // it is unreachable). + // Generate the code for our statements, up to the first return statement (as Clang does since any code after it + // is unreachable). for (const auto &stmt : pFunction.body) { generateStatement(*stmt); @@ -3092,9 +3091,9 @@ class CodeGenerator llvm::Value *generateFMulAdd(llvm::Value *pLhs, llvm::Value *pRhs, bool pIsSub) { - // Contract a multiplication followed by an addition or a subtraction into a fmuladd() call, as Clang does - // with -ffp-contract=on, i.e. when the multiplication is one of the operands of the addition/subtraction, - // possibly through a negation, and the result of the multiplication is not used for anything else. + // Contract a multiplication followed by an addition or a subtraction into a fmuladd() call, as Clang does with + // -ffp-contract=on, i.e. when the multiplication is one of the operands of the addition/subtraction, possibly + // through a negation, and the result of the multiplication is not used for anything else. auto multiplication = [](llvm::Value *pValue, bool &pNegated) -> llvm::BinaryOperator * { auto *unaryOperator {llvm::dyn_cast(pValue)}; diff --git a/src/misc/utils.cpp b/src/misc/utils.cpp index 0e432d091..fc42ae37e 100644 --- a/src/misc/utils.cpp +++ b/src/misc/utils.cpp @@ -1039,8 +1039,8 @@ std::optional resolveUriReference(const FileLocation &pFileLocation // URL nor a "file" URL, which path is decoded by retrieveFileInfo()) then we must decode the URI reference // to get the corresponding file name. We must, however, do this after having checked whether the URI // reference is relative since a percent-encoded forward slash (i.e. "%2F") must not make a relative URI - // reference absolute. If the file is a remote file then a relative URI reference is decoded as part of - // the resolved URL (see retrieveFileInfo()). + // reference absolute. If the file is a remote file then a relative URI reference is decoded as part of the + // resolved URL (see retrieveFileInfo()). // Note #3: if the file is a remote file then a URI reference that is a file name is never a local file name, but a // reference that is relative to the URL of the file, i.e. a network-path reference (e.g., // "//example.org/models/model.cellml") is relative to its scheme, an absolute-path reference (e.g., @@ -1119,8 +1119,8 @@ void getTimeOfDay(TimeVal &pTimeVal) std::filesystem::path uniqueFilePath() { // This is based off glibc's __gen_tempname() method, which is used in std::tmpfile(). The only reason we don't use - // std::tmpfile() is that it creates the file for us and as soon as we would be closing (though an automatic call - // to std::fclose()), the file would get automatically deleted, which is not what we want. See + // std::tmpfile() is that it creates the file for us and as soon as we would be closing (though an automatic call to + // std::fclose()), the file would get automatically deleted, which is not what we want. See // https://code.woboq.org/userspace/glibc/sysdeps/posix/tempname.c.html#__gen_tempname. // The number of times to attempt to generate a temporary file name. @@ -1227,8 +1227,8 @@ std::tuple downloadFile(const std::string &pUrl) // Create a file with a unique file path. // Note: we must generate the file path and create the file in one go, so that another thread cannot generate the - // same file path in between (in which case both threads would download to the same file and the local copy - // of one remote file would get deleted with the other remote file). + // same file path in between (in which case both threads would download to the same file and the local copy of + // one remote file would get deleted with the other remote file). static std::mutex uniqueFilePathMutex; @@ -1519,8 +1519,8 @@ std::optional parseDouble(const std::string &pString) // Note #2: strtod() uses the decimal point of the current C locale (e.g., a comma in a French locale, in which case // "1.5" would be parsed as 1), so we use the C locale instead. We don't use std::from_chars() since it is // not available for floating-point numbers before macOS 26 nor an input string stream since its handling - // of a value that underflows depends on the C++ standard library (e.g., libc++ considers that "1e-400" - // is not a valid double value while libstdc++ considers that it is). + // of a value that underflows depends on the C++ standard library (e.g., libc++ considers that "1e-400" is + // not a valid double value while libstdc++ considers that it is). if (!isDecimalNumber(pString)) { return {}; @@ -1610,8 +1610,8 @@ bool isCombineSpecificationsFormat(const std::string &pFormat, std::initializer_ // Check whether the given format is one of the given COMBINE specifications (e.g., "cellml.2.0" for // "http://identifiers.org/combine.specifications/cellml.2.0"). // Note: identifiers.org can be accessed using either the "http" or the "https" scheme, and both are used in OMEX - // files (e.g., "https://identifiers.org/combine.specifications/sed-ml.level-1.version-2" is used by some - // OMEX files on BioModels). + // files (e.g., "https://identifiers.org/combine.specifications/sed-ml.level-1.version-2" is used by some OMEX + // files on BioModels). static constexpr std::string_view HTTP_COMBINE_SPECIFICATIONS {"http://identifiers.org/combine.specifications/"}; static constexpr std::string_view HTTPS_COMBINE_SPECIFICATIONS {"https://identifiers.org/combine.specifications/"}; @@ -1633,8 +1633,8 @@ bool isCombineSpecificationsFormat(const std::string &pFormat, std::initializer_ bool isCellmlFormat(const std::string &pFormat) { - // Check whether the given format is the CellML format of an OMEX file entry, i.e. one of the CellML - // specifications listed in the COMBINE specifications registry (see + // Check whether the given format is the CellML format of an OMEX file entry, i.e. one of the CellML specifications + // listed in the COMBINE specifications registry (see // https://github.com/combine-org/combine-specifications/tree/main/specifications). return isCombineSpecificationsFormat(pFormat, {"cellml", "cellml.1", "cellml.1.0", "cellml.1.1", "cellml.2.0"}); @@ -1642,8 +1642,8 @@ bool isCellmlFormat(const std::string &pFormat) bool isSedmlFormat(const std::string &pFormat) { - // Check whether the given format is the SED-ML format of an OMEX file entry, i.e. one of the SED-ML - // specifications listed in the COMBINE specifications registry (see + // Check whether the given format is the SED-ML format of an OMEX file entry, i.e. one of the SED-ML specifications + // listed in the COMBINE specifications registry (see // https://github.com/combine-org/combine-specifications/tree/main/specifications). return isCombineSpecificationsFormat(pFormat, {"sed-ml", "sed-ml.level-1", "sed-ml.level-1.version-1", diff --git a/src/sed/sedinstance.cpp b/src/sed/sedinstance.cpp index 1c89a92e6..d6007c04f 100644 --- a/src/sed/sedinstance.cpp +++ b/src/sed/sedinstance.cpp @@ -171,11 +171,11 @@ void SedInstance::Impl::prepareRun() // (re)allocated before our tasks get run, so that they can be safely retrieved while our tasks are being run. // Reset ourselves by restoring the issues of all the tasks. - // Note: the clearing of mIssues, mErrors, and mWarnings could be done using removeAllIssues(), but this would - // result in transiently-empty issues, which could be seen by a reader. So, instead, we just clear and restore - // the issues in one go. - // Note: the issue counts are published with std::memory_order_release so that readers using - // std::memory_order_acquire never see an updated count before the corresponding issue vectors are visible. + // Note #1: the clearing of mIssues, mErrors, and mWarnings could be done using removeAllIssues(), but this would + // result in transiently-empty issues, which could be seen by a reader. So, instead, we just clear and + // restore the issues in one go. + // Note #2: the issue counts are published with std::memory_order_release so that readers using + // std::memory_order_acquire never see an updated count before the corresponding issue vectors are visible. { const std::scoped_lock lock(mMutex); diff --git a/src/sed/sedinstancetask.cpp b/src/sed/sedinstancetask.cpp index acfcb64e9..39d441eb0 100644 --- a/src/sed/sedinstancetask.cpp +++ b/src/sed/sedinstancetask.cpp @@ -687,10 +687,10 @@ void SedInstanceTask::Impl::run(double pVoiStart, double pVoiEnd, double pVoiInt // Wait for our delay, if any, before tracking our results, so that they get tracked at a steady rate (see // waitForDelay()). // Note: if our previous output point was not subject to a delay (i.e. a delay was set while we were running - // without one), then the time of our previous output point is not known (since we don't keep track - // of it when there is no delay, so that running without a delay doesn't involve getting the current - // time for each output point). So, our current output point is made available straight away and our - // delay only applies from it. + // without one), then the time of our previous output point is not known (since we don't keep track of + // it when there is no delay, so that running without a delay doesn't involve getting the current time + // for each output point). So, our current output point is made available straight away and our delay + // only applies from it. if (mDelay->load(std::memory_order_relaxed) != 0) { if (!delayed) { @@ -723,8 +723,8 @@ bool SedInstanceTask::Impl::prepareRun() // Note: we are called from the thread that runs us or that starts running us (see SedInstance::Impl::prepareRun()), // i.e. before we actually get run. This means that our results are (re)allocated before we get run, so that // they can be safely retrieved while we are being run (e.g., to plot them progressively). This also means - // that our simulation settings and model changes are those that were in effect when we were asked to be - // run, even if they get changed while we are being run. + // that our simulation settings and model changes are those that were in effect when we were asked to be run, + // even if they get changed while we are being run. // Reset our progress counters. diff --git a/src/sed/seduniformtimecourse.cpp b/src/sed/seduniformtimecourse.cpp index 9e834e8db..c92b30831 100644 --- a/src/sed/seduniformtimecourse.cpp +++ b/src/sed/seduniformtimecourse.cpp @@ -34,9 +34,9 @@ Strings SedUniformTimeCourse::Impl::validationErrors(const SedModelPtr &pModel) { // Make sure that our times are finite and such that initialTime <= outputStartTime < outputEndTime, and that our // number of steps is strictly positive. - // Note: we are validated both when instantiating a document (see SedSimulation::Impl::isValid()) and when - // preparing an instance task to be run (see SedInstanceTask::Impl::prepareRun()) since our times and number - // of steps may have been changed in between. + // Note: we are validated both when instantiating a document (see SedSimulation::Impl::isValid()) and when preparing + // an instance task to be run (see SedInstanceTask::Impl::prepareRun()) since our times and number of steps + // may have been changed in between. const auto &modelId = pModel->id(); Strings res; diff --git a/src/solver/solverkinsol.cpp b/src/solver/solverkinsol.cpp index fd5818ad5..2c764d597 100644 --- a/src/solver/solverkinsol.cpp +++ b/src/solver/solverkinsol.cpp @@ -520,10 +520,10 @@ bool SolverKinsol::Impl::solve(ComputeObjectiveFunction pComputeObjectiveFunctio // Check whether everything went fine. // Note: KINSOL may return a positive value, i.e. KIN_INITIAL_GUESS_OK (our initial guess is a solution) or // KIN_STEP_LT_STPTOL (the last Newton step was too small to make any further progress). We consider the - // latter to be a success too since it typically means that our solution is as accurate as it can be in - // double precision, but that our NLA system is so badly scaled (e.g., because of a large rate constant) - // that its residual is above KINSOL's tolerance. Should KINSOL make no progress away from a solution, then it - // would instead return KIN_LINESEARCH_NONCONV, KIN_MAXITER_REACHED, etc. + // latter to be a success too since it typically means that our solution is as accurate as it can be in double + // precision, but that our NLA system is so badly scaled (e.g., because of a large rate constant) that its + // residual is above KINSOL's tolerance. Should KINSOL make no progress away from a solution, then it would + // instead return KIN_LINESEARCH_NONCONV, KIN_MAXITER_REACHED, etc. if (res < KIN_SUCCESS) { if (userData.infOrNanFound) { diff --git a/src/support/cellml/cellmlfile.cpp b/src/support/cellml/cellmlfile.cpp index 4c156c743..b2fdd89ac 100644 --- a/src/support/cellml/cellmlfile.cpp +++ b/src/support/cellml/cellmlfile.cpp @@ -233,14 +233,14 @@ void populateImporterLibrary(const libcellml::ImporterPtr &pImporter, const libc // Populate the library of the given importer with the models that are (directly or indirectly) imported by the // given model. // Note #1: libCellML can only resolve imports that are local files. So, we retrieve the imported models ourselves - // (be they local files, remote files, files in an OMEX file, or files which contents were set in - // memory) and add them to the library of its importer, which is what libCellML looks up before trying to - // open a file. + // (be they local files, remote files, files in an OMEX file, or files which contents were set in memory) + // and add them to the library of its importer, which is what libCellML looks up before trying to open a + // file. // Note #2: libCellML looks up an imported model using its URL as is or, if there is no such key, using the URL // prefixed with a base path. The base path for the imports of the given model is the location of its file // (which is either empty or ends with a directory separator) while the base path for the imports of an - // imported model is the base path of its importing model followed by the path (i.e. up to the last - // forward slash) of its URL. + // imported model is the base path of its importing model followed by the path (i.e. up to the last forward + // slash) of its URL. // Note #3: we keep track of the files that lead to an imported model, so that we don't end up in an infinite loop // in the case of an import cycle (which libCellML will report). // Note #4: if we cannot retrieve an imported model, or if it is not valid XML, then we simply don't add it to the @@ -269,8 +269,8 @@ void populateImporterLibrary(const libcellml::ImporterPtr &pImporter, const libc continue; } - // Resolve the URL against the location of the importing model, skipping it if it cannot be retrieved, - // e.g., if it has an unsupported scheme. + // Resolve the URL against the location of the importing model, skipping it if it cannot be retrieved, e.g., + // if it has an unsupported scheme. auto resolvedUrl {resolveUriReference(importingModel.location, url)}; diff --git a/src/support/cellml/cellmlfileruntime.cpp b/src/support/cellml/cellmlfileruntime.cpp index 5b6880b8d..1e65d109b 100644 --- a/src/support/cellml/cellmlfileruntime.cpp +++ b/src/support/cellml/cellmlfileruntime.cpp @@ -90,8 +90,8 @@ CellmlFileRuntime::Impl::Impl(const CellmlFilePtr &pCellmlFile, const SolverNlaP // Restrict-qualify the pointer parameters of computeRates() and computeVariables() since they never point to // the same array (i.e. our ODE solvers and SedInstanceTask never pass the same array twice), something that - // allows LLVM to optimise our code further (e.g., by not reloading the value of a state after having computed - // a rate). + // allows LLVM to optimise our code further (e.g., by not reloading the value of a state after having computed a + // rate). if (differentialModel) { generatorProfile->setImplementationComputeRatesMethodString(WITH_EXTERNAL_VARIABLES, @@ -370,9 +370,9 @@ CellmlFileRuntime::Impl::~Impl() // task (e.g., at the start of each run), and it is removed from that cache once its runtime has been deleted. If some // table slots have already been allocated in that table, then reuse them rather than grow the table again, which would // otherwise both grow the table unboundedly and keep previously created WebAssembly instances alive forever. -// Note: we keep track of our table slots using the table itself rather than the current thread since a table belongs -// to a JavaScript worker, which is reused by different threads over time (e.g., each asynchronous run is done in -// a new thread, but most likely by the same worker). +// Note: we keep track of our table slots using the table itself rather than the current thread since a table belongs to +// a JavaScript worker, which is reused by different threads over time (e.g., each asynchronous run is done in a +// new thread, but most likely by the same worker). // clang-format off EM_JS(int, initialiseWorkerWasmJS, (int wasmModuleId, const void* wasmBytesPtr, size_t wasmBytesSize, diff --git a/src/support/omex/omexfile.cpp b/src/support/omex/omexfile.cpp index 741916626..5298f7ee7 100644 --- a/src/support/omex/omexfile.cpp +++ b/src/support/omex/omexfile.cpp @@ -35,12 +35,12 @@ std::string archiveLocation(const FilePtr &pFile) { // Determine the location of the OMEX file, i.e. the location where its files are "virtually" extracted (e.g., // "/some/path/archive.omex.contents/"). - // Note #1: the files of an OMEX file are managed by the file manager using their file name, so each OMEX file - // must have its own location. This means that a remote OMEX file that has no local copy (i.e. it was not + // Note #1: the files of an OMEX file are managed by the file manager using their file name, so each OMEX file must + // have its own location. This means that a remote OMEX file that has no local copy (i.e. it was not // downloaded), and therefore no file name, must use a virtual file name that is unique to it. // Note #2: we canonicalise the location since the files of the OMEX file have a canonical file name (see - // File::create()), which we need to be able to compare against (see OmexFile::Impl::file()). For - // instance, the temporary directory on macOS is a symbolic link (i.e. "/var/..." vs. "/private/var/..."). + // File::create()), which we need to be able to compare against (see OmexFile::Impl::file()). For instance, + // the temporary directory on macOS is a symbolic link (i.e. "/var/..." vs. "/private/var/..."). static std::atomic virtualFileNameCounter {0}; @@ -86,15 +86,14 @@ OmexFile::Impl::Impl(const FilePtr &pFile, libcombine::CombineArchive *pArchive, // percent-encoded (e.g., "my%20file.cellml"). Since mArchiveLocation is a local file name, we must // decode the location to get the file name of the file. // Note #2: a location may have some ".." segments (e.g., "../file.cellml"), possibly percent-encoded (e.g., - // "%2E%2E/file.cellml"), in which case the file would be located outside of the OMEX file. It - // could then be confused with another managed file (which contents would get replaced) or even with - // the OMEX file itself (resulting in an infinite recursion), so we ignore such a file. To - // determine where the file is located, we use its file name as determined by File::create(). + // "%2E%2E/file.cellml"), in which case the file would be located outside of the OMEX file. It could + // then be confused with another managed file (which contents would get replaced) or even with the OMEX + // file itself (resulting in an infinite recursion), so we ignore such a file. To determine where the + // file is located, we use its file name as determined by File::create(). // Note #3: the file name of a file that is located within the OMEX file has no ".." component after the - // location of the OMEX file, unless it follows a symbolic link (see canonicalFileName()), in - // which case the file may be located outside of the OMEX file (e.g., - // "archive.omex.contents/../file.cellml" if "archive.omex.contents" is a symbolic link), so we also - // ignore such a file. + // location of the OMEX file, unless it follows a symbolic link (see canonicalFileName()), in which + // case the file may be located outside of the OMEX file (e.g., "archive.omex.contents/../file.cellml" + // if "archive.omex.contents" is a symbolic link), so we also ignore such a file. auto decodedLocation {decodeUrl(location)}; auto fileNameOrUrl {mArchiveLocation + decodedLocation}; @@ -124,9 +123,9 @@ OmexFile::Impl::Impl(const FilePtr &pFile, libcombine::CombineArchive *pArchive, } // Skip a location that refers to the OMEX file itself. - // Note: libCOMBINE skips the "." location, which is how an OMEX file normally refers to itself, but not - // the other locations that refer to it (e.g., "./" or "/"), which would otherwise result in a file for - // the directory in which we extract the OMEX file. + // Note: libCOMBINE skips the "." location, which is how an OMEX file normally refers to itself, but not the + // other locations that refer to it (e.g., "./" or "/"), which would otherwise result in a file for the + // directory in which we extract the OMEX file. if (fileName == mArchiveLocation) { continue; @@ -134,11 +133,11 @@ OmexFile::Impl::Impl(const FilePtr &pFile, libcombine::CombineArchive *pArchive, // Make sure that the file is not the same as a file that we have already extracted. // Note: different locations may refer to the same file (e.g., "./my%20file.cellml" and "./my file.cellml", or - // "./file.cellml" and "file.cellml"). This is an ambiguity in the OMEX file itself, so we keep the - // first file and ignore the other ones (File::create() would otherwise return the same file, which - // contents would get replaced and which would be counted several times). We do, however, honour the - // master attribute of an ignored entry since it still refers to the file that we kept, and we keep track - // of its location so that it can still be used to retrieve that file (see file()). + // "./file.cellml" and "file.cellml"). This is an ambiguity in the OMEX file itself, so we keep the first + // file and ignore the other ones (File::create() would otherwise return the same file, which contents + // would get replaced and which would be counted several times). We do, however, honour the master + // attribute of an ignored entry since it still refers to the file that we kept, and we keep track of its + // location so that it can still be used to retrieve that file (see file()). if (auto fileIndex {fileIndexes.find(fileName)}; fileIndex != fileIndexes.end()) { const auto &fileLocation {mFileNames[fileIndex->second]}; @@ -373,9 +372,9 @@ OmexFilePtr OmexFile::create(const FilePtr &pFile) } // Try to retrieve an OMEX file. - // Note: an OMEX file is a ZIP file, so we make sure that it starts with 0x04034b50, which is the magic number - // used by a ZIP file (we ignore empty and spanned ZIP files). Indeed, libCOMBINE may crash depending on the - // file contents that is given to it. + // Note: an OMEX file is a ZIP file, so we make sure that it starts with 0x04034b50, which is the magic number used + // by a ZIP file (we ignore empty and spanned ZIP files). Indeed, libCOMBINE may crash depending on the file + // contents that is given to it. static const auto LS8 {8U}; static const auto LS16 {16U}; diff --git a/src/support/sedml/sedmlfile.cpp b/src/support/sedml/sedmlfile.cpp index d685a54e6..187447b02 100644 --- a/src/support/sedml/sedmlfile.cpp +++ b/src/support/sedml/sedmlfile.cpp @@ -726,10 +726,9 @@ SedmlFilePtr SedmlFile::create(const FilePtr &pFile) auto *document {libsedml::readSedMLFromString(toString(pFile->contents()).c_str())}; // A non-SED-ML file results in our SED-ML document having at least one error. That error may be the result of a - // malformed XML file (e.g., an HTML file is an XML-like file but not actually an XML file or an OMEX file - // which is just not an XML file) or a valid XML file but not a SED-ML file (e.g., a CellML file is an XML file but - // not a SED-ML file). So, we use these facts to determine whether our current SED-ML document is indeed a SED-ML - // file. + // malformed XML file (e.g., an HTML file is an XML-like file but not actually an XML file or an OMEX file which is + // just not an XML file) or a valid XML file but not a SED-ML file (e.g., a CellML file is an XML file but not a + // SED-ML file). So, we use these facts to determine whether our current SED-ML document is indeed a SED-ML file. if ((document->getNumErrors() == 0) || ((document->getError(0)->getErrorId() > libsbml::XMLErrorCodesUpperBound) diff --git a/tests/api/file/childtests.cpp b/tests/api/file/childtests.cpp index 2b019e0f3..33ef0cf06 100644 --- a/tests/api/file/childtests.cpp +++ b/tests/api/file/childtests.cpp @@ -99,9 +99,9 @@ TEST(ChildFileTest, remoteVirtualOmexFiles) TEST(ChildFileTest, remoteOmexFile) { - // The child files of a remote OMEX file must be retrievable using their file name, even if the local copy of - // the OMEX file is in a directory that is accessed through a symbolic link (e.g., on macOS, the temporary - // directory is "/var/...", which is a symbolic link to "/private/var/..."). + // The child files of a remote OMEX file must be retrievable using their file name, even if the local copy of the + // OMEX file is in a directory that is accessed through a symbolic link (e.g., on macOS, the temporary directory is + // "/var/...", which is a symbolic link to "/private/var/..."). // Note: this has no JavaScript equivalent since our JavaScript bindings never retrieve the contents of a file, so a // remote file is never downloaded. @@ -131,9 +131,9 @@ TEST(ChildFileTest, omexFileReplacedWithOtherContents) TEST(ChildFileTest, omexFileWithFilesOutsideOfIt) { - // An OMEX file may reference files that are located outside of it (e.g., "../sibling.cellml" or even the - // OMEX file itself), in which case they must be ignored rather than replace the contents of another managed - // file (or result in an infinite recursion). + // An OMEX file may reference files that are located outside of it (e.g., "../sibling.cellml" or even the OMEX file + // itself), in which case they must be ignored rather than replace the contents of another managed file (or result + // in an infinite recursion). static const libOpenCOR::ExpectedIssues EXPECTED_ISSUES {{ {libOpenCOR::Issue::Type::WARNING, "OMEX file: the file '../sibling.cellml' is not located within the OMEX file. It has been ignored."}, @@ -159,10 +159,10 @@ TEST(ChildFileTest, omexFileWithFilesOutsideOfIt) #ifndef BUILDING_ON_WINDOWS TEST(ChildFileTest, omexFileWithFilesOutsideOfItThroughSymbolicLink) { - // The files of an OMEX file are located in a directory which name is that of the OMEX file followed by - // ".contents". If such a directory happens to exist and to be a symbolic link then the ".." components that follow - // it are kept (see canonicalFileName()), but the files they refer to are still located outside of the OMEX - // file, so they must still be ignored. + // The files of an OMEX file are located in a directory which name is that of the OMEX file followed by ".contents". + // If such a directory happens to exist and to be a symbolic link then the ".." components that follow it are kept + // (see canonicalFileName()), but the files they refer to are still located outside of the OMEX file, so they must + // still be ignored. // Note: a symbolic link usually requires some special privileges on Windows. static const libOpenCOR::ExpectedIssues EXPECTED_ISSUES {{ @@ -302,8 +302,7 @@ TEST(ChildFileTest, omexFileWithDuplicateLocations) TEST(ChildFileTest, omexFileWithSelfReferencingLocations) { - // Locations that refer to the OMEX file itself (e.g., ".", "./", or "/") are not child files of the OMEX - // file. + // Locations that refer to the OMEX file itself (e.g., ".", "./", or "/") are not child files of the OMEX file. auto file {libOpenCOR::File::create(libOpenCOR::resourcePath("api/file/self_referencing_locations.omex"))}; diff --git a/tests/api/sed/basictests.cpp b/tests/api/sed/basictests.cpp index d129c882c..59fe48a9a 100644 --- a/tests/api/sed/basictests.cpp +++ b/tests/api/sed/basictests.cpp @@ -127,8 +127,8 @@ TEST(BasicSedTest, sedmlFileWithRelativeCellmlFile) TEST(BasicSedTest, sedmlFileWithRelativeCellmlFileInWorkingDirectory) { - // A relative model source is relative to the SED-ML file, not to the current working directory, even if the - // current working directory contains a file with that name. + // A relative model source is relative to the SED-ML file, not to the current working directory, even if the current + // working directory contains a file with that name. auto origDir {std::filesystem::current_path()}; diff --git a/tests/api/sed/instancetests.cpp b/tests/api/sed/instancetests.cpp index 7ea9ef72d..c3522aad0 100644 --- a/tests/api/sed/instancetests.cpp +++ b/tests/api/sed/instancetests.cpp @@ -610,9 +610,9 @@ TEST(InstanceSedTest, stopRunBeforeOutputStartTime) EXPECT_FALSE(std::isnan(voi[0])); - // Start our run and stop it before it reaches the output start time, which means that we have no results to - // report. Our results should therefore not have been reallocated (since their size has not changed), but they - // should all be NaN values. + // Start our run and stop it before it reaches the output start time, which means that we have no results to report. + // Our results should therefore not have been reallocated (since their size has not changed), but they should all be + // NaN values. simulation->setOutputStartTime(OUTPUT_START_TIME); simulation->setOutputEndTime(OUTPUT_START_TIME + static_cast(simulation->numberOfSteps())); diff --git a/tests/api/sed/serialisetests.cpp b/tests/api/sed/serialisetests.cpp index 82e2739da..2e850dd9a 100644 --- a/tests/api/sed/serialisetests.cpp +++ b/tests/api/sed/serialisetests.cpp @@ -264,8 +264,8 @@ TEST(SerialiseSedTest, localCellmlFileWithQuestionMarksAndNumberSigns) #ifndef BUILDING_ON_WINDOWS TEST(SerialiseSedTest, localCellmlFileWithColon) { - // A relative model source which first segment contains a colon must be prefixed with "./" for it not to be - // mistaken for a URI with a scheme when the SED-ML file is loaded back (in which case the model would be ignored). + // A relative model source which first segment contains a colon must be prefixed with "./" for it not to be mistaken + // for a URI with a scheme when the SED-ML file is loaded back (in which case the model would be ignored). // Note: a file name cannot contain a colon on Windows. auto cellmlContents {libOpenCOR::charArrayToUnsignedChars(libOpenCOR::textFileContents(libOpenCOR::resourcePath("cellml_2.cellml")).c_str())}; @@ -456,8 +456,8 @@ TEST(SerialiseSedTest, remoteCellmlFileWithNonUtf8Character) TEST(SerialiseSedTest, remoteCellmlFileWithColon) { - // A relative model source which first segment contains a colon must be prefixed with "./" for it not to be - // mistaken for a URI with a scheme when the SED-ML file is loaded back (in which case the model would be ignored). + // A relative model source which first segment contains a colon must be prefixed with "./" for it not to be mistaken + // for a URI with a scheme when the SED-ML file is loaded back (in which case the model would be ignored). auto cellmlContents {libOpenCOR::charArrayToUnsignedChars(libOpenCOR::textFileContents(libOpenCOR::resourcePath("cellml_2.cellml")).c_str())}; auto file {libOpenCOR::File::create("https://example.com/my:model.cellml", false)}; diff --git a/tests/bindings/javascript/file.child.test.js b/tests/bindings/javascript/file.child.test.js index 12886a3ee..9c3cb88a4 100644 --- a/tests/bindings/javascript/file.child.test.js +++ b/tests/bindings/javascript/file.child.test.js @@ -129,9 +129,9 @@ test.describe('File child tests', () => { }); test('OMEX file with files outside of it', () => { - // An OMEX file may reference files that are located outside of it (e.g., "../sibling.cellml" or even the - // OMEX file itself), in which case they must be ignored rather than replace the contents of another managed - // file (or result in an infinite recursion). + // An OMEX file may reference files that are located outside of it (e.g., "../sibling.cellml" or even the OMEX file + // itself), in which case they must be ignored rather than replace the contents of another managed file (or result + // in an infinite recursion). const expectedIssues = [ [ @@ -165,10 +165,10 @@ test.describe('File child tests', () => { }); test('OMEX file with files outside of it through symbolic link', () => { - // The files of an OMEX file are located in a directory which name is that of the OMEX file followed by - // ".contents". If such a directory happens to exist and to be a symbolic link then the ".." components that follow - // it are kept (see canonicalFileName()), but the files they refer to are still located outside of the OMEX - // file, so they must still be ignored. + // The files of an OMEX file are located in a directory which name is that of the OMEX file followed by ".contents". + // If such a directory happens to exist and to be a symbolic link then the ".." components that follow it are kept + // (see canonicalFileName()), but the files they refer to are still located outside of the OMEX file, so they must + // still be ignored. // Note: our JavaScript bindings use a virtual file system, so a symbolic link is never followed (i.e. the ".." // components are normalised lexically), but the result must be the same. @@ -326,8 +326,7 @@ test.describe('File child tests', () => { }); test('OMEX file with self-referencing locations', () => { - // Locations that refer to the OMEX file itself (e.g., ".", "./", or "/") are not child files of the OMEX - // file. + // Locations that refer to the OMEX file itself (e.g., ".", "./", or "/") are not child files of the OMEX file. const file = new loc.File(utils.resourcePath('api/file/self_referencing_locations.omex')); diff --git a/tests/bindings/javascript/sed.basic.test.js b/tests/bindings/javascript/sed.basic.test.js index 334f977fd..1eced43a5 100644 --- a/tests/bindings/javascript/sed.basic.test.js +++ b/tests/bindings/javascript/sed.basic.test.js @@ -136,8 +136,8 @@ test.describe('Sed basic tests', () => { }); test('SED-ML file with relative CellML file in working directory', () => { - // A relative model source is relative to the SED-ML file, not to the current working directory, even if the - // current working directory contains a file with that name. + // A relative model source is relative to the SED-ML file, not to the current working directory, even if the current + // working directory contains a file with that name. const origDir = process.cwd(); diff --git a/tests/bindings/javascript/sed.coverage.test.js b/tests/bindings/javascript/sed.coverage.test.js index 43ef59945..96415901d 100644 --- a/tests/bindings/javascript/sed.coverage.test.js +++ b/tests/bindings/javascript/sed.coverage.test.js @@ -1031,8 +1031,8 @@ test.describe('Sed coverage tests', () => { test('KINSOL with no solution when initialising', () => { // The first NLA system of our model (a^2+x = 1) has no solution for x > 1, so if the initial value of x gets set to // 2 after our instance has been created, then our model cannot be (re)initialised when running our instance, - // whether we use a fixed-step ODE solver or CVODE. Our simulation should therefore stop there and we should have - // no results to report. + // whether we use a fixed-step ODE solver or CVODE. Our simulation should therefore stop there and we should have no + // results to report. const expectedIssues = [ [loc.Issue.Type.ERROR, "Task | KINSOL: the linear solver's setup function failed in an unrecoverable manner."] diff --git a/tests/bindings/javascript/sed.instance.test.js b/tests/bindings/javascript/sed.instance.test.js index e75781d03..b67ded403 100644 --- a/tests/bindings/javascript/sed.instance.test.js +++ b/tests/bindings/javascript/sed.instance.test.js @@ -676,9 +676,9 @@ test.describe('Sed instance tests', () => { assert.strictEqual(Number.isNaN(voi[0]), false); - // Start our run and stop it before it reaches the output start time, which means that we have no results to - // report. Our results should therefore not have been reallocated (since their size has not changed), but they - // should all be NaN values. + // Start our run and stop it before it reaches the output start time, which means that we have no results to report. + // Our results should therefore not have been reallocated (since their size has not changed), but they should all be + // NaN values. simulation.outputStartTime = OUTPUT_START_TIME; simulation.outputEndTime = OUTPUT_START_TIME + simulation.numberOfSteps; @@ -995,8 +995,8 @@ test.describe('Sed instance tests', () => { instance.delay = DELAY; - // Note #1: each output point, but our initial one, is made available at least DELAY milliseconds after the - // previous one, so our run must take at least STEP_COUNT * DELAY milliseconds. + // Note #1: each output point, but our initial one, is made available at least DELAY milliseconds after the previous + // one, so our run must take at least STEP_COUNT * DELAY milliseconds. // Note #2: the time spent waiting for our delay is not included in the elapsed time of our run. We wait for DELAY // milliseconds minus the time it takes to compute an output point, so as long as computing an output point // takes less than DELAY / 2 milliseconds, we wait for at least STEP_COUNT * DELAY / 2 milliseconds, which @@ -1381,8 +1381,8 @@ test.describe('Sed instance tests', () => { }); test('Results allocated when starting run', () => { - // Note: the results of a task must be (re)allocated before startRun() returns, so that they can be safely - // retrieved while the task is being run (e.g., to plot them progressively). + // Note: the results of a task must be (re)allocated before startRun() returns, so that they can be safely retrieved + // while the task is being run (e.g., to plot them progressively). const file = new loc.File(utils.resourcePath('cellml_2.cellml')); @@ -1441,8 +1441,8 @@ test.describe('Sed instance tests', () => { }); test('Simulation settings used when starting run', () => { - // Note: the simulation settings used by a run are those in effect when the run is started, even if they get - // changed while the run is in progress. + // Note: the simulation settings used by a run are those in effect when the run is started, even if they get changed + // while the run is in progress. const file = new loc.File(utils.resourcePath('cellml_2.cellml')); @@ -1478,8 +1478,8 @@ test.describe('Sed instance tests', () => { }); test('Model changes used when starting run', () => { - // Note: the model changes used by a run are those in effect when the run is started, even if they get changed - // while the run is in progress. + // Note: the model changes used by a run are those in effect when the run is started, even if they get changed while + // the run is in progress. const file = new loc.File(utils.resourcePath('api/sed/variables_initialised_using_variables.cellml')); diff --git a/tests/bindings/javascript/sed.serialise.test.js b/tests/bindings/javascript/sed.serialise.test.js index 4b3760d0d..f6733a9a5 100644 --- a/tests/bindings/javascript/sed.serialise.test.js +++ b/tests/bindings/javascript/sed.serialise.test.js @@ -240,8 +240,8 @@ test.describe('Sed serialise tests', () => { }); test('Local CellML file with colon', () => { - // A relative model source which first segment contains a colon must be prefixed with "./" for it not to be - // mistaken for a URI with a scheme when the SED-ML file is loaded back (in which case the model would be ignored). + // A relative model source which first segment contains a colon must be prefixed with "./" for it not to be mistaken + // for a URI with a scheme when the SED-ML file is loaded back (in which case the model would be ignored). const cellmlContents = utils.fileContents(utils.resourcePath('cellml_2.cellml')); const file = new loc.File(utils.resourcePath('my:model.cellml')); @@ -420,8 +420,8 @@ test.describe('Sed serialise tests', () => { }); test('Remote CellML file with colon', () => { - // A relative model source which first segment contains a colon must be prefixed with "./" for it not to be - // mistaken for a URI with a scheme when the SED-ML file is loaded back (in which case the model would be ignored). + // A relative model source which first segment contains a colon must be prefixed with "./" for it not to be mistaken + // for a URI with a scheme when the SED-ML file is loaded back (in which case the model would be ignored). const cellmlContents = utils.fileContents(utils.resourcePath('cellml_2.cellml')); const file = new loc.File('https://example.com/my:model.cellml'); diff --git a/tests/bindings/python/test_file_basic.py b/tests/bindings/python/test_file_basic.py index 194997de1..e8780c3fc 100644 --- a/tests/bindings/python/test_file_basic.py +++ b/tests/bindings/python/test_file_basic.py @@ -221,8 +221,8 @@ def test_url_based_local_file(): else: assert loc.File("FILE://" + file_path) == file - # A "file" URL with the "localhost" host or without an authority also refers to a local file while a "file" URL - # with another host refers to a remote file. + # A "file" URL with the "localhost" host or without an authority also refers to a local file while a "file" URL with + # another host refers to a remote file. if platform.system() == "Windows": url_path = "/" + utils.forward_slash_path(file_path) diff --git a/tests/bindings/python/test_file_child.py b/tests/bindings/python/test_file_child.py index 7f2865c9c..19f75ce52 100644 --- a/tests/bindings/python/test_file_child.py +++ b/tests/bindings/python/test_file_child.py @@ -107,9 +107,9 @@ def test_remote_virtual_omex_files(): def test_remote_omex_file(): - # The child files of a remote OMEX file must be retrievable using their file name, even if the local copy of - # the OMEX file is in a directory that is accessed through a symbolic link (e.g., on macOS, the temporary - # directory is "/var/...", which is a symbolic link to "/private/var/..."). + # The child files of a remote OMEX file must be retrievable using their file name, even if the local copy of the + # OMEX file is in a directory that is accessed through a symbolic link (e.g., on macOS, the temporary directory is + # "/var/...", which is a symbolic link to "/private/var/..."). # Note: this has no JavaScript equivalent since our JavaScript bindings never retrieve the contents of a file, so a # remote file is never downloaded. @@ -141,9 +141,9 @@ def test_omex_file_replaced_with_other_contents(): def test_omex_file_with_files_outside_of_it(): - # An OMEX file may reference files that are located outside of it (e.g., "../sibling.cellml" or even the - # OMEX file itself), in which case they must be ignored rather than replace the contents of another managed - # file (or result in an infinite recursion). + # An OMEX file may reference files that are located outside of it (e.g., "../sibling.cellml" or even the OMEX file + # itself), in which case they must be ignored rather than replace the contents of another managed file (or result in + # an infinite recursion). expected_issues = [ [ @@ -180,10 +180,10 @@ def test_omex_file_with_files_outside_of_it(): reason="A symbolic link usually requires some special privileges on Windows.", ) def test_omex_file_with_files_outside_of_it_through_symbolic_link(): - # The files of an OMEX file are located in a directory which name is that of the OMEX file followed by - # ".contents". If such a directory happens to exist and to be a symbolic link then the ".." components that follow - # it are kept (see canonicalFileName()), but the files they refer to are still located outside of the OMEX - # file, so they must still be ignored. + # The files of an OMEX file are located in a directory which name is that of the OMEX file followed by ".contents". + # If such a directory happens to exist and to be a symbolic link then the ".." components that follow it are kept + # (see canonicalFileName()), but the files they refer to are still located outside of the OMEX file, so they must + # still be ignored. # Note: a symbolic link usually requires some special privileges on Windows. expected_issues = [ @@ -338,8 +338,7 @@ def test_omex_file_with_duplicate_locations(): def test_omex_file_with_self_referencing_locations(): - # Locations that refer to the OMEX file itself (e.g., ".", "./", or "/") are not child files of the OMEX - # file. + # Locations that refer to the OMEX file itself (e.g., ".", "./", or "/") are not child files of the OMEX file. file = File(utils.resource_path("api/file/self_referencing_locations.omex")) diff --git a/tests/bindings/python/test_sed_basic.py b/tests/bindings/python/test_sed_basic.py index 7257723cd..c1e9944e1 100644 --- a/tests/bindings/python/test_sed_basic.py +++ b/tests/bindings/python/test_sed_basic.py @@ -123,8 +123,8 @@ def test_sedml_file_with_relative_cellml_file(): def test_sedml_file_with_relative_cellml_file_in_working_directory(): - # A relative model source is relative to the SED-ML file, not to the current working directory, even if the - # current working directory contains a file with that name. + # A relative model source is relative to the SED-ML file, not to the current working directory, even if the current + # working directory contains a file with that name. orig_dir = os.getcwd() diff --git a/tests/bindings/python/test_sed_coverage.py b/tests/bindings/python/test_sed_coverage.py index 3f0ee91b9..0265d23fa 100644 --- a/tests/bindings/python/test_sed_coverage.py +++ b/tests/bindings/python/test_sed_coverage.py @@ -462,9 +462,9 @@ def test_sed_ids(): assert other_model.id == "model1" - # An id that is already used by another object, whatever its type, is a duplicate and is therefore rejected, - # leaving the id unchanged, even though it is a valid SED-ML identifier. The id of an object is, however, not a - # duplicate, so an object can be given its own id. + # An id that is already used by another object, whatever its type, is a duplicate and is therefore rejected, leaving + # the id unchanged, even though it is a valid SED-ML identifier. The id of an object is, however, not a duplicate, + # so an object can be given its own id. for id in ["model2", "simulation1", "task1"]: assert loc.SedBase.is_valid_id(id) @@ -1135,9 +1135,9 @@ def test_kinsol_with_no_solution_over_time(): def test_kinsol_with_no_solution_when_initialising(): # The first NLA system of our model (a^2+x = 1) has no solution for x > 1, so if the initial value of x gets set to - # 2 after our instance has been created, then our model cannot be (re)initialised when running our instance, - # whether we use a fixed-step ODE solver or CVODE. Our simulation should therefore stop there and we should have no - # results to report. + # 2 after our instance has been created, then our model cannot be (re)initialised when running our instance, whether + # we use a fixed-step ODE solver or CVODE. Our simulation should therefore stop there and we should have no results + # to report. expected_issues = [ [ diff --git a/tests/bindings/python/test_sed_instance.py b/tests/bindings/python/test_sed_instance.py index 9a83969ea..6a92e8216 100644 --- a/tests/bindings/python/test_sed_instance.py +++ b/tests/bindings/python/test_sed_instance.py @@ -606,9 +606,9 @@ def test_stop_run_before_output_start_time(): assert not math.isnan(voi[0]) - # Start our run and stop it before it reaches the output start time, which means that we have no results to - # report. Our results should therefore not have been reallocated (since their size has not changed), but they - # should all be NaN values. + # Start our run and stop it before it reaches the output start time, which means that we have no results to report. + # Our results should therefore not have been reallocated (since their size has not changed), but they should all be + # NaN values. simulation.output_start_time = OUTPUT_START_TIME simulation.output_end_time = OUTPUT_START_TIME + float(simulation.number_of_steps) @@ -1159,8 +1159,8 @@ def test_start_run_while_already_running(): def test_start_run_right_after_status_is_idle(): - # Note: a run is flagged as not running anymore just before it completes, so make sure that a new run can be - # started as soon as our instance is reported as idle. + # Note: a run is flagged as not running anymore just before it completes, so make sure that a new run can be started + # as soon as our instance is reported as idle. NUMBER_OF_STEPS = 10 NUMBER_OF_RUNS = 1000 @@ -1422,8 +1422,8 @@ def test_change_model_after_stop_run(): def test_model_changes_that_cannot_be_applied(): - # Note: model changes that cannot be applied are reported and ignored, but they don't prevent an instance from - # being run, whether they are present when the instance is created or added afterwards. + # Note: model changes that cannot be applied are reported and ignored, but they don't prevent an instance from being + # run, whether they are present when the instance is created or added afterwards. expected_instantiation_issues = [ [ diff --git a/tests/bindings/python/test_sed_serialise.py b/tests/bindings/python/test_sed_serialise.py index 02d87e12b..02bf5411e 100644 --- a/tests/bindings/python/test_sed_serialise.py +++ b/tests/bindings/python/test_sed_serialise.py @@ -156,8 +156,8 @@ def test_relative_local_cellml_file_without_base_path(): def test_relative_local_cellml_file_in_directory_without_base_path(): - # A relative file name is serialised as a relative model source, so its directory separators must be forward - # slashes (i.e. not backslashes on Windows). + # A relative file name is serialised as a relative model source, so its directory separators must be forward slashes + # (i.e. not backslashes on Windows). file = loc.File("some/path/cellml_2.cellml", False) @@ -237,8 +237,8 @@ def test_local_cellml_file_with_percent_signs(): def test_local_cellml_file_with_question_marks_and_number_signs(): # A model source is a URI reference, so the question marks and number signs in the file name of a local model must - # be percent-encoded for the model source to refer to that model when the SED-ML file is loaded back (rather than - # to the file which name is the part of that file name that precedes the first question mark or number sign). + # be percent-encoded for the model source to refer to that model when the SED-ML file is loaded back (rather than to + # the file which name is the part of that file name that precedes the first question mark or number sign). cellml_contents = utils.text_to_list( utils.text_file_contents(utils.resource_path("cellml_2.cellml")) @@ -290,8 +290,8 @@ def test_local_cellml_file_with_question_marks_and_number_signs(): reason="A file name cannot contain a colon on Windows.", ) def test_local_cellml_file_with_colon(): - # A relative model source which first segment contains a colon must be prefixed with "./" for it not to be - # mistaken for a URI with a scheme when the SED-ML file is loaded back (in which case the model would be ignored). + # A relative model source which first segment contains a colon must be prefixed with "./" for it not to be mistaken + # for a URI with a scheme when the SED-ML file is loaded back (in which case the model would be ignored). # Note: a file name cannot contain a colon on Windows. cellml_contents = utils.text_to_list( @@ -417,9 +417,9 @@ def test_local_cellml_file_with_non_utf8_character(): def test_local_cellml_file_with_non_xml_character(): - # A model source is an XML attribute, so the characters in the file name of a local model that are not allowed in - # an XML document (e.g., U+0001 and U+FFFF) must be percent-encoded for the SED-ML file to be valid and for the - # model source to refer to that model when the SED-ML file is loaded back. + # A model source is an XML attribute, so the characters in the file name of a local model that are not allowed in an + # XML document (e.g., U+0001 and U+FFFF) must be percent-encoded for the SED-ML file to be valid and for the model + # source to refer to that model when the SED-ML file is loaded back. cellml_contents = utils.text_to_list( utils.text_file_contents(utils.resource_path("cellml_2.cellml")) @@ -510,8 +510,8 @@ def test_remote_cellml_file_with_non_utf8_character(): def test_remote_cellml_file_with_colon(): - # A relative model source which first segment contains a colon must be prefixed with "./" for it not to be - # mistaken for a URI with a scheme when the SED-ML file is loaded back (in which case the model would be ignored). + # A relative model source which first segment contains a colon must be prefixed with "./" for it not to be mistaken + # for a URI with a scheme when the SED-ML file is loaded back (in which case the model would be ignored). cellml_contents = utils.text_to_list( utils.text_file_contents(utils.resource_path("cellml_2.cellml")) diff --git a/tests/memory_checks.py b/tests/memory_checks.py index cbddaeb0c..0ae1213be 100755 --- a/tests/memory_checks.py +++ b/tests/memory_checks.py @@ -15,8 +15,7 @@ # limitations under the License. # Do memory checks using Memcheck from Valgrind (on Linux) or Leaks (on macOS). -# Note: this script is based on the runMemcheck.py script that used to be part -# of KDevelop (see +# Note: this script is based on the runMemcheck.py script that used to be part of KDevelop (see # https://invent.kde.org/kdevelop/kdevelop/-/blob/3973/veritas/tests/runMemcheck.py). import math diff --git a/tests/misc/utils.cpp b/tests/misc/utils.cpp index 1c57b4d69..5c9044658 100644 --- a/tests/misc/utils.cpp +++ b/tests/misc/utils.cpp @@ -215,8 +215,8 @@ TEST(UtilsTest, retrieveFileInfo) EXPECT_EQ(fileNameOrUrl, expectedFileNameOrUrl) << url; } - // A remote URL is decoded, except for its reserved characters and percent signs, and then canonicalised. Its - // scheme and host are also normalised to lowercase, but not its userinfo, path, query, fragment, percent-encoded + // A remote URL is decoded, except for its reserved characters and percent signs, and then canonicalised. Its scheme + // and host are also normalised to lowercase, but not its userinfo, path, query, fragment, percent-encoded // characters, and the zone identifier of an IPv6 address. static const std::vector> URLS { @@ -305,8 +305,7 @@ TEST(UtilsTest, stringToPathAndPathToString) } // A path with lone surrogates that stand for bytes that form a valid UTF-8 sequence cannot, however, be converted - // to a file name and back without being altered (e.g., U+DCC3 U+DCA9 and U+00E9 are both converted to - // "\xC3\xA9"). + // to a file name and back without being altered (e.g., U+DCC3 U+DCA9 and U+00E9 are both converted to "\xC3\xA9"). static constexpr wchar_t ESCAPED_C3_SURROGATE {0xDCC3}; static constexpr wchar_t ESCAPED_A9_SURROGATE {0xDCA9}; From fec7965bb033d40f0804195d3a3c46b374b97ef0 Mon Sep 17 00:00:00 2001 From: Alan Garny Date: Thu, 26 Nov 2026 16:49:25 +1300 Subject: [PATCH 5/5] libCellML: upgraded to version 2026-11-26. --- src/3rdparty/libCellML/CMakeLists.txt | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/src/3rdparty/libCellML/CMakeLists.txt b/src/3rdparty/libCellML/CMakeLists.txt index 61a26e28e..a70f7ed62 100644 --- a/src/3rdparty/libCellML/CMakeLists.txt +++ b/src/3rdparty/libCellML/CMakeLists.txt @@ -13,9 +13,9 @@ # limitations under the License. set(PACKAGE_NAME libCellML) -set(PACKAGE_VERSION 2026-11-25) +set(PACKAGE_VERSION 2026-11-26) set(PACKAGE_REPOSITORY libcellml) -set(RELEASE_TAG 2026-11-25) +set(RELEASE_TAG 2026-11-26) set(INSTALL_DIR ${PREBUILT_DIR}/${PACKAGE_NAME}) if(WIN32 AND NOT RELEASE_MODE) @@ -71,49 +71,49 @@ if(LIBOPENCOR_PREBUILT_LIBCELLML) if(EMSCRIPTEN) retrieve_package(${PACKAGE_NAME} ${PACKAGE_VERSION} ${PACKAGE_REPOSITORY} ${RELEASE_TAG} - 17561666cb2003119b79192aa66f84dec619389a) + d701da4026183e08f9155288928a999709121ccf) else() if(WIN32) if(RELEASE_MODE) if(INTEL_MODE) retrieve_package(${PACKAGE_NAME} ${PACKAGE_VERSION} ${PACKAGE_REPOSITORY} ${RELEASE_TAG} - 0882e97eb368c02af18fede335ca69d017fa0258) + 3172ebe3675c041834e6cd385cba10e8e04ec801) else() retrieve_package(${PACKAGE_NAME} ${PACKAGE_VERSION} ${PACKAGE_REPOSITORY} ${RELEASE_TAG} - 96ae88307fb5b0d9302e8d54ae5bb6d74bed6353) + 4c5bd77735176f7a5bef3c91775e6522cf565b7d) endif() else() if(INTEL_MODE) retrieve_package(${PACKAGE_NAME} ${PACKAGE_VERSION} ${PACKAGE_REPOSITORY} ${RELEASE_TAG} - d01ed65f6888ead42d8e12431459e082a06372c8) + f13c426bed9a2681b0b58cb1dcde051f7538e196) else() retrieve_package(${PACKAGE_NAME} ${PACKAGE_VERSION} ${PACKAGE_REPOSITORY} ${RELEASE_TAG} - 937937d4acdd07195f82cf2a51a08c70e26e3685) + a0706257082902c457eedd2d53480680a9bec5e8) endif() endif() elseif(APPLE) if(INTEL_MODE) retrieve_package(${PACKAGE_NAME} ${PACKAGE_VERSION} ${PACKAGE_REPOSITORY} ${RELEASE_TAG} - 1712bdfff14dbfa6652fc56a0ac102bdf9a84f87) + 0cb7e7bc3cd8a7f38cf5544d22cea44a5debc1ff) else() retrieve_package(${PACKAGE_NAME} ${PACKAGE_VERSION} ${PACKAGE_REPOSITORY} ${RELEASE_TAG} - 606fca99935c7d1cf8c99005a8f31c765853b7d7) + a783799c596dee614ee22c66e0e2177e087a5e27) endif() else() if(INTEL_MODE) retrieve_package(${PACKAGE_NAME} ${PACKAGE_VERSION} ${PACKAGE_REPOSITORY} ${RELEASE_TAG} - b3b64587e61ad7e1f46426b25ed738fd07984e3c) + 5963f741cb0c45ab714ea742e18e12035b9d055f) else() retrieve_package(${PACKAGE_NAME} ${PACKAGE_VERSION} ${PACKAGE_REPOSITORY} ${RELEASE_TAG} - b441e19b6699c908e0a72505f4b5d04909d8d9b1) + 8603ecd5d988da5be31bc46d9e9a2087f5236043) endif() endif() endif()