Skip to content
This repository has been archived by the owner on Jan 31, 2022. It is now read-only.

Fix tests crashing on invalid XML files #309

Merged

Conversation

lmoureaux
Copy link

Description

Fix #308. The errors were caused by:

  1. Xerces exceptions leaking outside of XercesGuarded areas: fixed by throwing gem::onlinedb exceptions from XercesAlwaysThrowErrorManager
  2. Exceptions crossing thread boundaries: fixed by rethrowing from the main thread

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Motivation and Context

#308

How Has This Been Tested?

Added a test for point 1. and ran tests locally with and without a broken AMC13Configuraiton.xml.

Checklist:

  • My code follows the code style of this project.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have added tests to cover my changes.
  • All new and existing tests passed.

Tests were crashing when trying to load an XML file not complying with
the schema. This was related to Xerces exceptions being thrown;
replacing them with XDAQ exceptions fixes the problem.

In addition, transcode() for Xerces strings was made more robust when
the input string is null.
This adds a test for the issue fixed in the previous commit.
@jsturdy jsturdy merged commit 4840cdd into cms-gem-daq-project:develop Nov 17, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

gemonlinedb tests crash on invalid XML file
2 participants