@@ -163,7 +163,11 @@ public void PreProcessMethodIntegrationTest()
163
163
// test
164
164
var r = CodeWriter . PreProcessMethod ( methodDefinition , nanoTablesContext . StringTable ) . ToArray ( ) ;
165
165
166
+ #if DEBUG
166
167
Assert . AreEqual ( "[18,16][24,20][31,25]" , String . Join ( String . Empty , r . Select ( i=> $ "[{ i . Item1 . ToString ( ) } ,{ i . Item2 . ToString ( ) } ]") ) ) ;
168
+ #else
169
+ Assert . AreEqual ( "[14,12][20,16][27,21]" , String . Join ( String . Empty , r . Select ( i=> $ "[{ i . Item1 . ToString ( ) } ,{ i . Item2 . ToString ( ) } ]") ) ) ;
170
+ #endif
167
171
168
172
Assert . IsTrue ( nanoTablesContext . StringTable . GetItems ( ) . ContainsKey ( "blabla" ) ) ;
169
173
}
@@ -425,12 +429,11 @@ public void WriteMethodBodyIntegrationTest()
425
429
} ) ;
426
430
427
431
432
+ #if DEBUG
428
433
var expectedBytesWritten = new byte [ ] { 0x00 , 0x16 , 0x0A , 0x00 , 0x03 , 0x04 , 0x58 , 0x0A , 0x00 , 0xDE , 0x18 , 0x0B , 0x00 , 0x72 , 0x50 , 0x01 , 0x07 , 0x73 , 0x0D , 0x80 , 0x0C , 0x08 , 0x6F , 0x0E , 0x80 , 0x0A , 0x00 , 0xDE , 0x00 , 0x06 , 0x0D , 0x2B , 0x00 , 0x09 , 0x2A , 0x00 , 0x00 , 0x11 , 0x80 , 0x03 , 0x00 , 0x0B , 0x00 , 0x0B , 0x00 , 0x23 , 0x00 , 0x01 } ;
429
- if ( ! nanoTablesContext . AssemblyDefinition . CustomAttributes . Any ( i=> i . AttributeType . FullName == "System.Diagnostics.DebuggableAttribute" ) )
430
- {
431
- // we are in release mode, NOPs are missing
432
- expectedBytesWritten = new byte [ ] { 0x16 , 0x0A , 0x03 , 0x04 , 0x58 , 0x0A , 0xDE , 0x14 , 0x0B , 0x72 , 0x1E - 01 , 0x07 , 0x73 , 0x0C , 0x80 , 0x6F , 0x0D , 0x80 , 0x0A , 0xDE , 0x00 , 0x06 , 0x2A , 0x00 , 0x00 , 0x0F , 0x80 , 0x02 , 0x00 , 0x08 , 0x00 , 0x08 , 0x00 , 0x1C , 0x00 , 0x01 } ;
433
- }
434
+ #else
435
+ var expectedBytesWritten = new byte [ ] { 0x16 , 0x0A , 0x03 , 0x04 , 0x58 , 0x0A , 0xDE , 0x16 , 0x0B , 0x72 , 0x1E , 0x01 , 0x07 , 0x73 , 0x0C , 0x80 , 0x0C , 0x08 , 0x6F , 0x0D , 0x80 , 0x0A , 0xDE , 0x00 , 0x06 , 0x2A , 0x00 , 0x00 , 0x0F , 0x80 , 0x02 , 0x00 , 0x08 , 0x00 , 0x08 , 0x00 , 0x1E , 0x00 , 0x01 } ;
436
+ #endif
434
437
435
438
CollectionAssert . AreEqual ( expectedBytesWritten , bytesWritten , BitConverter . ToString ( bytesWritten ) ) ;
436
439
}
0 commit comments