Project

Profile

Help

Bug #1894

closed

IndexOutOfRangeException thrown in .NET

Added by O'Neil Delpratt over 10 years ago. Updated over 10 years ago.

Status:
Closed
Priority:
Normal
Category:
.NET API
Sprint/Milestone:
-
Start date:
2013-09-10
Due date:
% Done:

100%

Estimated time:
Legacy ID:
Applies to branch:
Fix Committed on Branch:
Fixed in Maintenance Release:
Platforms:

Description

The purpose of the following NUnit test case is to test writing a text node only to an XdmDestination, which should fail cleanly.

 public void TestWriteTextNodeOnly()
        {
            try
            {
                Processor processor = new Processor(false);
                XQueryCompiler xpc = processor.NewXQueryCompiler();
                XQueryEvaluator s = xpc.Compile("text{'abcd'}").Load();
                XdmDestination dest = new XdmDestination();
                s.Run(dest);
                Assert.Fail("Unexpected success");
            }
            catch (Exception e)
            {
                Assert.True(e.Message.Contains("text nodes are only allowed within a document"), e.Message);
            }

However the test case fails with the following exception:

System.IndexOutOfRangeException occurred HResult=-2146233080
  Message=Index was outside the bounds of the array.
  Source=saxon9ee
  StackTrace:
       at net.sf.saxon.tree.tiny.TinyBuilder.makeTextNode(CharSequence chars, Int32 len)
  InnerException: 

The failure occurs on line 394 of makeTextNode in the class TinyBuilder

Please register to edit this issue

Also available in: Atom PDF