src/third_party/angle/src/common/FastVector_unittest.cpp
// Tests vector operations with a non copyable type.
Tests vector operations with a non copyable type.
Tests vector operations with a non copyable type .
TEST(FastVector, NonCopyable)
{
    struct s : angle::NonCopyable
    {
        s() : x(0) {}
        s(int xin) : x(xin) {}
        s(s &&other) : x(other.x) {}
        s &operator=(s &&other)
        {
            x = other.x;
            return *this;
        }
        int x;
    };
    FastVector<s, 3> vec;
    vec.push_back(3);
    EXPECT_EQ(3, vec[0].x);
    FastVector<s, 3> copy = std::move(vec);
    EXPECT_EQ(1u, copy.size());
    EXPECT_EQ(3, copy[0].x);
}
TEST ( FastVector , NonCopyable ) { struct s : angle :: NonCopyable { s ( ) : x ( 0 ) { } s ( int xin ) : x ( xin ) { } s ( s && other ) : x ( other . x ) { } s & operator = ( s && other ) { x = other . x ; return * this ; } int x ; } ; FastVector < s , 3 > vec ; vec . push_back ( 3 ) ; EXPECT_EQ ( 3 , vec [ 0 ] . x ) ; FastVector < s , 3 > copy = std :: move ( vec ) ; EXPECT_EQ ( 1u , copy . size ( ) ) ; EXPECT_EQ ( 3 , copy [ 0 ] . x ) ; }
Tests vector operations with a non copyable type.
Tests vector operations with a non copyable type .