[PATCH] Add tests for pytalloc

Petr Viktorin pviktori at redhat.com
Fri Mar 6 11:24:10 MST 2015


On 03/06/2015 12:50 PM, Petr Viktorin wrote:
> On 03/05/2015 04:00 PM, Stefan (metze) Metzmacher wrote:
>> Hi Petr,
>>
>> can you please split the wafsamba change into it's own commit.
>
> Of course; attached.

Turns out I had a bug in my testing code (_test_pytalloc.DObject() was 
not returning the custom type). Updated version attached.

When I fixed that, I found a subtle bug in pytalloc: comparing talloc 
objects of different types resulted in undefined behavior. Undefined 
enough for GCC to give me wrong results.
The intent of the patches is to test the current behavior before I 
change it, so I'm wary of changing too much now. The first patch here is 
a simple fix that I plan to revisit.


>> Am 05.03.2015 um 14:23 schrieb Petr Viktorin:
>>> Hello,
>>> I couldn't find any tests for talloc's Python bindings, so I wrote some.
>>>
>>> The tests are a bit biased towards comparisons. This is because I'd like
>>> to switch that part to be Python3-compatible (richcmp), and I want to
>>> make it clear to myself and others that the functionality is unchanged
>>> under Python 2.
>>> Also, as you'll find if you run the tests, the current comparisons
>>> generate warnings.
>>>
>>> Review & merge would be appreciated.
>>>
>>>
>>>
>>> I've looked at how tests for Python bindings for the various standalone
>>> libraries (ldb, tdb, ntdb, ) are run, and found that it's done
>>> differently each time. As part of the Python 3 effort, I'd like to write
>>> a helper to run Python tests (specifically, to run them under both
>>> Python versions, if you choose to build support for them). Are there any
>>> current efforts in this area, or thoughts about the ideal state, that I
>>> should be aware of?


-- 
Petr Viktorin
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-pytalloc-Fix-comparison-of-disparate-types.patch
Type: text/x-patch
Size: 1092 bytes
Desc: not available
URL: <http://lists.samba.org/pipermail/samba-technical/attachments/20150306/9a724932/attachment.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0002-wafsamba-Add-install-argument-to-SAMBA_PYTHON.patch
Type: text/x-patch
Size: 1234 bytes
Desc: not available
URL: <http://lists.samba.org/pipermail/samba-technical/attachments/20150306/9a724932/attachment-0001.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0003-pytalloc-Add-tests.patch
Type: text/x-patch
Size: 9300 bytes
Desc: not available
URL: <http://lists.samba.org/pipermail/samba-technical/attachments/20150306/9a724932/attachment-0002.bin>


More information about the samba-technical mailing list