[phobos] Silent failure of std.container unittests

Lars Tandle Kyllingstad lars at kyllingen.net
Tue Jul 13 23:59:57 PDT 2010


Thanks, Sean, that was the clue I needed.  I reran the unittests,
compiling against an earlier version of druntime, and it turns out that
the failing assert is in line 1255 of container.d.  That's the postblit
constructor of Array.Payload, which is defined simply as

  this(this)
  {
      assert(0);
  }

So, firstly:  Why is the constructor defined like this?  If it is meant
to disable copying of Array.Payload, isn't that what @disable is for?

Moving on, I did try to @disable the postblit constructor in order to
track down why it's called.  Then the error changes to

  std/exception.d(407): Error: struct
  std.container.Array!(uint).Array.Payload is not copyable
  because it is annotated with @disable

Line 407 of exception.d is inside pointsTo(), and contains

  foreach (i, subobj; source.tupleof)

typeof(source) is Tuple!(Payload,"_backend",ulong,"_length"), and it
would seem that taking .tupleof on this type attempts a copy of Payload.

-Lars



On Tue, 2010-07-13 at 07:23 -0700, Sean Kelly wrote:
> If a unittest throws an exception the test is marked as failed and you'll see an errorlevel 1 after the tests complete. I didn't report the exception because unittest output is often parsed to accumulate results, but this could easily be changed. 
> 
> Sent from my iPhone
> 
> On Jul 12, 2010, at 6:55 AM, Lars Tandle Kyllingstad <lars at kyllingen.net> wrote:
> 
> > When running 'make unittest' on the latest revision of Phobos, it just
> > fails on/after std.container, without any sensible error message:
> > 
> > Testing generated/posix/debug/unittest/std/container
> > make[1]: *** [generated/posix/debug/unittest/std/container] Error 1
> > make: *** [unittest] Error 2
> > 
> > Anyone else seeing this?
> > 
> > -Lars
> > 
> > _______________________________________________
> > phobos mailing list
> > phobos at puremagic.com
> > http://lists.puremagic.com/mailman/listinfo/phobos
> _______________________________________________
> phobos mailing list
> phobos at puremagic.com
> http://lists.puremagic.com/mailman/listinfo/phobos




More information about the phobos mailing list