Bug 1060419 - make netwerk/test/TestFileInput2.cpp use Printf.h; r?froydnj
MozReview-Commit-ID: 7cs5Q1XJTsm
--- a/netwerk/test/TestFileInput2.cpp
+++ b/netwerk/test/TestFileInput2.cpp
@@ -16,17 +16,17 @@
#include "nsIFileChannel.h"
#include "nsIFile.h"
#include "nsNetUtil.h"
#include <stdio.h>
////////////////////////////////////////////////////////////////////////////////
#include <math.h>
-#include "prprf.h"
+#include "mozilla/Printf.h"
#include "nsAutoLock.h"
class nsTimeSampler {
public:
nsTimeSampler();
void Reset();
void StartTime();
void EndTime();
@@ -84,19 +84,19 @@ nsTimeSampler::AddTime(PRIntervalTime ti
char*
nsTimeSampler::PrintStats()
{
double mean = mTotalTime / mCount;
double variance = fabs(mSquares / mCount - mean * mean);
double stddev = sqrt(variance);
uint32_t imean = (uint32_t)mean;
uint32_t istddev = (uint32_t)stddev;
- return PR_smprintf("%d +/- %d ms",
- PR_IntervalToMilliseconds(imean),
- PR_IntervalToMilliseconds(istddev));
+ return mozilla::Smprintf("%d +/- %d ms",
+ PR_IntervalToMilliseconds(imean),
+ PR_IntervalToMilliseconds(istddev));
}
////////////////////////////////////////////////////////////////////////////////
nsTimeSampler gTimeSampler;
typedef nsresult (*CreateFun)(nsIRunnable* *result,
nsIFile* inPath,
@@ -393,18 +393,18 @@ Test(CreateFun create, uint32_t count,
done:
NS_ASSERTION(rv == NS_OK, "failed");
testTime.EndTime();
char* testStats = testTime.PrintStats();
char* workerStats = gTimeSampler.PrintStats();
printf(" threads = %d\n work time = %s,\n test time = %s\n",
i, workerStats, testStats);
- PR_smprintf_free(workerStats);
- PR_smprintf_free(testStats);
+ mozilla::SmprintfFree(workerStats);
+ mozilla::SmprintfFree(testStats);
}
////////////////////////////////////////////////////////////////////////////////
int
main(int argc, char* argv[])
{
nsresult rv;