Skip to content

Commit

Permalink
Test harness: 64bit warnings fixes.
Browse files Browse the repository at this point in the history
  • Loading branch information
pulkomandy committed Oct 1, 2014
1 parent d5f1b89 commit a8f520f
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 6 deletions.
2 changes: 1 addition & 1 deletion src/tools/cppunit/BTestCase.cpp
Expand Up @@ -25,7 +25,7 @@ _EXPORT
void
BTestCase::NextSubTest() {
if (BTestShell::GlobalBeVerbose()) {
printf("[%ld]", fSubTestNum++);
printf("[%" B_PRId32 "]", fSubTestNum++);
fflush(stdout);
}
}
Expand Down
20 changes: 15 additions & 5 deletions src/tools/cppunit/ThreadedTestCase.cpp
Expand Up @@ -17,20 +17,21 @@ BThreadedTestCase::BThreadedTestCase(string name, string progressSeparator)
{
}


_EXPORT
BThreadedTestCase::~BThreadedTestCase() {
// Kill our locker
delete fUpdateLock;

// Clean up
for (map<thread_id, ThreadSubTestInfo*>::iterator i = fNumberMap.begin();
i != fNumberMap.end();
i++)
i != fNumberMap.end(); i++)
{
delete i->second;
}
}


_EXPORT
void
BThreadedTestCase::NextSubTest() {
Expand All @@ -45,8 +46,9 @@ BThreadedTestCase::NextSubTest() {
// Handle multi-threaded case
ThreadSubTestInfo *info = i->second;
char num[32];
sprintf(num, "%ld", info->subTestNum++);
string str = string("[") + info->name + fProgressSeparator + num + "]";
sprintf(num, "%" B_PRId32 "", info->subTestNum++);
string str = string("[") + info->name + fProgressSeparator + num
+ "]";
fUpdateList.push_back(str);
return;
}
Expand All @@ -56,6 +58,7 @@ BThreadedTestCase::NextSubTest() {
BTestCase::NextSubTest();
}


_EXPORT
void
BThreadedTestCase::Outputf(const char *str, ...) {
Expand All @@ -76,7 +79,9 @@ BThreadedTestCase::Outputf(const char *str, ...) {
} else {
va_list args;
va_start(args, str);
char msg[1024]; // Need a longer string? Change the constant or change the function. :-)
char msg[1024];
// FIXME Need a longer string? Change the constant or change the
// function. :-)
vsprintf(msg, str, args);
va_end(args);
{
Expand All @@ -88,6 +93,7 @@ BThreadedTestCase::Outputf(const char *str, ...) {
}
}


_EXPORT
void
BThreadedTestCase::InitThreadInfo(thread_id id, string threadName) {
Expand All @@ -105,6 +111,7 @@ BThreadedTestCase::InitThreadInfo(thread_id id, string threadName) {
}
}


_EXPORT
bool
BThreadedTestCase::RegisterForUse() {
Expand All @@ -115,19 +122,22 @@ BThreadedTestCase::RegisterForUse() {
return false;
}


_EXPORT
void
BThreadedTestCase::UnregisterForUse() {
fInUse = false;
}


_EXPORT
vector<string>&
BThreadedTestCase::AcquireUpdateList() {
fUpdateLock->Lock();
return fUpdateList;
}


_EXPORT
void
BThreadedTestCase::ReleaseUpdateList() {
Expand Down

0 comments on commit a8f520f

Please sign in to comment.