CS153/hw2/test/studenttests.ml
jmug b8fc429f4d Fixed version of hw2
Signed-off-by: jmug <u.g.a.mariano@gmail.com>
2025-01-27 19:31:19 -08:00

57 lines
967 B
OCaml

open Util.Assert
open X86
open Sim.Simulator
open Gradedtests
open Asm
(* These tests are provided by you -- they will be graded manually *)
(* You should also add additional test cases here to help you *)
(* debug your program. *)
let test_my =
let bin = [
InsB0 (Movq, Asm.[ ~$42; ~%Rax ]);
InsFrag;
InsFrag;
InsFrag;
InsFrag;
InsFrag;
InsFrag;
InsFrag;
]
in
let asm = [gtext "main"
[
Movq, [~$42; ~%Rax]];
] in
(assert_eqf (fun() -> (assemble asm).text_seg) bin )
let mov_ri =
test_machine
[
InsB0 (Movq, Asm.[ ~$42; ~%Rax ]);
InsFrag;
InsFrag;
InsFrag;
InsFrag;
InsFrag;
InsFrag;
InsFrag;
]
let provided_tests : suite = [
Test ("My Tests", [
("assert", test_my)
]);
Test ("Student-Provided Big Test for Part III: Score recorded as PartIIITestCase", [
]);
]