[Libreoffice-commits] core.git: sal/qa
Miklos Vajna
vmiklos at collabora.co.uk
Fri Jul 1 08:31:46 UTC 2016
sal/qa/OStringBuffer/rtl_OStringBuffer.cxx | 156 ++++++++++++++---------------
1 file changed, 78 insertions(+), 78 deletions(-)
New commits:
commit b020026741d8bdd511c5eb310e3e8b11ce297b61
Author: Miklos Vajna <vmiklos at collabora.co.uk>
Date: Fri Jul 1 09:15:29 2016 +0200
CppunitTest_sal_rtl_ostringbuffer: fix loplugin:cppunitassertequals warnings
Change-Id: I1b7710556f179f35694c05e209854bbcb152041f
Reviewed-on: https://gerrit.libreoffice.org/26842
Reviewed-by: Miklos Vajna <vmiklos at collabora.co.uk>
Tested-by: Jenkins <ci at libreoffice.org>
diff --git a/sal/qa/OStringBuffer/rtl_OStringBuffer.cxx b/sal/qa/OStringBuffer/rtl_OStringBuffer.cxx
index 1571739..9715b29 100644
--- a/sal/qa/OStringBuffer/rtl_OStringBuffer.cxx
+++ b/sal/qa/OStringBuffer/rtl_OStringBuffer.cxx
@@ -384,10 +384,10 @@ namespace rtl_OStringBuffer
::rtl::OStringBuffer aStrBuf( *arrOUS[0] );
sal_Int32 expVal = kTestStr1Len;
- CPPUNIT_ASSERT_MESSAGE
+ CPPUNIT_ASSERT_EQUAL_MESSAGE
(
"length of ascii string",
- aStrBuf.getLength() == expVal
+ expVal, aStrBuf.getLength()
);
}
@@ -397,10 +397,10 @@ namespace rtl_OStringBuffer
::rtl::OStringBuffer aStrBuf( *arrOUS[1] );
sal_Int32 expVal = 1;
- CPPUNIT_ASSERT_MESSAGE
+ CPPUNIT_ASSERT_EQUAL_MESSAGE
(
"length of ascii string of size 1",
- aStrBuf.getLength() == expVal
+ expVal, aStrBuf.getLength()
);
}
@@ -409,10 +409,10 @@ namespace rtl_OStringBuffer
::rtl::OStringBuffer aStrBuf( *arrOUS[2] );
sal_Int32 expVal = 0;
- CPPUNIT_ASSERT_MESSAGE
+ CPPUNIT_ASSERT_EQUAL_MESSAGE
(
"length of empty string",
- aStrBuf.getLength() == expVal
+ expVal, aStrBuf.getLength()
);
}
@@ -421,10 +421,10 @@ namespace rtl_OStringBuffer
::rtl::OStringBuffer aStrBuf( *arrOUS[3] );
sal_Int32 expVal = 0;
- CPPUNIT_ASSERT_MESSAGE
+ CPPUNIT_ASSERT_EQUAL_MESSAGE
(
"length of empty string (empty ascii string arg)",
- aStrBuf.getLength() == expVal
+ expVal, aStrBuf.getLength()
);
}
@@ -433,10 +433,10 @@ namespace rtl_OStringBuffer
::rtl::OStringBuffer aStrBuf( *arrOUS[4] );
sal_Int32 expVal = 1;
- CPPUNIT_ASSERT_MESSAGE
+ CPPUNIT_ASSERT_EQUAL_MESSAGE
(
"length of string with \\0 embedded",
- aStrBuf.getLength() == expVal
+ expVal, aStrBuf.getLength()
);
}
@@ -445,10 +445,10 @@ namespace rtl_OStringBuffer
::rtl::OStringBuffer aStrBuf( *arrOUS[5] );
sal_Int32 expVal = kTestStr2Len;
- CPPUNIT_ASSERT_MESSAGE
+ CPPUNIT_ASSERT_EQUAL_MESSAGE
(
"length(>16) of ascii string",
- aStrBuf.getLength() == expVal
+ expVal, aStrBuf.getLength()
);
}
@@ -457,10 +457,10 @@ namespace rtl_OStringBuffer
::rtl::OStringBuffer aStrBuf;
sal_Int32 expVal = 0;
- CPPUNIT_ASSERT_MESSAGE
+ CPPUNIT_ASSERT_EQUAL_MESSAGE
(
"length of empty string (default constructor)",
- aStrBuf.getLength()== expVal
+ expVal, aStrBuf.getLength()
);
}
@@ -469,10 +469,10 @@ namespace rtl_OStringBuffer
::rtl::OStringBuffer aStrBuf( 26 );
sal_Int32 expVal = 0;
- CPPUNIT_ASSERT_MESSAGE
+ CPPUNIT_ASSERT_EQUAL_MESSAGE
(
"length of empty string (with capacity)",
- aStrBuf.getLength()== expVal
+ expVal, aStrBuf.getLength()
);
}
@@ -515,10 +515,10 @@ namespace rtl_OStringBuffer
::rtl::OStringBuffer aStrBuf( *arrOUS[0] );
sal_Int32 expVal = kTestStr1Len+16;
- CPPUNIT_ASSERT_MESSAGE
+ CPPUNIT_ASSERT_EQUAL_MESSAGE
(
"capacity of ascii string",
- aStrBuf.getCapacity()== expVal
+ expVal, aStrBuf.getCapacity()
);
}
@@ -528,10 +528,10 @@ namespace rtl_OStringBuffer
::rtl::OStringBuffer aStrBuf( *arrOUS[1] );
sal_Int32 expVal = 1+16;
- CPPUNIT_ASSERT_MESSAGE
+ CPPUNIT_ASSERT_EQUAL_MESSAGE
(
"capacity of ascii string of size 1",
- aStrBuf.getCapacity() == expVal
+ expVal, aStrBuf.getCapacity()
);
}
@@ -540,10 +540,10 @@ namespace rtl_OStringBuffer
::rtl::OStringBuffer aStrBuf( *arrOUS[2] );
sal_Int32 expVal = 0+16;
- CPPUNIT_ASSERT_MESSAGE
+ CPPUNIT_ASSERT_EQUAL_MESSAGE
(
"capacity of empty string",
- aStrBuf.getCapacity() == expVal
+ expVal, aStrBuf.getCapacity()
);
}
@@ -552,10 +552,10 @@ namespace rtl_OStringBuffer
::rtl::OStringBuffer aStrBuf( *arrOUS[3] );
sal_Int32 expVal = 0+16;
- CPPUNIT_ASSERT_MESSAGE
+ CPPUNIT_ASSERT_EQUAL_MESSAGE
(
"capacity of empty string (empty ascii string arg)",
- aStrBuf.getCapacity()== expVal
+ expVal, aStrBuf.getCapacity()
);
}
@@ -564,10 +564,10 @@ namespace rtl_OStringBuffer
::rtl::OStringBuffer aStrBuf( *arrOUS[4] );
sal_Int32 expVal = 1+16;
- CPPUNIT_ASSERT_MESSAGE
+ CPPUNIT_ASSERT_EQUAL_MESSAGE
(
"capacity of string with \\0 embedded",
- aStrBuf.getCapacity() == expVal
+ expVal, aStrBuf.getCapacity()
);
}
@@ -576,10 +576,10 @@ namespace rtl_OStringBuffer
::rtl::OStringBuffer aStrBuf( *arrOUS[5] );
sal_Int32 expVal = kTestStr2Len+16;
- CPPUNIT_ASSERT_MESSAGE
+ CPPUNIT_ASSERT_EQUAL_MESSAGE
(
"capacity(>16) of ascii string",
- aStrBuf.getCapacity() == expVal
+ expVal, aStrBuf.getCapacity()
);
}
@@ -588,10 +588,10 @@ namespace rtl_OStringBuffer
::rtl::OStringBuffer aStrBuf;
sal_Int32 expVal = 16;
- CPPUNIT_ASSERT_MESSAGE
+ CPPUNIT_ASSERT_EQUAL_MESSAGE
(
"capacity of empty string (default constructor)",
- aStrBuf.getCapacity() == expVal
+ expVal, aStrBuf.getCapacity()
);
}
@@ -600,10 +600,10 @@ namespace rtl_OStringBuffer
::rtl::OStringBuffer aStrBuf( kNonSInt32Max );
sal_Int32 expVal = kNonSInt32Max;
- CPPUNIT_ASSERT_MESSAGE
+ CPPUNIT_ASSERT_EQUAL_MESSAGE
(
"capacity of empty string (with capacity -2147483648)",
- aStrBuf.getCapacity() == expVal
+ expVal, aStrBuf.getCapacity()
);
}
@@ -612,10 +612,10 @@ namespace rtl_OStringBuffer
::rtl::OStringBuffer aStrBuf( 16 );
sal_Int32 expVal = 16;
- CPPUNIT_ASSERT_MESSAGE
+ CPPUNIT_ASSERT_EQUAL_MESSAGE
(
"capacity of empty string (with capacity 16)",
- aStrBuf.getCapacity() == expVal
+ expVal, aStrBuf.getCapacity()
);
}
@@ -624,10 +624,10 @@ namespace rtl_OStringBuffer
::rtl::OStringBuffer aStrBuf( 6 );
sal_Int32 expVal = 6;
- CPPUNIT_ASSERT_MESSAGE
+ CPPUNIT_ASSERT_EQUAL_MESSAGE
(
"capacity of empty string (with capacity 6)",
- aStrBuf.getCapacity() == expVal
+ expVal, aStrBuf.getCapacity()
);
}
@@ -636,10 +636,10 @@ namespace rtl_OStringBuffer
::rtl::OStringBuffer aStrBuf( 0 );
sal_Int32 expVal = 0;
- CPPUNIT_ASSERT_MESSAGE
+ CPPUNIT_ASSERT_EQUAL_MESSAGE
(
"capacity of empty string (with capacity 0)",
- aStrBuf.getCapacity() == expVal
+ expVal, aStrBuf.getCapacity()
);
}
@@ -648,10 +648,10 @@ namespace rtl_OStringBuffer
::rtl::OStringBuffer aStrBuf( -2 );
sal_Int32 expVal = -2;
- CPPUNIT_ASSERT_MESSAGE
+ CPPUNIT_ASSERT_EQUAL_MESSAGE
(
"capacity of empty string (with capacity -2)",
- aStrBuf.getCapacity() == expVal
+ expVal, aStrBuf.getCapacity()
);
}
@@ -681,10 +681,10 @@ namespace rtl_OStringBuffer
aStrBuf.ensureCapacity( input );
- CPPUNIT_ASSERT_MESSAGE
+ CPPUNIT_ASSERT_EQUAL_MESSAGE
(
"capacity equal to 16, minimum is 5",
- aStrBuf.getCapacity() == expVal
+ expVal, aStrBuf.getCapacity()
);
}
@@ -697,10 +697,10 @@ namespace rtl_OStringBuffer
aStrBuf.ensureCapacity( input );
- CPPUNIT_ASSERT_MESSAGE
+ CPPUNIT_ASSERT_EQUAL_MESSAGE
(
"capacity equal to 16, minimum is -5",
- aStrBuf.getCapacity() == expVal
+ expVal, aStrBuf.getCapacity()
);
}
@@ -713,10 +713,10 @@ namespace rtl_OStringBuffer
aStrBuf.ensureCapacity( input );
- CPPUNIT_ASSERT_MESSAGE
+ CPPUNIT_ASSERT_EQUAL_MESSAGE
(
"capacity equal to 16, minimum is 0",
- aStrBuf.getCapacity() == expVal
+ expVal, aStrBuf.getCapacity()
);
}
@@ -729,10 +729,10 @@ namespace rtl_OStringBuffer
aStrBuf.ensureCapacity( input );
- CPPUNIT_ASSERT_MESSAGE
+ CPPUNIT_ASSERT_EQUAL_MESSAGE
(
"capacity equal to 16, minimum is 20",
- aStrBuf.getCapacity() == expVal
+ expVal, aStrBuf.getCapacity()
);
}
@@ -745,10 +745,10 @@ namespace rtl_OStringBuffer
aStrBuf.ensureCapacity( input );
- CPPUNIT_ASSERT_MESSAGE
+ CPPUNIT_ASSERT_EQUAL_MESSAGE
(
"capacity equal to 16, minimum is 50",
- aStrBuf.getCapacity() == expVal
+ expVal, aStrBuf.getCapacity()
);
}
@@ -761,10 +761,10 @@ namespace rtl_OStringBuffer
aStrBuf.ensureCapacity( input );
- CPPUNIT_ASSERT_MESSAGE
+ CPPUNIT_ASSERT_EQUAL_MESSAGE
(
"capacity equal to 6, minimum is 20",
- aStrBuf.getCapacity() == expVal
+ expVal, aStrBuf.getCapacity()
);
}
@@ -777,10 +777,10 @@ namespace rtl_OStringBuffer
aStrBuf.ensureCapacity( input );
- CPPUNIT_ASSERT_MESSAGE
+ CPPUNIT_ASSERT_EQUAL_MESSAGE
(
"capacity equal to 6, minimum is 2",
- aStrBuf.getCapacity() == expVal
+ expVal, aStrBuf.getCapacity()
);
}
@@ -793,10 +793,10 @@ namespace rtl_OStringBuffer
aStrBuf.ensureCapacity( input );
- CPPUNIT_ASSERT_MESSAGE
+ CPPUNIT_ASSERT_EQUAL_MESSAGE
(
"capacity equal to 6, minimum is -6",
- aStrBuf.getCapacity() == expVal
+ expVal, aStrBuf.getCapacity()
);
}
@@ -809,10 +809,10 @@ namespace rtl_OStringBuffer
aStrBuf.ensureCapacity( input );
- CPPUNIT_ASSERT_MESSAGE
+ CPPUNIT_ASSERT_EQUAL_MESSAGE
(
"capacity equal to 6, minimum is -6",
- aStrBuf.getCapacity() == expVal
+ expVal, aStrBuf.getCapacity()
);
}
@@ -825,10 +825,10 @@ namespace rtl_OStringBuffer
aStrBuf.ensureCapacity( input );
- CPPUNIT_ASSERT_MESSAGE
+ CPPUNIT_ASSERT_EQUAL_MESSAGE
(
"capacity equal to 0, minimum is 6",
- aStrBuf.getCapacity() == expVal
+ expVal, aStrBuf.getCapacity()
);
}
@@ -841,10 +841,10 @@ namespace rtl_OStringBuffer
aStrBuf.ensureCapacity( input );
- CPPUNIT_ASSERT_MESSAGE
+ CPPUNIT_ASSERT_EQUAL_MESSAGE
(
"capacity equal to 0, minimum is 1",
- aStrBuf.getCapacity() == expVal
+ expVal, aStrBuf.getCapacity()
);
}
@@ -857,10 +857,10 @@ namespace rtl_OStringBuffer
aStrBuf.ensureCapacity( input );
- CPPUNIT_ASSERT_MESSAGE
+ CPPUNIT_ASSERT_EQUAL_MESSAGE
(
"capacity equal to 0, minimum is -1",
- aStrBuf.getCapacity() == expVal
+ expVal, aStrBuf.getCapacity()
);
}
@@ -873,10 +873,10 @@ namespace rtl_OStringBuffer
aStrBuf.ensureCapacity( input );
- CPPUNIT_ASSERT_MESSAGE
+ CPPUNIT_ASSERT_EQUAL_MESSAGE
(
"capacity equal to -2147483648, minimum is 65535",
- aStrBuf.getCapacity() == expVal
+ expVal, aStrBuf.getCapacity()
);
}
@@ -889,10 +889,10 @@ namespace rtl_OStringBuffer
aStrBuf.ensureCapacity( input );
- CPPUNIT_ASSERT_MESSAGE
+ CPPUNIT_ASSERT_EQUAL_MESSAGE
(
"capacity equal to -2147483648, minimum is -1",
- aStrBuf.getCapacity() == expVal
+ expVal, aStrBuf.getCapacity()
);
}
@@ -905,10 +905,10 @@ namespace rtl_OStringBuffer
aStrBuf.ensureCapacity( input );
- CPPUNIT_ASSERT_MESSAGE
+ CPPUNIT_ASSERT_EQUAL_MESSAGE
(
"capacity equal to -2147483648, minimum is 0",
- aStrBuf.getCapacity() == expVal
+ expVal, aStrBuf.getCapacity()
);
}
@@ -921,10 +921,10 @@ namespace rtl_OStringBuffer
aStrBuf.ensureCapacity( input );
- CPPUNIT_ASSERT_MESSAGE
+ CPPUNIT_ASSERT_EQUAL_MESSAGE
(
"capacity equal to -2147483648, minimum is -2147483648",
- aStrBuf.getCapacity() == expVal
+ expVal, aStrBuf.getCapacity()
);
}
@@ -1449,11 +1449,11 @@ namespace rtl_OStringBuffer
const sal_Char* pstr = aStrBuf.getStr();
int nEqual = strncmp(pstr, expVal, cmpLen);
- CPPUNIT_ASSERT_MESSAGE
+ CPPUNIT_ASSERT_EQUAL_MESSAGE
(
"test normal string",
/* cmpstr( pstr, expVal, cmpLen ) */
- nEqual == 0
+ 0, nEqual
);
}
@@ -1466,11 +1466,11 @@ namespace rtl_OStringBuffer
const sal_Char* pstr = aStrBuf.getStr();
sal_Int32 nLen = strlen(pstr);
- CPPUNIT_ASSERT_MESSAGE
+ CPPUNIT_ASSERT_EQUAL_MESSAGE
(
"test empty string",
// cmpstr( pstr, &expVal, cmpLen )
- nLen == 0
+ static_cast<sal_Int32>(0), nLen
);
}
@@ -1492,10 +1492,10 @@ namespace rtl_OStringBuffer
const sal_Char* pstr = aStrBuf.getStr();
int nEqual = strncmp(pstr, expVal, cmpLen);
- CPPUNIT_ASSERT_MESSAGE
+ CPPUNIT_ASSERT_EQUAL_MESSAGE
(
"test normal string",
- nEqual == 0
+ 0, nEqual
);
}
More information about the Libreoffice-commits
mailing list