-
-
Notifications
You must be signed in to change notification settings - Fork 630
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix WriteCompressedInt32 logic by using the same code as in System.Re…
…flection.Metadata (#958) * Fix WriteCompressedInt32 logic by using the same code as in System.Reflection.Metadata Note: the implementation in SRM uses methods that are not available in netfx 4.0. To make the code work with all platforms supported by Mono.Cecil, I extracted the required methods. * Cleanup whitespaces --------- Co-authored-by: Jb Evain <jb@evain.net>
- Loading branch information
1 parent
8e1ae7b
commit 608fac6
Showing
2 changed files
with
88 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
using Mono.Cecil.PE; | ||
using NUnit.Framework; | ||
|
||
namespace Mono.Cecil.Tests { | ||
public class ByteBufferTests { | ||
[Test] | ||
public void TestLargeIntegerCompressed () | ||
{ | ||
var testee = new ByteBuffer (); | ||
testee.WriteCompressedInt32 (-9076); | ||
testee.position = 0; | ||
var result = testee.ReadCompressedInt32 (); | ||
Assert.AreEqual (-9076, result); | ||
} | ||
} | ||
} |