That makes sense.<div><br></div><div>I don't see anything in nosetests that specifies a platform, but we could simply check for <a href="http://os.name">os.name</a> == 'nt'  (
<a href="http://docs.python.org/library/os.html">http://docs.python.org/library/os.html</a> ) and check for TypeKind.INT on windows.</div><div><br></div><div>Thoughts?</div><div>-Evan<br><br><div class="gmail_quote">On Mon, Apr 16, 2012 at 10:41 AM, Matthieu Monrocq <span dir="ltr"><<a href="mailto:matthieu.monrocq@gmail.com">matthieu.monrocq@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><br><br><div class="gmail_quote">Le 16 avril 2012 11:08, Evan P <span dir="ltr"><<a href="mailto:hiwrac@gmail.com" target="_blank">hiwrac@gmail.com</a>></span> a écrit :<div>
<div class="h5"><br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div>When running the tests for the clang python bindings on windows 7 (x64, clang built with MSVC 10).   This failure does not occur on Linux (Mint 12, clang built with gcc 4.6.1)</div><div><br></div><div><br></div><div>

======================================================================</div>
<div>
FAIL: tests.cindex.test_cursor.test_enum_type</div><div>----------------------------------------------------------------------</div><div>Traceback (most recent call last):</div><div>  File "C:\Python27\lib\site-packages\nose-1.1.2-py2.7.egg\nose\case.py", line 1</div>



<div>97, in runTest</div><div>    self.test(*self.arg)</div><div>  File "E:\Dev\Projects\llvm\llvm\tools\clang\bindings\python\tests\cindex\test_</div><div>cursor.py", line 110, in test_enum_type</div><div>    assert enum_type.kind == TypeKind.UINT</div>



<div>AssertionError</div><div><br></div><div><br></div><div>The full test:</div><div><div><br></div><div>def test_enum_type():</div><div>    tu = get_tu('enum TEST { FOO=1, BAR=2 };')</div><div>    enum = get_cursor(tu, 'TEST')</div>



<div>    assert enum is not None</div><div><br></div><div>    assert enum.kind == CursorKind.ENUM_DECL</div><div>    enum_type = enum.enum_type</div><div>    assert enum_type.kind == TypeKind.UINT</div></div><div><br></div>



<div>The assert is failing because the version compiled under MSVC enum_type.kind is TypeKind.INT instead of TypeKind.UINT</div><div><br></div><div>I see 2 possibilities, and I am not sure which is correct (possibly both):</div>


<div><br>
</div><div>1) This is simply an overzealous test, according to <a href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2011/n3242.pdf" target="_blank">http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2011/n3242.pdf</a> (7.2.6) (pg 156) an unscoped enum does not required a fixed type and can be any integral type that can accommodate all enum values with the exception it is not larger than int/unsigned int unless it has to be to 
accommodate all values.</div><div><br></div><div>2) There is an inconsistency in the way clang handles enum definitions when built with MSVC10 vs GCC4.6.</div><div><br></div><div>Can anyone shed some light on this, and point me in a direction to help resolve this?</div>


<div><br></div><div>Thanks</div><span><font color="#888888"><div>-Evan</div><div><br></div><div><br></div></font></span></blockquote></div></div><div><br>I think it is an intentional inconsistency in the way Clang handles enums when generating code for enums.<br>

<br>If I remember correctly gcc defaults to unsigned while MSVC defaults to int; Clang then just emulate their behavior in an attempt to be as close as possible to the code they emit.<br><br>I do not know how to "force" the target triplet in python tests, but this is generally the way used to get a platform independent test.<span class="HOEnZb"><font color="#888888"><br>

<br>-- Matthieu<br></font></span></div></div>
</blockquote></div><br></div>