Page Menu
Home
Phorge
Search
Configure Global Search
Log In
Files
F2577152
matrix-room-member-list-model-test.cpp
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Award Token
Flag For Later
Size
1 KB
Referenced Files
None
Subscribers
None
matrix-room-member-list-model-test.cpp
View Options
/*
* This file is part of kazv.
* SPDX-FileCopyrightText: 2023 tusooa <tusooa@kazv.moe>
* SPDX-License-Identifier: AGPL-3.0-or-later
*/
#include
<libkazv-config.hpp>
#include
<immer/config.hpp>
// https://github.com/arximboldi/immer/issues/168
#include
<memory>
#include
<QtTest>
#include
<lager/constant.hpp>
#include
<matrix-room-member-list-model.hpp>
#include
<matrix-room-member.hpp>
#include
"test-model.hpp"
#include
"test-utils.hpp"
using
namespace
Kazv
;
class
MatrixRoomMemberListModelTest
:
public
QObject
{
Q_OBJECT
private
Q_SLOTS
:
void
testMembers
();
};
static
auto
data
=
Kazv
::
EventList
{
makeRoomMember
(
"@t1:tusooa.xyz"
,
"t1"
),
makeRoomMember
(
"@t2:tusooa.xyz"
),
};
void
MatrixRoomMemberListModelTest::testMembers
()
{
MatrixRoomMemberListModel
model
(
lager
::
make_constant
(
data
));
QCOMPARE
(
model
.
count
(),
2
);
auto
first
=
toUniquePtr
(
model
.
at
(
0
));
QCOMPARE
(
first
->
name
(),
"t1"
);
QCOMPARE
(
first
->
userId
(),
"@t1:tusooa.xyz"
);
auto
second
=
toUniquePtr
(
model
.
at
(
1
));
QCOMPARE
(
second
->
name
(),
QStringLiteral
());
QCOMPARE
(
second
->
userId
(),
"@t2:tusooa.xyz"
);
}
QTEST_MAIN
(
MatrixRoomMemberListModelTest
)
#include
"matrix-room-member-list-model-test.moc"
File Metadata
Details
Attached
Mime Type
text/x-c
Expires
Tue, Jun 24, 3:10 AM (45 m, 37 s)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
91825
Default Alt Text
matrix-room-member-list-model-test.cpp (1 KB)
Attached To
Mode
rK kazv
Attached
Detach File
Event Timeline
Log In to Comment