unit test not passing on my computer

Jelmer Vernooij jelmer at samba.org
Wed Jun 23 06:51:18 MDT 2010


Hi Matthias,

On Wed, 2010-06-23 at 09:11 +0200, Matthias Dieter Wallnöfer wrote:
> we simply need a function, which gets a numeric value as a string and 
> then converts it to a signed 32 bit integer representation. That means a 
> call which takes the 32 bit less significant bits and treats them as 
> integer (no overflow check).
That's fixing the symptom of the issue, while I think the problem at
heart is that somewhere we're interpreting these integers differently
earlier without good reason. 

I've merged Lukasz patch, please let me know if these tests don't work
for you anymore.

Cheers,

Jelmer

> Jelmer Vernooij wrote:
> > Hi Lukasz, Matthias,
> >    
> >> just using
> >> "%d" % ((grouptype) % 2**32)
> >> seems to break on both 32 and 64bit:
> >> On 32:
> >> groupType= -2147483644
> >> groupType (grouptype % 2**32)= 2147483652
> >>
> >> on 64bit:
> >> groupType= 2147483652
> >> groupType (grouptype % 2**32)= 2147483652
> >>
> >> Note: on 32bit the value is correct to start with so no conversion would
> >> be necessary
> >>
> >> Maybe Jelmer can shed some light on this
> >>      
> > This is definitely not the right fix, as the user in Python shouldn't
> > have to care about the endianness of the machine on which the code is
> > running.
> >
> > I don't really understand what the problem is that you're trying to
> > solve though - what test is failing and in what way ?
> >
> > Cheers,
> >
> > Jelmer
> >    
> 

-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 836 bytes
Desc: This is a digitally signed message part
URL: <http://lists.samba.org/pipermail/samba-technical/attachments/20100623/756f71a8/attachment.pgp>


More information about the samba-technical mailing list