unit test not passing on my computer

Matthias Dieter Wallnöfer mdw at samba.org
Wed Jun 23 01:11:39 MDT 2010


Jelmer,

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).

Matthias

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
>    



More information about the samba-technical mailing list