MCPcopy Create free account
hub / github.com/chipsalliance/Surelog / TEST

Function TEST

src/Expression/ExprBuilder_test.cpp:33–76  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

31
32namespace {
33TEST(ExprBuilderTest, BasicValueOp) {
34 {
35 LValue v0, v1, v2;
36 v1.set((int64_t)1);
37 v2.set((int64_t)0);
38 v0.bitwAnd(&v1, &v2);
39 EXPECT_EQ(v0.getValueL(), 0);
40 }
41
42 {
43 LValue v0, v1, v2;
44 v1.set((int64_t)1);
45 v2.set((int64_t)0);
46 v0.bitwOr(&v1, &v2);
47 EXPECT_EQ(v0.getValueL(), 1);
48 }
49 {
50 LValue v0, v1;
51 v1.set((int64_t)1);
52 v0.u_not(&v1);
53 EXPECT_EQ(v0.getValueL(), 0);
54 }
55 {
56 LValue v0, v1, v2;
57 v1.set((int64_t)-1);
58 v2.set((int64_t)1);
59 v0.plus(&v1, &v2);
60 EXPECT_EQ(v0.getValueL(), 0);
61 }
62 {
63 LValue v0, v1, v2;
64 v1.set((int64_t)-10);
65 v2.set((int64_t)9);
66 v0.plus(&v1, &v2);
67 EXPECT_EQ(v0.getValueL(), -1);
68 EXPECT_EQ(v0.uhdmValue(), "INT:-1");
69 }
70 {
71 ValueFactory factory;
72 std::unique_ptr<Value> v0(factory.newStValue());
73 v0->set("BLAH");
74 EXPECT_EQ(v0->uhdmValue(), "STRING:BLAH");
75 }
76}
77TEST(ExprBuilderTest, BuildFrom) {
78 {
79 ExprBuilder builder;

Callers

nothing calls this directly

Calls 15

uhdmValueMethod · 0.80
newStValueMethod · 0.80
fromVpiValueMethod · 0.80
fromStringMethod · 0.80
equivMethod · 0.80
evalExprMethod · 0.80
setMethod · 0.45
bitwAndMethod · 0.45
getValueLMethod · 0.45
bitwOrMethod · 0.45
u_notMethod · 0.45
plusMethod · 0.45

Tested by

no test coverage detected