@@ -753,6 +753,13 @@ def test_minmax_blocked(self):
753753 inp [i ] = - 1e10
754754 assert_equal (inp .min (), - 1e10 , err_msg = msg )
755755
756+ def test_lower_align (self ):
757+ # check data that is not aligned to element size
758+ # i.e doubles are aligned to 4 bytes on i386
759+ d = np .zeros (23 * 8 , dtype = np .int8 )[4 :- 4 ].view (np .float64 )
760+ assert_equal (d .max (), d [0 ])
761+ assert_equal (d .min (), d [0 ])
762+
756763
757764class TestAbsoluteNegative (TestCase ):
758765 def test_abs_neg_blocked (self ):
@@ -785,6 +792,17 @@ def test_abs_neg_blocked(self):
785792 np .negative (inp , out = out )
786793 assert_array_equal (out , - 1 * inp , err_msg = msg )
787794
795+ def test_lower_align (self ):
796+ # check data that is not aligned to element size
797+ # i.e doubles are aligned to 4 bytes on i386
798+ d = np .zeros (23 * 8 , dtype = np .int8 )[4 :- 4 ].view (np .float64 )
799+ assert_equal (np .abs (d ), d )
800+ assert_equal (np .negative (d ), - d )
801+ np .negative (d , out = d )
802+ np .negative (np .ones_like (d ), out = d )
803+ np .abs (d , out = d )
804+ np .abs (np .ones_like (d ), out = d )
805+
788806
789807class TestSpecialMethods (TestCase ):
790808 def test_wrap (self ):
0 commit comments