-
Notifications
You must be signed in to change notification settings - Fork 0
/
computer_tests_fails.cc
55 lines (48 loc) · 1.83 KB
/
computer_tests_fails.cc
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
#include "computer.h"
#include <array>
#include <iostream>
int main() {
using test_machine = Computer<4, int>;
using too_many = Program<D<Id("a"), Num<42>>, D<Id("b"), Num<42>>, D<Id("c"), Num<42>>, D<Id("d"), Num<42>>, D<Id("e"), Num<42>>>;
test_machine::boot<too_many>();
using too_many_same_name = Program<D<Id("a"), Num<42>>, D<Id("a"), Num<42>>, D<Id("a"), Num<42>>, D<Id("a"), Num<42>>, D<Id("a"), Num<42>>>;
test_machine::boot<too_many_same_name>();
//
// // Test for passing non instruction
//
// using fail_mem = Program<Mem<Num<0>>>;
// using fail_num = Program<Num<0>>;
// using fail_lea = Program<Lea<Id("a")>>;
// using fail_id = Program<Id("a")>;
//
// test_machine::boot<fail_mem>();
// test_machine::boot<fail_num>();
// test_machine::boot<fail_lea>();
// test_machine::boot<fail_id>();
//
// // LValue tests
//
// using fail_l_mov = Program<Mov<Num<0>, Num<0>>>;
// using fail_l_add = Program<Add<Num<0>, Num<0>>>;
// using fail_l_sub = Program<Sub<Num<0>, Num<0>>>;
// using fail_l_inc = Program<Inc<Num<0>>>;
// using fail_l_dec = Program<Dec<Num<0>>>;
// using fail_l_and = Program<And<Num<0>, Num<0>>>;
// using fail_l_or = Program<Or<Num<0>, Num<0>>>;
// using fail_l_not = Program<Not<Num<0>>>;
//
// test_machine::boot<fail_l_mov>();
// test_machine::boot<fail_l_add>();
// test_machine::boot<fail_l_sub>();
// test_machine::boot<fail_l_inc>();
// test_machine::boot<fail_l_dec>();
// test_machine::boot<fail_l_and>();
// test_machine::boot<fail_l_or>();
// test_machine::boot<fail_l_not>();
//
// using fail_not_pvalue = Program<Add<Add<Mem<Num<0>>, Num<69>>, Num<42>>>;
// test_machine::boot<fail_not_pvalue>();
//
// using fail_undeclared_lea = Program<Mov<Lea<Id("a")>, Num<42>>>;
// test_machine::boot<fail_undeclared_lea>();
};