Re: D10160: Test for Crypt in QQ Protocol
Himanshu Vishwakarma <[email protected]> Wed, 31 Jan 2018 18:18:33 +0530
| Newsgroups | gmane.comp.kde.devel.kopete |
|---|---|
| Message-ID | <CAAF-E2sHx4XgBEdOeEegd8stqjSBZcSNTqJxwOdABSQL9mQ0Tg@mail.gmail.com> |
--001a1147f11aa64f7d056411e50a
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
Hi,
I have some difficulties in making this test into the data-driven test.
For the data-driven, I have the problem in defining the array type the data
function. how to use this function to store the array type values
QTest::addColumn<int>("result");
here in the example defining the Int
data type
but
=E2=80=8B =E2=80=8B
I
=E2=80=8B =E2=80=8B
want to use
=E2=80=8B =E2=80=8B
its
n *array* instead of
*int.*
I try Q_DECLARE_METATYPE() to define it like this
/**************************************************
=E2=80=8Bnamespace CryptData
{
struct Data {
unsigned int a[2];
};
struct Key {
unsigned int k[4];
};
}
Q_DECLARE_METATYPE(CryptData::Data)
Q_DECLARE_METATYPE(CryptData::Key)
/*******************************************************
but in this method I face lot of troubles in initializing the value by
function newRow().
Can I test with more values instead of data-driven?
I don't know what should I do.
please help!!
Regards,
Himanshu Vishwakarma
On Sun, Jan 28, 2018 at 8:12 PM, Vijay Krishnavanshi <
[email protected]> wrote:
> vijaykrishnavanshi added inline comments. View Revision
> <https://phabricator.kde.org/D10160>
> *INLINE COMMENTS*
> View Inline <https://phabricator.kde.org/D10160#inline-46737>
> qqcrypttest.cpp:11
> private slots:
> void CryptTest();
> };
>
> Make this test data-driven.
> Link: http://doc.qt.io/qt-5/qttestlib-tutorial2-example.html
>
> *REVISION DETAIL*
> https://phabricator.kde.org/D10160
>
> *To: *himanshuvishwakarma, vijaykrishnavanshi, pali, Kopete
> *Cc: *cochise
>
--001a1147f11aa64f7d056411e50a
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
<div dir=3D"ltr"><div class=3D"gmail_default" style=3D"font-family:arial,he=
lvetica,sans-serif"><div class=3D"gmail_default" style=3D"color:rgb(34,34,3=
4);font-size:small;font-style:normal;font-variant-ligatures:normal;font-var=
iant-caps:normal;font-weight:400;letter-spacing:normal;text-align:start;tex=
t-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;text-d=
ecoration-style:initial;text-decoration-color:initial;font-family:arial,hel=
vetica,sans-serif">Hi,<br></div><div class=3D"gmail_quote" style=3D"color:r=
gb(34,34,34);font-family:arial,sans-serif;font-size:small;font-style:normal=
;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:400;let=
ter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;whi=
te-space:normal;word-spacing:0px;text-decoration-style:initial;text-decorat=
ion-color:initial"><div dir=3D"ltr"><div style=3D"font-family:arial,helveti=
ca,sans-serif"><br></div><div style=3D"font-family:arial,helvetica,sans-ser=
if">I have some difficulties in making this test into the data-driven test.=
</div><div style=3D"font-family:arial,helvetica,sans-serif">For the data-dr=
iven, I have the problem in defining the array type the data function. how =
to use this function to<span style=3D"font-size:12.8px">=C2=A0store the arr=
ay type values=C2=A0</span></div><div style=3D"color:rgb(34,34,34);font-siz=
e:12.8px;font-style:normal;font-variant-ligatures:normal;font-variant-caps:=
normal;font-weight:400;letter-spacing:normal;text-align:start;text-indent:0=
px;text-transform:none;white-space:normal;word-spacing:0px;background-color=
:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initi=
al;font-family:arial,helvetica,sans-serif"><span style=3D"font-family:monos=
pace"><span style=3D"color:rgb(0,0,0);background-color:rgb(255,255,255)"><b=
r></span></span></div><div style=3D"color:rgb(34,34,34);font-size:12.8px;fo=
nt-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font=
-weight:400;letter-spacing:normal;text-align:start;text-indent:0px;text-tra=
nsform:none;white-space:normal;word-spacing:0px;background-color:rgb(255,25=
5,255);text-decoration-style:initial;text-decoration-color:initial;font-fam=
ily:arial,helvetica,sans-serif"><span style=3D"font-family:monospace"><span=
style=3D"color:rgb(0,0,0);background-color:rgb(255,255,255)">QTest::addCol=
umn<</span><span style=3D"color:rgb(0,0,0);background-color:rgb(127,96,0=
)">int</span><span style=3D"color:rgb(0,0,0);background-color:rgb(255,255,2=
55)">>("result"<wbr>);</span><br></span><br></div><div style=
=3D"color:rgb(34,34,34);font-family:arial,sans-serif;font-style:normal;font=
-variant-ligatures:normal;font-variant-caps:normal;letter-spacing:normal;te=
xt-align:start;text-indent:0px;text-transform:none;white-space:normal;word-=
spacing:0px;background-color:rgb(255,255,255);text-decoration-style:initial=
;text-decoration-color:initial"><div class=3D"m_-6474837965500889947gmail-m=
_1911453751045191420gmail-m_-8952806148270008647m_-8988460375539872637gmail=
_signature"><div dir=3D"ltr"><div dir=3D"ltr"><div dir=3D"ltr"><div dir=3D"=
ltr"><div dir=3D"ltr"><div dir=3D"ltr"><div dir=3D"ltr"><div dir=3D"ltr"><d=
iv style=3D"font-size:12.8px;font-weight:400"><font size=3D"2" face=3D"aria=
l, helvetica, sans-serif"><div style=3D"font-family:arial,helvetica,sans-se=
rif;display:inline"><div style=3D"font-family:arial,helvetica,sans-serif;di=
splay:inline">here in the example defining the Int=C2=A0</div><div style=3D=
"font-family:arial,helvetica,sans-serif;display:inline">data type=C2=A0</di=
v>but<div style=3D"font-family:arial,helvetica,sans-serif;display:inline">=
=E2=80=8B =E2=80=8B</div></div>I<div style=3D"font-family:arial,helvetica,s=
ans-serif;display:inline">=E2=80=8B =E2=80=8B</div><div style=3D"display:in=
line">want to use<div style=3D"font-family:arial,helvetica,sans-serif;displ=
ay:inline">=E2=80=8B =E2=80=8B</div><div style=3D"font-family:arial,helveti=
ca,sans-serif;display:inline">its=C2=A0</div>n<span>=C2=A0</span><b style=
=3D"font-family:arial,helvetica,sans-serif">array</b>=C2=A0instead=C2=A0of=
=C2=A0<span style=3D"color:rgb(0,0,0);font-size:small;font-style:normal;fon=
t-variant-ligatures:normal;font-variant-caps:normal;letter-spacing:normal;t=
ext-align:start;text-indent:0px;text-transform:none;white-space:normal;word=
-spacing:0px;background-color:rgb(255,255,255);text-decoration-style:initia=
l;text-decoration-color:initial;float:none;display:inline"><b style=3D"font=
-family:monospace">int<div style=3D"font-family:arial,helvetica,sans-serif;=
display:inline">.</div></b></span></div></font></div><div style=3D"font-siz=
e:12.8px;font-weight:400"><font size=3D"2" face=3D"arial, helvetica, sans-s=
erif"><div style=3D"display:inline"><span style=3D"color:rgb(0,0,0);font-si=
ze:small;font-style:normal;font-variant-ligatures:normal;font-variant-caps:=
normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transfor=
m:none;white-space:normal;word-spacing:0px;background-color:rgb(255,255,255=
);text-decoration-style:initial;text-decoration-color:initial;float:none;di=
splay:inline"><b style=3D"font-family:monospace"><div style=3D"font-family:=
arial,helvetica,sans-serif;display:inline"><br></div></b></span></div></fon=
t></div><div><div style=3D"font-family:arial,helvetica,sans-serif">I try<sp=
an>=C2=A0</span><span style=3D"color:rgb(64,66,68);font-family:"Titill=
ium Web",Arial,Helvetica,sans-serif;font-style:normal;font-variant-lig=
atures:normal;font-variant-caps:normal;font-weight:400;letter-spacing:norma=
l;text-align:start;text-indent:0px;text-transform:none;white-space:normal;w=
ord-spacing:0px;background-color:rgb(255,255,255);text-decoration-style:ini=
tial;text-decoration-color:initial;float:none;display:inline">Q_DECLARE_MET=
ATYPE()</span><span>=C2=A0</span>=C2=A0 to define it like this</div><div st=
yle=3D"font-family:arial,helvetica,sans-serif">/***************************=
**<wbr>*********************</div><div style=3D"font-family:arial,helvetica=
,sans-serif">=E2=80=8B<span style=3D"font-family:monospace"><span style=3D"=
color:rgb(135,255,175);background-color:rgb(255,255,255)">namespace</span><=
span style=3D"color:rgb(0,0,0);background-color:rgb(255,255,255)"><span>=C2=
=A0</span>CryptData<span>=C2=A0</span></span><br>{ =C2=A0=C2=A0=C2=A0<br>=
=C2=A0=C2=A0=C2=A0<span style=3D"color:rgb(135,255,175);background-color:rg=
b(255,255,255)">struct</span><span style=3D"color:rgb(0,0,0);background-col=
or:rgb(255,255,255)"><span>=C2=A0</span>Data {<span>=C2=A0</span></span><br=
>=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0<span style=3D"color:rgb(135,255=
,175);background-color:rgb(255,255,255)">unsigned</span><span style=3D"colo=
r:rgb(0,0,0);background-color:rgb(255,255,255)"><span>=C2=A0</span></span><=
span style=3D"color:rgb(135,255,175);background-color:rgb(255,255,255)">int=
</span><span style=3D"color:rgb(0,0,0);background-color:rgb(255,255,255)"><=
span>=C2=A0</span>a[</span><span style=3D"color:rgb(255,84,255);background-=
color:rgb(255,255,255)">2</span><span style=3D"color:rgb(0,0,0);background-=
color:rgb(255,255,255)">];<span>=C2=A0</span></span><br>=C2=A0=C2=A0=C2=A0}=
;<span>=C2=A0</span><br>=C2=A0=C2=A0=C2=A0<span style=3D"color:rgb(135,255,=
175);background-color:rgb(255,255,255)">struct</span><span style=3D"color:r=
gb(0,0,0);background-color:rgb(255,255,255)"><span>=C2=A0</span>Key { =C2=
=A0</span><br>=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0<span style=3D"colo=
r:rgb(135,255,175);background-color:rgb(255,255,255)">unsigned</span><span =
style=3D"color:rgb(0,0,0);background-color:rgb(255,255,255)"><span>=C2=A0</=
span></span><span style=3D"color:rgb(135,255,175);background-color:rgb(255,=
255,255)">int</span><span style=3D"color:rgb(0,0,0);background-color:rgb(25=
5,255,255)"><span>=C2=A0</span>k[</span><span style=3D"color:rgb(255,84,255=
);background-color:rgb(255,255,255)">4</span><span style=3D"color:rgb(0,0,0=
);background-color:rgb(255,255,255)">];<span>=C2=A0</span></span><br>=C2=A0=
=C2=A0=C2=A0};<span>=C2=A0</span><br>}<br>Q_DECLARE_METATYPE(CryptData::<wb=
r>Data)<span>=C2=A0</span><br>Q_DECLARE_METATYPE(CryptData::<wbr>Key)<br></=
span>/*****************************<wbr>**************************</div><di=
v style=3D"font-family:arial,helvetica,sans-serif">but in this method I fac=
e lot of troubles in<span>=C2=A0</span><span style=3D"color:rgb(34,34,34);f=
ont-family:arial,sans-serif;font-style:normal;font-variant-ligatures:normal=
;font-variant-caps:normal;font-weight:100;letter-spacing:normal;text-align:=
left;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0p=
x;background-color:rgb(255,255,255);text-decoration-style:initial;text-deco=
ration-color:initial;float:none;display:inline">initializing</span>=C2=A0th=
e value by function newRow().</div><div style=3D"font-family:arial,helvetic=
a,sans-serif"><br></div><div style=3D"font-family:arial,helvetica,sans-seri=
f">Can I test with more values instead of data-driven?</div><div style=3D"f=
ont-family:arial,helvetica,sans-serif">I don't know what should I do.</=
div><div style=3D"font-family:arial,helvetica,sans-serif"><br></div><div st=
yle=3D"font-family:arial,helvetica,sans-serif">please help!!</div></div></d=
iv></div></div></div></div></div></div></div></div></div></div></div></div>=
<div class=3D"gmail_extra"><div><div class=3D"m_-6474837965500889947gmail_s=
ignature" data-smartmail=3D"gmail_signature"><div dir=3D"ltr"><div><div dir=
=3D"ltr"><div><div dir=3D"ltr"><div><div dir=3D"ltr"><div><div dir=3D"ltr">=
<div><div dir=3D"ltr"><div><div dir=3D"ltr"><div dir=3D"ltr"><div dir=3D"lt=
r"><br></div><div dir=3D"ltr"><font size=3D"2" face=3D"arial, helvetica, sa=
ns-serif">Regards,</font><div style=3D"font-size:12.8px"><font size=3D"2" f=
ace=3D"arial, helvetica, sans-serif">Himanshu Vishwakarma</font></div></div=
></div></div></div></div></div></div></div></div></div></div></div></div></=
div></div></div></div>
<br><div class=3D"gmail_quote">On Sun, Jan 28, 2018 at 8:12 PM, Vijay Krish=
navanshi <span dir=3D"ltr"><<a href=3D"mailto:[email protected]=
g" target=3D"_blank">[email protected]</a>></span> wrote:<br><=
blockquote class=3D"gmail_quote" style=3D"margin:0 0 0 .8ex;border-left:1px=
#ccc solid;padding-left:1ex"><div class=3D"m_-6474837965500889947HOEnZb"><=
div class=3D"m_-6474837965500889947h5"><table><tbody><tr><td>vijaykrishnava=
nshi added inline comments.
</td><td><a style=3D"text-decoration:none;padding:4px 8px;margin:0 8px 8px;=
float:right;color:#464c5c;font-weight:bold;border-radius:3px;background-col=
or:#f7f7f9;background-image:linear-gradient(to bottom,#fff,#f1f0f1);display=
:inline-block;border:1px solid rgba(71,87,120,.2)" href=3D"https://phabrica=
tor.kde.org/D10160" rel=3D"noreferrer" target=3D"_blank">View Revision</a><=
/td></tr></tbody></table><br><div><strong>INLINE COMMENTS</strong><div><div=
style=3D"margin:6px 0 12px 0"><div style=3D"border:1px solid #c7ccd9;borde=
r-radius:3px"><div style=3D"padding:0;background:#f7f7f7;border-color:#e3e4=
e8;border-style:solid;border-width:0 0 1px 0;margin:0"><div style=3D"color:=
#74777d;background:#eff2f4;padding:6px 8px;overflow:hidden"><a style=3D"flo=
at:right;text-decoration:none" href=3D"https://phabricator.kde.org/D10160#i=
nline-46737" rel=3D"noreferrer" target=3D"_blank">View Inline</a><span styl=
e=3D"color:#4b4d51;font-weight:bold">qqcrypttest.cpp:11</span></div>
<div style=3D"font:11px/15px "Menlo","Consolas","M=
onaco",monospace;white-space:pre-wrap;clear:both;padding:4px 0;margin:=
0"><div style=3D"padding:0 8px;margin:0 4px;background:rgba(151,234,151,.6)=
"><span style=3D"color:#aa4000">private</span> <span style=3D"color:#a0a000=
">slots</span><span class=3D"m_-6474837965500889947m_-1559966478301566634p"=
>:</span>
</div><div style=3D"padding:0 8px;margin:0 4px;background:rgba(151,234,151,=
.6)"> <span style=3D"color:#aa4000">void</span> <span class=3D"m_-647483=
7965500889947m_-1559966478301566634n">CryptTest</span><span class=3D"m_-647=
4837965500889947m_-1559966478301566634p">();</span>
</div><div style=3D"padding:0 8px;margin:0 4px;background:rgba(151,234,151,=
.6)"><span class=3D"m_-6474837965500889947m_-1559966478301566634p">};</span=
>
</div></div></div>
<div style=3D"margin:8px 0;padding:0 12px"><p style=3D"padding:0;margin:8px=
">Make this test data-driven.<br>
Link: <a href=3D"http://doc.qt.io/qt-5/qttestlib-tutorial2-example.html" cl=
ass=3D"m_-6474837965500889947m_-1559966478301566634remarkup-link" rel=3D"no=
referrer" target=3D"_blank">http://doc.qt.io/qt-5/qttestli<wbr>b-tutorial2-=
example.html</a></p></div></div></div></div></div><br><div><strong>REVISION=
DETAIL</strong><div><a href=3D"https://phabricator.kde.org/D10160" rel=3D"=
noreferrer" target=3D"_blank">https://phabricator.kde.org/D1<wbr>0160</a></=
div></div><br><div><strong>To: </strong>himanshuvishwakarma, vijaykrishnava=
nshi, pali, Kopete<br><strong>Cc: </strong>cochise<br></div></div></div></b=
lockquote></div><br></div></div>
--001a1147f11aa64f7d056411e50a--