diff carfac/carfac_test.cc @ 646:e76951e4da20

Style fixes. - Fix most lint errors found by http://google-styleguide.googlecode.com/svn/trunk/cpplint/cpplint.py - Clean up commenting style. - Alphabetize #includes and using statements.
author ronw@google.com
date Tue, 11 Jun 2013 20:41:15 +0000
parents 8b70f4cf00c7
children 749b5aed61f6
line wrap: on
line diff
--- a/carfac/carfac_test.cc	Tue Jun 11 17:59:08 2013 +0000
+++ b/carfac/carfac_test.cc	Tue Jun 11 20:41:15 2013 +0000
@@ -20,22 +20,22 @@
 // See the License for the specific language governing permissions and
 // limitations under the License.
 
+#include <fstream>
 #include <string>
-#include <fstream>
 #include <vector>
 
 #include "gtest/gtest.h"
 
+#include "agc.h"
 #include "car.h"
-#include "ihc.h"
-#include "agc.h"
 #include "carfac.h"
 #include "common.h"
+#include "ihc.h"
 
-using std::vector;
-using std::string;
 using std::ifstream;
 using std::ofstream;
+using std::string;
+using std::vector;
 
 // This is the 'test_data' subdirectory of aimc/carfac that specifies where to
 // locate the text files produced by 'CARFAC_GenerateTestData.m' for comparing
@@ -47,7 +47,8 @@
 // Three helper functions are defined here for loading the test data generated
 // by the Matlab version of CARFAC.
 // This loads one-dimensional ArrayXs from single-column text files.
-void WriteNAPOutput(CARFACOutput& output, const string filename, int ear) {
+void WriteNAPOutput(const CARFACOutput& output, const string filename,
+                    int ear) {
   string fullfile = kTestSourceDir + filename;
   ofstream ofile(fullfile.c_str());
   int32_t num_timepoints = output.nap().size();
@@ -56,7 +57,7 @@
     for (int32_t i = 0; i < num_timepoints; ++i) {
       for (int j = 0; j < channels; ++j) {
         ofile << output.nap()[i][ear](j);
-        if ( j < channels - 1) {
+        if (j < channels - 1) {
           ofile << " ";
         }
       }
@@ -145,7 +146,7 @@
   IHCParams ihc_params;
   AGCParams agc_params;
   CARFAC mycf(num_ears, 22050, car_params, ihc_params, agc_params);
-  CARFACOutput my_output(true, false, true, false, false);
+  CARFACOutput my_output(true, true, false, false);
   const bool kOpenLoop = false;
   const int length = sound_data[0].size();
   mycf.RunSegment(sound_data, 0, length, kOpenLoop, &my_output);
@@ -197,7 +198,7 @@
   IHCParams ihc_params;
   AGCParams agc_params;
   CARFAC mycf(num_ears, 44100, car_params, ihc_params, agc_params);
-  CARFACOutput my_output(true, false, true, false, false);
+  CARFACOutput my_output(true, true, false, false);
   const bool kOpenLoop = false;
   const int length = sound_data[0].size();
   mycf.RunSegment(sound_data, 0, length, kOpenLoop, &my_output);
@@ -227,4 +228,4 @@
       ASSERT_NEAR(cplusplus, matlab, kPrecisionLevel);
     }
   }
-}
\ No newline at end of file
+}