Bug 1060419 - make netwerk/test/TestFileInput2.cpp use Printf.h; r?froydnj draft
authorTom Tromey <tom@tromey.com>
Fri, 23 Dec 2016 13:09:34 -0700
changeset 467262 a59adf20ea902ae32269c77f0342fc86fe6082ba
parent 467261 9fe75d5f8fafd93d46b4f5ec9b2c138181ba41c9
child 467263 5305d32f51adbbfe122e83b8acb2e4fee6145ce8
push id43131
push userbmo:ttromey@mozilla.com
push dateFri, 27 Jan 2017 13:26:13 +0000
reviewersfroydnj
bugs1060419
milestone53.0a1
Bug 1060419 - make netwerk/test/TestFileInput2.cpp use Printf.h; r?froydnj MozReview-Commit-ID: 7cs5Q1XJTsm
netwerk/test/TestFileInput2.cpp
--- 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;