[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: struct assertion failure on Mac OSX
- From: Roberto Ierusalimschy <roberto@...>
- Date: Sun, 8 Dec 2013 15:57:27 -0200
> a, b, c, d = lib.unpack(">lBxxH", lib.pack(">lBxxH", -20, 10, 250))
> assert(a == -20 and b == 10 and c == 250 and d == 10)
> ```
>
> So, I changed the assert to:
>
> `assert(a == -20 and b == 10 and c == 250 and d == lib.size(">lBxxH") + 1)`
>
> [...]
>
> 1: Am I correct that struct doesn't seem to be broken and that the
> test is to blame, in this case?
Yes.
> 2: Is my edit to the test sane, not amounting to checking an error
> with something that might actually be buggy code?
Yes, it is sane.
-- Roberto