Bug 1250648 - Clean up the style of for loops in TestStreamingLexer. r=njn
authorSeth Fowler <mark.seth.fowler@gmail.com>
Fri, 26 Feb 2016 21:01:49 -0800
changeset 322255 67c35da48ad1cdac96d77c5dd33cfab9612971ca
parent 322254 8e93182402a9742f890c722ae8057e724105a21b
child 322256 93a262a768d62f6dc05e00833e43bb99bd974047
push id5913
push userjlund@mozilla.com
push dateMon, 25 Apr 2016 16:57:49 +0000
treeherdermozilla-beta@dcaf0a6fa115 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersnjn
bugs1250648
milestone47.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1250648 - Clean up the style of for loops in TestStreamingLexer. r=njn
image/test/gtest/TestStreamingLexer.cpp
--- a/image/test/gtest/TestStreamingLexer.cpp
+++ b/image/test/gtest/TestStreamingLexer.cpp
@@ -110,17 +110,17 @@ TEST(ImageStreamingLexer, SingleChunkWit
 }
 
 TEST(ImageStreamingLexer, ChunkPerState)
 {
   StreamingLexer<TestState> lexer(Transition::To(TestState::ONE, 3));
   char data[9] = { 1, 2, 3, 1, 2, 3, 1, 2, 3 };
 
   // Test delivering in perfectly-sized chunks, one per state.
-  for (unsigned i = 0 ; i < 3 ; ++i) {
+  for (unsigned i = 0; i < 3; ++i) {
     Maybe<TerminalState> result = lexer.Lex(data + 3 * i, 3, DoLex);
 
     if (i == 2) {
       EXPECT_TRUE(result.isSome());
       EXPECT_EQ(Some(TerminalState::SUCCESS), result);
     } else {
       EXPECT_TRUE(result.isNothing());
     }
@@ -129,17 +129,17 @@ TEST(ImageStreamingLexer, ChunkPerState)
 
 TEST(ImageStreamingLexer, ChunkPerStateWithUnbuffered)
 {
   StreamingLexer<TestState> lexer(Transition::To(TestState::ONE, 3));
   char data[9] = { 1, 2, 3, 1, 2, 3, 1, 2, 3 };
   Vector<char> unbufferedVector;
 
   // Test delivering in perfectly-sized chunks, one per state.
-  for (unsigned i = 0 ; i < 3 ; ++i) {
+  for (unsigned i = 0; i < 3; ++i) {
     Maybe<TerminalState> result =
       lexer.Lex(data + 3 * i, 3,
                 [&](TestState aState, const char* aData, size_t aLength) {
         return DoLexWithUnbuffered(aState, aData, aLength, unbufferedVector);
     });
 
     if (i == 2) {
       EXPECT_TRUE(result.isSome());
@@ -151,17 +151,17 @@ TEST(ImageStreamingLexer, ChunkPerStateW
 }
 
 TEST(ImageStreamingLexer, OneByteChunks)
 {
   StreamingLexer<TestState> lexer(Transition::To(TestState::ONE, 3));
   char data[9] = { 1, 2, 3, 1, 2, 3, 1, 2, 3 };
 
   // Test delivering in one byte chunks.
-  for (unsigned i = 0 ; i < 9 ; ++i) {
+  for (unsigned i = 0; i < 9; ++i) {
     Maybe<TerminalState> result = lexer.Lex(data + i, 1, DoLex);
 
     if (i == 8) {
       EXPECT_TRUE(result.isSome());
       EXPECT_EQ(Some(TerminalState::SUCCESS), result);
     } else {
       EXPECT_TRUE(result.isNothing());
     }
@@ -170,17 +170,17 @@ TEST(ImageStreamingLexer, OneByteChunks)
 
 TEST(ImageStreamingLexer, OneByteChunksWithUnbuffered)
 {
   StreamingLexer<TestState> lexer(Transition::To(TestState::ONE, 3));
   char data[9] = { 1, 2, 3, 1, 2, 3, 1, 2, 3 };
   Vector<char> unbufferedVector;
 
   // Test delivering in one byte chunks.
-  for (unsigned i = 0 ; i < 9 ; ++i) {
+  for (unsigned i = 0; i < 9; ++i) {
     Maybe<TerminalState> result =
       lexer.Lex(data + i, 1,
                 [&](TestState aState, const char* aData, size_t aLength) {
         return DoLexWithUnbuffered(aState, aData, aLength, unbufferedVector);
     });
 
     if (i == 8) {
       EXPECT_TRUE(result.isSome());
@@ -242,17 +242,17 @@ TEST(ImageStreamingLexer, TerminateFailu
 }
 
 TEST(ImageStreamingLexer, TerminateUnbuffered)
 {
   StreamingLexer<TestState> lexer(Transition::To(TestState::ONE, 3));
   char data[9] = { 1, 2, 3, 1, 2, 3, 1, 2, 3 };
 
   // Test that Terminate works during an unbuffered read.
-  for (unsigned i = 0 ; i < 9 ; ++i) {
+  for (unsigned i = 0; i < 9; ++i) {
     Maybe<TerminalState> result =
       lexer.Lex(data + i, 1, DoLexWithUnbufferedTerminate);
 
     if (i > 2) {
       EXPECT_TRUE(result.isSome());
       EXPECT_EQ(Some(TerminalState::SUCCESS), result);
     } else {
       EXPECT_TRUE(result.isNothing());