From 5e8688c4170c54d31b5444e4d0157ad2ed37f4a2 Mon Sep 17 00:00:00 2001 From: Torsten Ruger Date: Wed, 28 May 2014 21:00:52 +0300 Subject: [PATCH] small fixes to get all the tests to pass/run --- test/arm/test_small_program.rb | 4 ++-- test/fragments/helper.rb | 2 +- test/fragments/test_all.rb | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/test/arm/test_small_program.rb b/test/arm/test_small_program.rb index 0f7f2036..e9c655df 100644 --- a/test/arm/test_small_program.rb +++ b/test/arm/test_small_program.rb @@ -38,7 +38,7 @@ class TestSmallProg < MiniTest::Test b.r1 = hello # address of "hello Raisa" b.r2 = hello.length b.swi 0 #software interupt, ie kernel syscall - @should = [0x0,0xb0,0xa0,0xe3,0x4,0x70,0xa0,0xe3,0x1,0x0,0xa0,0xe3,0x10,0x10,0x8f,0xe2,0x10,0x20,0xa0,0xe3,0x0,0x0,0x0,0xef,0x1,0x70,0xa0,0xe3,0x0,0x0,0x0,0xef,0x0,0x70,0xa0,0xe1,0x48,0x65,0x6c,0x6c,0x6f,0x20,0x52,0x61,0x69,0x73,0x61,0xa,0x0,0x0,0x0,0x0] + @should = [0x0,0xb0,0xa0,0xe3,0x4,0x70,0xa0,0xe3,0x1,0x0,0xa0,0xe3,0x10,0x10,0x8f,0xe2,0x10,0x20,0xa0,0xe3,0x0,0x0,0x0,0xef,0x1,0x70,0xa0,0xe3,0x0,0x0,0x0,0xef,0x0,0x70,0xa0,0xe1,0x48,0x65,0x6c,0x6c,0x6f,0x20,0x52,0x61,0x69,0x73,0x61,0xa,0x20,0x20,0x20,0x20] write "hello" end @@ -53,7 +53,7 @@ class TestSmallProg < MiniTest::Test main.mov( :r1 , :r7 ) putint = @program.get_or_create_function(:putint) @program.main.call( putint ) - @should = [0x0,0xb0,0xa0,0xe3,0xa,0x10,0xa0,0xe3,0x4,0x0,0x0,0xeb,0x7,0x10,0xa0,0xe1,0x22,0x0,0x0,0xeb,0x1,0x70,0xa0,0xe3,0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0,0x51,0xe3,0x1,0x70,0xa0,0xd1,0xe,0xf0,0xa0,0xd1,0x1c,0x40,0x2d,0xe9,0x1,0x30,0xa0,0xe3,0x0,0x40,0xa0,0xe3,0x2,0x20,0x41,0xe2,0x4,0x30,0x83,0xe0,0x4,0x40,0x43,0xe0,0x1,0x20,0x52,0xe2,0xfb,0xff,0xff,0x5a,0x3,0x70,0xa0,0xe1,0x1c,0x80,0xbd,0xe8,0x0,0x80,0xbd,0xe8,0x0,0x40,0x2d,0xe9,0xa,0x30,0x42,0xe2,0x22,0x21,0x42,0xe0,0x22,0x22,0x82,0xe0,0x22,0x24,0x82,0xe0,0x22,0x28,0x82,0xe0,0xa2,0x21,0xa0,0xe1,0x2,0x41,0x82,0xe0,0x84,0x30,0x53,0xe0,0x1,0x20,0x82,0x52,0xa,0x30,0x83,0x42,0x30,0x30,0x83,0xe2,0x0,0x30,0xc1,0xe5,0x1,0x10,0x41,0xe2,0x0,0x0,0x52,0xe3,0xef,0xff,0xff,0x1b,0x0,0x80,0xbd,0xe8,0x0,0x40,0x2d,0xe9,0x1,0x20,0xa0,0xe1,0x20,0x10,0x8f,0xe2,0x9,0x10,0x81,0xe2,0xe9,0xff,0xff,0xeb,0x14,0x10,0x8f,0xe2,0xc,0x20,0xa0,0xe3,0x1,0x0,0xa0,0xe3,0x4,0x70,0xa0,0xe3,0x0,0x0,0x0,0xef,0x0,0x70,0xa0,0xe1,0x0,0x80,0xbd,0xe8,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20] write "fibo" end diff --git a/test/fragments/helper.rb b/test/fragments/helper.rb index 2f046b9c..808c44ca 100644 --- a/test/fragments/helper.rb +++ b/test/fragments/helper.rb @@ -37,7 +37,7 @@ module Fragments writer = Elf::ObjectWriter.new(@program , Elf::Constants::TARGET_ARM) assembly = writer.text # use this for getting the bytes to compare to : - puts assembly + #puts assembly writer.save("#{name}.o") assembly.text.bytes.each_with_index do |byte , index| is = @should[index] diff --git a/test/fragments/test_all.rb b/test/fragments/test_all.rb index d46de967..79f7679c 100644 --- a/test/fragments/test_all.rb +++ b/test/fragments/test_all.rb @@ -4,5 +4,5 @@ require_relative "test_functions" require_relative "test_hello" require_relative "test_if" require_relative "test_putint" -#require_relative "test_recursive_fibo" -require_relative "test_while" +require_relative "test_recursive_fibo" +require_relative "test_while_fibo"