Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tests fail with pytest: test_findMSB and test_bitCount #227

Open
badshah400 opened this issue Dec 12, 2023 · 0 comments
Open

Tests fail with pytest: test_findMSB and test_bitCount #227

badshah400 opened this issue Dec 12, 2023 · 0 comments

Comments

@badshah400
Copy link

When building RPM packages for openSUSE, we find that the following tests fail when running pytest:

[  113s] =================================== FAILURES ===================================
[  113s] _________________________________ test_findMSB _________________________________
[  113s] 
[  113s]     def test_findMSB():
[  113s]         cases = [
[  113s]             (T(value), getattr(glm, f"ivec{get_len_of_type(T)}")(expected)) for value, expected in
[  113s]             ((0x00000000, -1),
[  113s]     		 (0x00000001,  0),
[  113s]     		 (0x00000002,  1),
[  113s]     		 (0x00000003,  1),
[  113s]     		 (0x00000004,  2),
[  113s]     		 (0x00000005,  2),
[  113s]     		 (0x00000007,  2),
[  113s]     		 (0x00000008,  3),
[  113s]     		 (0x00000010,  4),
[  113s]     		 (0x00000020,  5),
[  113s]     		 (0x00000040,  6),
[  113s]     		 (0x00000080,  7),
[  113s]     		 (0x00000100,  8),
[  113s]     		 (0x00000200,  9),
[  113s]     		 (0x00000400, 10),
[  113s]     		 (0x00000800, 11),
[  113s]     		 (0x00001000, 12),
[  113s]     		 (0x00002000, 13),
[  113s]     		 (0x00004000, 14),
[  113s]     		 (0x00008000, 15),
[  113s]     		 (0x00010000, 16),
[  113s]     		 (0x00020000, 17),
[  113s]     		 (0x00040000, 18),
[  113s]     		 (0x00080000, 19),
[  113s]     		 (0x00100000, 20),
[  113s]     		 (0x00200000, 21),
[  113s]     		 (0x00400000, 22),
[  113s]     		 (0x00800000, 23),
[  113s]     		 (0x01000000, 24),
[  113s]     		 (0x02000000, 25),
[  113s]     		 (0x04000000, 26),
[  113s]     		 (0x08000000, 27),
[  113s]     		 (0x10000000, 28),
[  113s]     		 (0x20000000, 29),
[  113s]     		 (0x40000000, 30)) for T in gen_type("V__iIqQ")
[  113s]         ] + [
[  113s]             (0x00000000, -1),
[  113s]     		(0x00000001,  0),
[  113s]     		(0x00000002,  1),
[  113s]     		(0x00000003,  1),
[  113s]     		(0x00000004,  2),
[  113s]     		(0x00000005,  2),
[  113s]     		(0x00000007,  2),
[  113s]     		(0x00000008,  3),
[  113s]     		(0x00000010,  4),
[  113s]     		(0x00000020,  5),
[  113s]     		(0x00000040,  6),
[  113s]     		(0x00000080,  7),
[  113s]     		(0x00000100,  8),
[  113s]     		(0x00000200,  9),
[  113s]     		(0x00000400, 10),
[  113s]     		(0x00000800, 11),
[  113s]     		(0x00001000, 12),
[  113s]     		(0x00002000, 13),
[  113s]     		(0x00004000, 14),
[  113s]     		(0x00008000, 15),
[  113s]     		(0x00010000, 16),
[  113s]     		(0x00020000, 17),
[  113s]     		(0x00040000, 18),
[  113s]     		(0x00080000, 19),
[  113s]     		(0x00100000, 20),
[  113s]     		(0x00200000, 21),
[  113s]     		(0x00400000, 22),
[  113s]     		(0x00800000, 23),
[  113s]     		(0x01000000, 24),
[  113s]     		(0x02000000, 25),
[  113s]     		(0x04000000, 26),
[  113s]     		(0x08000000, 27),
[  113s]     		(0x10000000, 28),
[  113s]     		(0x20000000, 29),
[  113s]     		(0x40000000, 30)
[  113s]         ]
[  113s]     
[  113s]         for value, expected in cases:
[  113s]             result = glm.findMSB(value)
[  113s] >           assert result == expected, (result, expected, value)
[  113s] E           AssertionError: (ivec3( 20, 19, 13 ), ivec3( -1, -1, -1 ), ivec3( 0, 0, 0 ))
[  113s] E           assert ivec3( 20, 19, 13 ) == ivec3( -1, -1, -1 )
[  113s] E             Full diff:
[  113s] E             - ivec3( -1, -1, -1 )
[  113s] E             + ivec3( 20, 19, 13 )
[  113s] 
[  113s] test/PyGLM_test.py:3324: AssertionError
[  113s] ________________________________ test_bitCount _________________________________
[  113s] 
[  113s]     def test_bitCount():
[  113s]         cases = [
[  113s]             (T(value), getattr(glm, f"ivec{get_len_of_type(T)}")(expected)) for value, expected in
[  113s]             ((0x00000001,  1),
[  113s]     		 (0x00000003,  2),
[  113s]     		 (0x00000002,  1),
[  113s]     		 (0x000000ff,  8),
[  113s]     		 (0x00000000,  0)) for T in gen_type("V__sSuU")
[  113s]         ] + [
[  113s]             (T(value), getattr(glm, f"ivec{get_len_of_type(T)}")(expected)) for value, expected in
[  113s]             ((0x00000001,  1),
[  113s]     		 (0x00000003,  2),
[  113s]     		 (0x00000002,  1),
[  113s]     		 (0x7fffffff, 31),
[  113s]     		 (0x00000000,  0)) for T in gen_type("V__iIqQ")
[  113s]         ] + [
[  113s]             (0x00000001,  1),
[  113s]     		(0x00000003,  2),
[  113s]     		(0x00000002,  1),
[  113s]     		(0x7fffffff, 31),
[  113s]     		(0x00000000,  0)
[  113s]         ]
[  113s]     
[  113s]         for value, expected in cases:
[  113s]             result = glm.bitCount(value)
[  113s] >           assert result == expected, (result, expected, value)
[  113s] E           AssertionError: (ivec1( 10 ), ivec1( 1 ), i16vec1( 1 ))
[  113s] E           assert ivec1( 10 ) == ivec1( 1 )
[  113s] E             Full diff:
[  113s] E             - ivec1( 1 )
[  113s] E             + ivec1( 10 )
[  113s] E             ?         +
[  113s] 
[  113s] test/PyGLM_test.py:3446: AssertionError
[  113s] =========================== short test summary info ============================
[  113s] FAILED test/PyGLM_test.py::test_findMSB - AssertionError: (ivec3( 20, 19, 13 ...
[  113s] FAILED test/PyGLM_test.py::test_bitCount - AssertionError: (ivec1( 10 ), ivec...
[  113s] ======================== 2 failed, 177 passed in 1.31s =========================

I tested this using python 3.9, 3.10, and 3.11. In each case these two tests fail. Would be glad for any pointers towards fixing or working around these.

Version tested: 2.7.1

Thanks for your very useful library.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant