You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
56 lines
3.1 KiB
56 lines
3.1 KiB
From e10e50b1bf37a275757de6b4c3f9791c5ef64742 Mon Sep 17 00:00:00 2001
|
|
From: David Tardon <dtardon@redhat.com>
|
|
Date: Wed, 18 Nov 2015 13:25:22 +0100
|
|
Subject: [PATCH] fix build on OS X
|
|
|
|
Change-Id: If979903fd6877f1b2f562695399e4cbe97efea2c
|
|
---
|
|
src/test/LibetonyekUtilsTest.cpp | 24 ++++++++++++------------
|
|
1 file changed, 12 insertions(+), 12 deletions(-)
|
|
|
|
diff --git a/src/test/LibetonyekUtilsTest.cpp b/src/test/LibetonyekUtilsTest.cpp
|
|
index 5c7af4c..5b6a7c6 100644
|
|
--- a/src/test/LibetonyekUtilsTest.cpp
|
|
+++ b/src/test/LibetonyekUtilsTest.cpp
|
|
@@ -73,12 +73,12 @@ void LibetonyekUtilsTest::tearDown()
|
|
|
|
void LibetonyekUtilsTest::testReadSVar()
|
|
{
|
|
- CPPUNIT_ASSERT_EQUAL(0L, readSVar(makeStream("\x0", 1)));
|
|
- CPPUNIT_ASSERT_EQUAL(-1L, readSVar(makeStream("\x1", 1)));
|
|
- CPPUNIT_ASSERT_EQUAL(1L, readSVar(makeStream("\x2", 1)));
|
|
- CPPUNIT_ASSERT_EQUAL(-2L, readSVar(makeStream("\x3", 1)));
|
|
- CPPUNIT_ASSERT_EQUAL(0x7fffffffL, readSVar(makeStream("\xfe\xff\xff\xff\xf", 5)));
|
|
- CPPUNIT_ASSERT_EQUAL(-0x80000000L, readSVar(makeStream("\xff\xff\xff\xff\xf", 5)));
|
|
+ CPPUNIT_ASSERT_EQUAL(int64_t(0), readSVar(makeStream("\x0", 1)));
|
|
+ CPPUNIT_ASSERT_EQUAL(int64_t(-1), readSVar(makeStream("\x1", 1)));
|
|
+ CPPUNIT_ASSERT_EQUAL(int64_t(1), readSVar(makeStream("\x2", 1)));
|
|
+ CPPUNIT_ASSERT_EQUAL(int64_t(-2), readSVar(makeStream("\x3", 1)));
|
|
+ CPPUNIT_ASSERT_EQUAL(int64_t(0x7fffffffL), readSVar(makeStream("\xfe\xff\xff\xff\xf", 5)));
|
|
+ CPPUNIT_ASSERT_EQUAL(int64_t(-0x80000000L), readSVar(makeStream("\xff\xff\xff\xff\xf", 5)));
|
|
CPPUNIT_ASSERT_EQUAL(numeric_limits<int64_t>::max(), readSVar(makeStream("\xfe\xff\xff\xff\xff\xff\xff\xff\xff\x1", 10)));
|
|
CPPUNIT_ASSERT_EQUAL(numeric_limits<int64_t>::min(), readSVar(makeStream("\xff\xff\xff\xff\xff\xff\xff\xff\xff\x1", 10)));
|
|
CPPUNIT_ASSERT_THROW(readSVar(makeStream("\x80\x80\x80\x80\x80\x80\x80\x80\x80\x2", 10)), std::range_error);
|
|
@@ -90,12 +90,12 @@ void LibetonyekUtilsTest::testReadSVar()
|
|
|
|
void LibetonyekUtilsTest::testReadUVar()
|
|
{
|
|
- CPPUNIT_ASSERT_EQUAL(0UL, readUVar(makeStream("\x0", 1)));
|
|
- CPPUNIT_ASSERT_EQUAL(1UL, readUVar(makeStream("\x1", 1)));
|
|
- CPPUNIT_ASSERT_EQUAL(0x7fUL, readUVar(makeStream("\x7f", 1)));
|
|
- CPPUNIT_ASSERT_EQUAL(0x80UL, readUVar(makeStream("\x80\x1", 2)));
|
|
- CPPUNIT_ASSERT_EQUAL(0x81UL, readUVar(makeStream("\x81\x1", 2)));
|
|
- CPPUNIT_ASSERT_EQUAL(0x12345678UL, readUVar(makeStream("\xf8\xac\xd1\x91\x01", 5)));
|
|
+ CPPUNIT_ASSERT_EQUAL(uint64_t(0), readUVar(makeStream("\x0", 1)));
|
|
+ CPPUNIT_ASSERT_EQUAL(uint64_t(1), readUVar(makeStream("\x1", 1)));
|
|
+ CPPUNIT_ASSERT_EQUAL(uint64_t(0x7f), readUVar(makeStream("\x7f", 1)));
|
|
+ CPPUNIT_ASSERT_EQUAL(uint64_t(0x80), readUVar(makeStream("\x80\x1", 2)));
|
|
+ CPPUNIT_ASSERT_EQUAL(uint64_t(0x81), readUVar(makeStream("\x81\x1", 2)));
|
|
+ CPPUNIT_ASSERT_EQUAL(uint64_t(0x12345678UL), readUVar(makeStream("\xf8\xac\xd1\x91\x01", 5)));
|
|
CPPUNIT_ASSERT_EQUAL(numeric_limits<uint64_t>::max(), readUVar(makeStream("\xff\xff\xff\xff\xff\xff\xff\xff\xff\x1", 10)));
|
|
CPPUNIT_ASSERT_THROW(readUVar(makeStream("\x80\x80\x80\x80\x80\x80\x80\x80\x80\x2", 10)), std::range_error);
|
|
CPPUNIT_ASSERT_THROW(readUVar(makeEmptyStream()), EndOfStreamException);
|
|
--
|
|
2.5.0
|
|
|