Changeset 4068 for trunk/sources/HeuristicLab.ExtLibs/HeuristicLab.ProtobufCS/0.9.1/ProtobufCS/src/ProtocolBuffers.Test/CodedInputStreamTest.cs
- Timestamp:
- 07/22/10 00:44:01 (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab.ExtLibs/HeuristicLab.ProtobufCS/0.9.1/ProtobufCS/src/ProtocolBuffers.Test/CodedInputStreamTest.cs
r3857 r4068 37 37 using Google.ProtocolBuffers.TestProtos; 38 38 using NUnit.Framework; 39 using System.Diagnostics;40 39 41 40 namespace Google.ProtocolBuffers { … … 98 97 input.ReadRawVarint32(); 99 98 Assert.Fail("Should have thrown an exception."); 100 } catch (InvalidProtocolBufferException e) { 99 } 100 catch (InvalidProtocolBufferException e) { 101 101 Assert.AreEqual(expected.Message, e.Message); 102 102 } … … 106 106 input.ReadRawVarint64(); 107 107 Assert.Fail("Should have thrown an exception."); 108 } catch (InvalidProtocolBufferException e) { 108 } 109 catch (InvalidProtocolBufferException e) { 109 110 Assert.AreEqual(expected.Message, e.Message); 110 111 } … … 114 115 CodedInputStream.ReadRawVarint32(new MemoryStream(data)); 115 116 Assert.Fail("Should have thrown an exception."); 116 } catch (InvalidProtocolBufferException e) { 117 } 118 catch (InvalidProtocolBufferException e) { 117 119 Assert.AreEqual(expected.Message, e.Message); 118 120 } … … 327 329 input.ReadBytes(); 328 330 Assert.Fail("Should have thrown an exception!"); 329 } catch (InvalidProtocolBufferException) { 331 } 332 catch (InvalidProtocolBufferException) { 330 333 // success. 331 334 } 332 335 } 333 336 334 337 private static TestRecursiveMessage MakeRecursiveMessage(int depth) { 335 338 if (depth == 0) { … … 361 364 TestRecursiveMessage.ParseFrom(data65); 362 365 Assert.Fail("Should have thrown an exception!"); 363 } catch (InvalidProtocolBufferException) { 366 } 367 catch (InvalidProtocolBufferException) { 364 368 // success. 365 369 } … … 370 374 TestRecursiveMessage.ParseFrom(input); 371 375 Assert.Fail("Should have thrown an exception!"); 372 } catch (InvalidProtocolBufferException) { 376 } 377 catch (InvalidProtocolBufferException) { 373 378 // success. 374 379 } … … 386 391 TestAllTypes.ParseFrom(input); 387 392 Assert.Fail("Should have thrown an exception!"); 388 } catch (InvalidProtocolBufferException) { 393 } 394 catch (InvalidProtocolBufferException) { 389 395 // success. 390 396 } … … 401 407 input.ReadRawByte(); 402 408 Assert.Fail("Should have thrown an exception!"); 403 } catch (InvalidProtocolBufferException) { 409 } 410 catch (InvalidProtocolBufferException) { 404 411 // Success. 405 412 } … … 411 418 input.ReadRawBytes(16); // Hits limit again. 412 419 Assert.Fail("Should have thrown an exception!"); 413 } catch (InvalidProtocolBufferException) { 420 } 421 catch (InvalidProtocolBufferException) { 414 422 // Success. 415 423 } … … 422 430 /// </summary> 423 431 [Test] 424 public void ReadInvalidUtf8() 432 public void ReadInvalidUtf8() { 425 433 MemoryStream ms = new MemoryStream(); 426 434 CodedOutputStream output = CodedOutputStream.CreateInstance(ms);
Note: See TracChangeset
for help on using the changeset viewer.