diff --git a/modules/core/test/test_ds.cpp b/modules/core/test/test_ds.cpp index f19c6bb9de..5627c9cd6b 100644 --- a/modules/core/test/test_ds.cpp +++ b/modules/core/test/test_ds.cpp @@ -717,7 +717,7 @@ int Core_SeqBaseTest::test_get_seq_reading( int _struct_idx, int iters ) CV_TS_SEQ_CHECK_CONDITION( memcmp(elem, cvTsSimpleSeqElem(sseq, pos), sseq->elem_size) == 0, "reading is incorrect" ); pos += direction; - if( pos < 0 ) pos += total; + if( -pos > 0 ) pos += total; if( pos >= total ) pos -= total; CV_TS_SEQ_CHECK_CONDITION( pos == cvGetSeqReaderPos( &reader ),