Skip to content

Commit bf3a0f5

Browse files
author
Natasha Yogananda Jeppu
committed
Add regression test for --show-byte-ops parse option
Provides regression tests for the '--show-byte-ops' parse option. This includes an equivalent test run with '--json-ui'.
1 parent 9aa036f commit bf3a0f5

File tree

3 files changed

+37
-0
lines changed

3 files changed

+37
-0
lines changed
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
typedef unsigned char BYTE;
2+
3+
int main()
4+
{
5+
unsigned int value;
6+
BYTE *bp = (BYTE *)(&value);
7+
8+
bp[0] = bp[2];
9+
assert(1);
10+
return 0;
11+
}
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
CORE
2+
main.c
3+
--show-byte-ops
4+
^EXIT=0$
5+
^SIGNAL=0$
6+
^Byte Extracts:$
7+
^.*main\.c line 8 function main$
8+
^.* byte\_extract\_little\_endian\(.*\)$
9+
^Number of byte extracts: 1$
10+
^Byte Updates:$
11+
^.*main\.c line 8 function main$
12+
^.* byte\_update\_little\_endian\(.*\)$
13+
^Number of byte updates: 1$
14+
--
15+
--
16+
To test --show-byte-ops option that displays byte extract and update metrics.
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
CORE
2+
main.c
3+
--show-byte-ops --json-ui
4+
activate-multi-line-match
5+
^EXIT=0$
6+
^SIGNAL=0$
7+
"byteOpsStats": \{\n\s*"byteExtractStats": \{\n\s*"byteExtractList": \[\n\s*\{\n\s*"sourceLocation": \{(\n.*)*\},\n\s*"ssaExpr": \{(\n.*)*\},\n\s*"ssaExprString": ".* .* byte\_extract\_little\_endian\(.*\)"\n\s*\}\n\s*\],\n\s*"numOfExtracts": 1\n\s*\},\n\s*"byteUpdateStats": \{\n\s*"byteUpdateList": \[\n\s*\{\n\s*"sourceLocation": \{(\n.*)*\},\n\s*"ssaExpr": \{(\n.*)*\},\n\s*"ssaExprString": ".* .* byte\_update\_little\_endian\(.*\)"\n\s*\}\n\s*\],\n\s*"numOfUpdates": 1\n\s*\}
8+
--
9+
--
10+
To test json output for --show-byte-ops option that displays byte extract and update metrics.

0 commit comments

Comments
 (0)