Skip to content

Commit 91f3a22

Browse files
committed
unit tests for verilog_typename(...)
1 parent 35a560e commit 91f3a22

File tree

2 files changed

+24
-0
lines changed

2 files changed

+24
-0
lines changed

unit/Makefile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ SRC += smvlang/expr2smv.cpp \
1111
temporal-logic/sva_to_ltl.cpp \
1212
temporal-logic/nnf.cpp \
1313
temporal-logic/trivial_sva.cpp \
14+
verilog/typename.cpp \
1415
# Empty last line
1516

1617
INCLUDES= -I ../src/ -I . -I $(CPROVER_DIR)/unit -I $(CPROVER_DIR)/src

unit/verilog/typename.cpp

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
/*******************************************************************\
2+
3+
Module: $typename Unit Tests
4+
5+
Author: Daniel Kroening, Amazon, dkr@amazon.com
6+
7+
\*******************************************************************/
8+
9+
#include <testing-utils/use_catch.h>
10+
#include <verilog/typename.h>
11+
#include <verilog/verilog_types.h>
12+
13+
SCENARIO("$typename(...)")
14+
{
15+
GIVEN("various Verilog types")
16+
{
17+
REQUIRE(verilog_typename(verilog_chandle_typet{}) == "chandle");
18+
REQUIRE(verilog_typename(verilog_real_typet{}) == "real");
19+
REQUIRE(
20+
verilog_typename(verilog_signedbv_typet{10}) == "logic signed[9:0]");
21+
REQUIRE(verilog_typename(verilog_shortreal_typet{}) == "shortreal");
22+
}
23+
}

0 commit comments

Comments
 (0)