main
test-branch
| Line | |
|---|
| 1 | /* Commandline execution:
|
|---|
| 2 | * civl verify bundleStructComponent.cvl
|
|---|
| 3 | * */
|
|---|
| 4 | #include <civlc.cvh>
|
|---|
| 5 | #include<bundle.cvh>
|
|---|
| 6 |
|
|---|
| 7 | typedef struct foo {
|
|---|
| 8 | int a[5];
|
|---|
| 9 | int b;
|
|---|
| 10 | } foo;
|
|---|
| 11 |
|
|---|
| 12 | void main() {
|
|---|
| 13 | int c[6];
|
|---|
| 14 | foo s;
|
|---|
| 15 | $bundle bun;
|
|---|
| 16 |
|
|---|
| 17 | for (int i = 0; i < 5; i++) {
|
|---|
| 18 | s.a[i] = i*i;
|
|---|
| 19 | }
|
|---|
| 20 | s.b = 25;
|
|---|
| 21 | bun = $bundle_pack(&(s.a), 6*sizeof(int)); // There may be padding, so this should fail.
|
|---|
| 22 | $bundle_unpack(bun, &c);
|
|---|
| 23 | $assert(c[5] == 25);
|
|---|
| 24 | }
|
|---|
Note:
See
TracBrowser
for help on using the repository browser.