From: Pierre Riteau Date: Tue, 8 Sep 2009 09:53:37 +0000 (+0200) Subject: Fix and improve qint_from_int64_test X-Git-Tag: TizenStudio_2.0_p2.3~7400 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=b47563698cbfe370179816ceb357c67a0b4d7e3c;p=sdk%2Femulator%2Fqemu.git Fix and improve qint_from_int64_test Use a long long integer constant to fix a compilation error (integer constant is too large for 'long' type). Use a better value for testing, as -1 makes the test pass even if qi->value is of type uint32_t, float or double. This was suggested by Reimar Döffinger . Also, make the test fail when qi->value is of type double or float by casting qi->value to int64_t, to avoid value being promoted to the type of qi->value. Signed-off-by: Pierre Riteau Acked-by: Luiz Capitulino Signed-off-by: Aurelien Jarno --- diff --git a/check-qint.c b/check-qint.c index ae5d22f..49887bb 100644 --- a/check-qint.c +++ b/check-qint.c @@ -43,10 +43,10 @@ END_TEST START_TEST(qint_from_int64_test) { QInt *qi; - const int64_t value = 0xffffffffffffffff; + const int64_t value = 0x1234567890abcdefLL; qi = qint_from_int(value); - fail_unless(qi->value == value); + fail_unless((int64_t) qi->value == value); QDECREF(qi); }