Skip to content

Commit b39e911

Browse files
ralphlangesimon-ess
authored andcommitted
Fix tests
- remove compiler warnings (buffer initialization) - move braces in the right positions
1 parent 74d067d commit b39e911

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

test/caPutJsonLogTest.cpp

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -93,11 +93,9 @@ static std::string incLogMsg;
9393

9494
static void readFromClient(void *pParam)
9595
{
96-
char recvbuf[BUFFER_SIZE];
96+
char recvbuf[BUFFER_SIZE] = {0};
9797
int recvLength;
98-
std::string
9998

100-
memset(recvbuf, 0, BUFFER_SIZE);
10199
recvLength = recv(insock, recvbuf, BUFFER_SIZE, 0);
102100
if (recvLength > 0) {
103101
incLogMsg.append(recvbuf, recvLength);
@@ -536,12 +534,12 @@ void testDbf(const char *pv, chtype type,
536534
"%s - %s - elem %lu exp '%s' act '%s'", testPrefix, "New value check 1",
537535
i, "Nan", json.newVal.at(i).c_str());
538536
}
539-
else if (isinf(*(value1 + i) && *(value1 + i) > 0)) {
537+
else if (isinf(*(value1 + i)) && *(value1 + i) > 0) {
540538
testOk(!json.newVal.at(i).compare("Infinity"),
541539
"%s - %s - elem %lu exp '%s' act '%s'", testPrefix, "New value check 1",
542540
i, "Infinity", json.newVal.at(i).c_str());
543541
}
544-
else if (isinf(*(value1 + i) && *(value1 + i) < 0)) {
542+
else if (isinf(*(value1 + i)) && *(value1 + i) < 0) {
545543
testOk(!json.newVal.at(i).compare("-Infinity"),
546544
"%s - %s - elem %lu exp '%s' act '%s'", testPrefix, "New value check 1",
547545
i, "-Infinity", json.newVal.at(i).c_str());

0 commit comments

Comments
 (0)