stdcxx-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Travis Vitek (JIRA)" <j...@apache.org>
Subject [jira] Commented: (STDCXX-901) 26.class.gslice test fails
Date Tue, 03 Jun 2008 01:06:45 GMT

    [ https://issues.apache.org/jira/browse/STDCXX-901?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12601802#action_12601802
] 

Travis Vitek commented on STDCXX-901:
-------------------------------------

It looks like this is a problem with gslice. Here is the relevant code.

{noformat}
template <class _TypeT>
valarray<_TypeT>::valarray(const gslice_array<_TypeT>& sl_ar)
{
    gslice __sl(sl_ar._C_get_slice());

    _RW::__rw_array <_TypeT> __tmp =
        _RW::__rw_array <_TypeT>(_TypeT (), __sl.ind_numb());

    _RWSTD_SIZE_T __i = __sl.next_ind();
    _RWSTD_SIZE_T __cpt = 0;

    while (!__sl.is_reseted ())
    {
      __tmp[__cpt] = (*(sl_ar.get_ref_mem_array()))[__i];
      __i = __sl.next_ind();
      __cpt++;
    }

    _C_array.swap (__tmp);
}
{noformat}

The issue is that if you have a gslice with start = 1, step = 1 and stride = 1 the slice {{\_\_sl}}
is reset when you call {{next_ind()}} the first time. So we never enter the loop, but we should
enter the loop exactly once.


> 26.class.gslice test fails
> --------------------------
>
>                 Key: STDCXX-901
>                 URL: https://issues.apache.org/jira/browse/STDCXX-901
>             Project: C++ Standard Library
>          Issue Type: Bug
>          Components: Tests
>    Affects Versions: 4.2.0, 4.2.1
>         Environment: MSVC
>            Reporter: Farid Zaripov
>            Assignee: Travis Vitek
>            Priority: Minor
>             Fix For: 4.2.2
>
>
> The 26.class.gslice test fails with the 162 similar assertions:
> {noformat}
> # ASSERTION (S7) (5 lines):
> # TEXT: mismatch at 0, index 1: expected 1, got 0
> # ASSERTION (S7) (5 lines):
> # TEXT: mismatch at 0, index 1: expected 1, got 0
> # ASSERTION (S7) (5 lines):
> # TEXT: mismatch at 0, index 1: expected 1, got 0
> # ASSERTION (S7) (5 lines):
> # TEXT: mismatch at 0, index 2: expected 2, got 0
> # ASSERTION (S7) (5 lines):
> # TEXT: mismatch at 0, index 2: expected 2, got 0
> # ASSERTION (S7) (5 lines):
> # TEXT: mismatch at 0, index 2: expected 2, got 0
> # ASSERTION (S7) (5 lines):
> # TEXT: mismatch at 0, index 3: expected 3, got 0
> # ASSERTION (S7) (5 lines):
> # TEXT: mismatch at 0, index 3: expected 3, got 0
> # ASSERTION (S7) (5 lines):
> # TEXT: mismatch at 0, index 3: expected 3, got 0
> ...
> {noformat}
>   I'm not found the opened issue for gslice, so maybe this is another bug in gslice class
or maybe the test itself is incorrect.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


Mime
View raw message