Skip to content

Commit

Permalink
tst_QByteArrayView: check conversion from various QSpans
Browse files Browse the repository at this point in the history
This is supposed to work, so check it.

Conflict resolutions for 6.8:
- added missing qspan.h include

Change-Id: I201033656f123b09644e5de447cd5d7b038e5155
Reviewed-by: Ivan Solovev <[email protected]>
(cherry picked from commit 8a3ffe7)
Reviewed-by: Qt Cherry-pick Bot <[email protected]>
(cherry picked from commit 9bcbeea)
Reviewed-by: Ahmad Samir <[email protected]>
  • Loading branch information
marcmutz committed Dec 15, 2024
1 parent f54b479 commit 909c3fa
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions tests/auto/corelib/text/qbytearrayview/tst_qbytearrayview.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@

#include <QTest>

#include <QtCore/qspan.h>

// for negative testing (can't convert from)
#include <deque>
#include <list>
Expand Down Expand Up @@ -76,6 +78,26 @@ static_assert(CanConvert<const std::array<char, 1> >);
static_assert(CanConvert< std::array<char, 1>&>);
static_assert(CanConvert<const std::array<char, 1>&>);

static_assert(CanConvert< QSpan<char> >);
static_assert(CanConvert<const QSpan<char> >);
static_assert(CanConvert< QSpan<char>&>);
static_assert(CanConvert<const QSpan<char>&>);

static_assert(CanConvert< QSpan<char, 42> >);
static_assert(CanConvert<const QSpan<char, 42> >);
static_assert(CanConvert< QSpan<char, 42>&>);
static_assert(CanConvert<const QSpan<char, 42>&>);

static_assert(CanConvert< QSpan<std::byte> >);
static_assert(CanConvert<const QSpan<std::byte> >);
static_assert(CanConvert< QSpan<std::byte>&>);
static_assert(CanConvert<const QSpan<std::byte>&>);

static_assert(CanConvert< QSpan<std::byte, 42> >);
static_assert(CanConvert<const QSpan<std::byte, 42> >);
static_assert(CanConvert< QSpan<std::byte, 42>&>);
static_assert(CanConvert<const QSpan<std::byte, 42>&>);

static_assert(!CanConvert<std::deque<char>>);
static_assert(!CanConvert<std::list<char>>);

Expand Down

0 comments on commit 909c3fa

Please sign in to comment.