MCPcopy Index your code
hub / github.com/djhworld/simple-computer / TestAdd2

Function TestAdd2

components/adder_test.go:50–102  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

48}
49
50func TestAdd2(t *testing.T) {
51 a := NewAdd2()
52
53 a.Update(true, true, false)
54
55 if a.sumOut.Get() != false {
56 t.FailNow()
57 }
58
59 if a.carryOut.Get() != true {
60 t.FailNow()
61 }
62
63 a.Update(true, false, false)
64
65 if a.sumOut.Get() != true {
66 t.FailNow()
67 }
68
69 if a.carryOut.Get() != false {
70 t.FailNow()
71 }
72
73 a.Update(false, false, true)
74
75 if a.sumOut.Get() != true {
76 t.FailNow()
77 }
78
79 if a.carryOut.Get() != false {
80 t.FailNow()
81 }
82
83 a.Update(true, true, true)
84
85 if a.sumOut.Get() != true {
86 t.FailNow()
87 }
88
89 if a.carryOut.Get() != true {
90 t.FailNow()
91 }
92
93 a.Update(true, false, true)
94
95 if a.sumOut.Get() != false {
96 t.FailNow()
97 }
98
99 if a.carryOut.Get() != true {
100 t.FailNow()
101 }
102}

Callers

nothing calls this directly

Calls 3

UpdateMethod · 0.95
NewAdd2Function · 0.85
GetMethod · 0.45

Tested by

no test coverage detected