Skip to content
This repository has been archived by the owner on Apr 10, 2024. It is now read-only.

Commit

Permalink
Bug 552329: Fix compile warnings in xpcshell test TestOOM.cpp. r=doug…
Browse files Browse the repository at this point in the history
…t, test-only change on CLOSED TREE to see if tinderbox still wants to be red
  • Loading branch information
dholbert committed Mar 16, 2010
1 parent a393bc1 commit 5eaa541
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions xpcom/tests/TestOOM.cpp
Expand Up @@ -62,6 +62,7 @@ int main(int argc, char **argv)
// the predicate should work with out having to rely on // the predicate should work with out having to rely on
// that. // that.
void *big_alloc = malloc(1024 * 1024 * 16); void *big_alloc = malloc(1024 * 1024 * 16);
(void)big_alloc; // Tell compiler we're not using big_alloc, to fix warning


const int highpower = 500000; const int highpower = 500000;


Expand All @@ -77,10 +78,10 @@ int main(int argc, char **argv)


// You have to touch the buffer // You have to touch the buffer
if (!buffers[i]) if (!buffers[i])
printf("Could not allocate a buffer of size %ld\n", s); printf("Could not allocate a buffer of size %lu\n", (unsigned long)s);
else else
{ {
for (int j=0; j<s; j++) for (size_t j=0; j<s; j++)
buffers[i][j] = 'a'; buffers[i][j] = 'a';
} }


Expand All @@ -89,10 +90,10 @@ int main(int argc, char **argv)
PRIntervalTime cost = PR_IntervalNow() - start; PRIntervalTime cost = PR_IntervalNow() - start;




printf("Total Allocated: %ld. \tLow Memory now? %s\t Took (%d)\n", printf("Total Allocated: %lu. \tLow Memory now? %s\t Took (%d)\n",
s*i, (unsigned long)s*i,
lowMem ? "Yes" : "No", lowMem ? "Yes" : "No",
PR_IntervalToMilliseconds(cost)); PR_IntervalToMilliseconds(cost));


if (lowMem) if (lowMem)
break; break;
Expand Down

0 comments on commit 5eaa541

Please sign in to comment.