Skip to content

Commit 6217c96

Browse files
authored
Merge pull request #322 from pllab/tests
Updating some tests
2 parents 97394bd + b73e3ab commit 6217c96

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

tests/test_signed.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -153,11 +153,11 @@ def test_basic_signed_add(self):
153153
# 0 1 2 3 -4 -3 -2 -1
154154
self.check_trace('-3 -2 -1 0 -7 -6 -5 -4')
155155

156-
def test_basic_signed_add(self):
157-
self.o <<= pyrtl.signed_add(self.r, Const(-3, signed=True))
156+
def test_basic_signed_add_signed_const(self):
157+
self.o <<= pyrtl.signed_add(self.r, pyrtl.Const(-3, signed=True))
158158
self.check_trace('-3 -2 -1 0 -7 -6 -5 -4')
159159

160-
def test_basic_signed_add(self):
160+
def test_basic_signed_add_neg_integer(self):
161161
self.o <<= pyrtl.signed_add(self.r, -3)
162162
self.check_trace('-3 -2 -1 0 -7 -6 -5 -4')
163163

@@ -169,21 +169,21 @@ def test_basic_signed_mult(self):
169169
# extend the inputs, truncate to the last 4 digits and then sign extend,
170170
# the output I assure that they are indeed correct. :)
171171

172-
def test_basic_signed_mult(self):
172+
def test_basic_signed_mult_const_with_bitwidth(self):
173173
self.o <<= pyrtl.signed_mult(self.r, pyrtl.Const(-2, bitwidth=3))
174174
# 0 1 2 3 -4 -3 -2 -1
175175
self.check_trace('0 -2 -4 -6 -8 6 4 2')
176176
# this one is multiplies by -2 and the trend is easier to see (-4 x -3 does
177177
# overflow the 4 bits though).
178178

179-
def test_basic_signed_mult(self):
179+
def test_basic_signed_mult_signed_const(self):
180180
self.o <<= pyrtl.signed_mult(self.r, pyrtl.Const(-2, signed=True))
181181
self.check_trace('0 -2 -4 -6 -8 6 4 2')
182182

183-
def test_basic_signed_mult(self):
183+
def test_basic_signed_mult_neg_integer(self):
184184
self.o <<= pyrtl.signed_mult(self.r, -2)
185185
self.check_trace('0 -2 -4 -6 -8 6 4 2')
186186

187-
def test_basic_signed_mult(self):
187+
def test_basic_signed_mult_commutative(self):
188188
self.o <<= pyrtl.signed_mult(-2, self.r)
189189
self.check_trace('0 -2 -4 -6 -8 6 4 2')

0 commit comments

Comments
 (0)