Exemple #1
0
        public void ElfReadManul()
        {
            var file = @"C:\Users\ls-mi\Desktop\wave.elf";
            var asm  = new WaveAssembly
            {
                Name = "wave_test"
            };

            asm.AddSegment((".code", Encoding.ASCII.GetBytes("IL_CODE")));
            WaveAssembly.WriteToFile(asm, file);
            var result = WaveAssembly.LoadFromFile(file);
        }
Exemple #2
0
        public void ElfReadTest()
        {
            var file = GetTempFile();
            var asm  = new WaveAssembly
            {
                Name = "wave_test"
            };

            asm.AddSegment((".code", Encoding.ASCII.GetBytes("IL_CODE")));
            WaveAssembly.WriteToFile(asm, file);
            var result = WaveAssembly.LoadFromFile(file);

            var(_, body) = result.sections[0];
            Assert.Equal("IL_CODE", Encoding.ASCII.GetString(body));
            File.Delete(file);
        }