Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
L
LabComm
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Anders Blomdell
LabComm
Commits
7df66f2d
Commit
7df66f2d
authored
10 years ago
by
Anders Blomdell
Browse files
Options
Downloads
Patches
Plain Diff
Introducing typedefs that break assumtions.
parent
12bdaa50
No related branches found
No related tags found
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
lib/c/2014/test/generated_encoding.lc
+2
-1
2 additions, 1 deletion
lib/c/2014/test/generated_encoding.lc
lib/c/2014/test/test_labcomm_generated_encoding.c
+13
-11
13 additions, 11 deletions
lib/c/2014/test/test_labcomm_generated_encoding.c
with
15 additions
and
12 deletions
lib/c/2014/test/generated_encoding.lc
+
2
−
1
View file @
7df66f2d
sample void V;
typedef void v_t;
sample v_t V;
sample byte B;
sample struct {
int i;
...
...
This diff is collapsed.
Click to expand it.
lib/c/2014/test/test_labcomm_generated_encoding.c
+
13
−
11
View file @
7df66f2d
...
...
@@ -214,14 +214,16 @@ int main(void)
labcomm_encoder_register_generated_encoding_V
(
encoder
);
labcomm_encoder_register_generated_encoding_V
(
encoder
);
EXPECT
({
0x02
,
0x06
,
VARIABLE
(
0
),
0x01
,
'V'
,
0x02
,
0x11
,
0x00
,
0x05
,
0x02
,
VARIABLE
(
0
),
LABCOMM_BIND_SELF
});
0x04
,
0x08
,
VARIABLE
(
1
),
0x03
,
'v'
,
'_'
,
't'
,
0x02
,
0x11
,
0x00
,
0x04
,
0x04
,
VARIABLE
(
2
),
0x01
,
'V'
,
VARIABLE
(
1
),
0x05
,
0x02
,
VARIABLE
(
0
),
VARIABLE
(
2
)
});
labcomm_encoder_ioctl
(
encoder
,
IOCTL_WRITER_RESET
);
/* Register twice to make sure that only one registration gets encoded */
labcomm_encoder_register_generated_encoding_B
(
encoder
);
labcomm_encoder_register_generated_encoding_B
(
encoder
);
EXPECT
({
0x02
,
0x05
,
VARIABLE
(
2
),
0x01
,
'B'
,
0x01
,
0x21
,
0x05
,
0x02
,
VARIABLE
(
2
),
LABCOMM_BIND_SELF
});
EXPECT
({
0x02
,
0x05
,
VARIABLE
(
3
),
0x01
,
'B'
,
0x01
,
0x21
,
0x05
,
0x02
,
VARIABLE
(
3
),
LABCOMM_BIND_SELF
});
labcomm_encoder_ioctl
(
encoder
,
IOCTL_WRITER_RESET
);
/* Register twice to make sure that only one registration gets encoded */
...
...
@@ -236,7 +238,7 @@ int main(void)
labcomm_signature_generated_encoding_V
);
labcomm_encoder_sample_ref_register
(
encoder
,
labcomm_signature_generated_encoding_V
);
EXPECT
({
0x03
,
0x06
,
VARIABLE
(
6
),
0x01
,
'V'
,
0x02
,
0x11
,
0x00
});
EXPECT
({
0x03
,
0x06
,
VARIABLE
(
5
),
0x01
,
'V'
,
0x02
,
0x11
,
0x00
});
labcomm_encoder_ioctl
(
encoder
,
IOCTL_WRITER_RESET
);
/* Register twice to make sure that only one registration gets encoded */
...
...
@@ -244,7 +246,7 @@ int main(void)
labcomm_signature_generated_encoding_B
);
labcomm_encoder_sample_ref_register
(
encoder
,
labcomm_signature_generated_encoding_B
);
EXPECT
({
0x03
,
0x05
,
VARIABLE
(
7
),
0x01
,
'B'
,
0x01
,
0x21
});
EXPECT
({
0x03
,
0x05
,
VARIABLE
(
6
),
0x01
,
'B'
,
0x01
,
0x21
});
labcomm_encoder_ioctl
(
encoder
,
IOCTL_WRITER_RESET
);
/* Register twice to make sure that only one registration gets encoded */
...
...
@@ -252,16 +254,16 @@ int main(void)
labcomm_signature_generated_encoding_R
);
labcomm_encoder_sample_ref_register
(
encoder
,
labcomm_signature_generated_encoding_R
);
EXPECT
({
0x03
,
0x08
,
VARIABLE
(
8
),
0x01
,
'R'
,
0x04
,
0x10
,
0x01
,
0x04
,
0x28
});
EXPECT
({
0x03
,
0x08
,
VARIABLE
(
7
),
0x01
,
'R'
,
0x04
,
0x10
,
0x01
,
0x04
,
0x28
});
labcomm_encoder_ioctl
(
encoder
,
IOCTL_WRITER_RESET
);
// was: labcomm_encode_generated_encoding_V(encoder, &V);
labcomm_encode_generated_encoding_V
(
encoder
);
EXPECT
({
VARIABLE
(
0
),
0x00
});
EXPECT
({
VARIABLE
(
1
0
),
0x00
});
labcomm_encoder_ioctl
(
encoder
,
IOCTL_WRITER_RESET
);
labcomm_encode_generated_encoding_B
(
encoder
,
&
B
);
EXPECT
({
VARIABLE
(
2
),
0x01
,
1
});
EXPECT
({
VARIABLE
(
2
0
),
0x01
,
1
});
labcomm_encoder_ioctl
(
encoder
,
IOCTL_WRITER_RESET
);
R
.
a
[
0
]
=
labcomm_signature_generated_encoding_V
;
...
...
@@ -269,10 +271,10 @@ int main(void)
R
.
a
[
2
]
=
labcomm_signature_generated_encoding_UnusedE
;
R
.
a
[
3
]
=
labcomm_signature_generated_encoding_R
;
labcomm_encode_generated_encoding_R
(
encoder
,
&
R
);
EXPECT
({
VARIABLE
(
4
),
0x10
,
0x00
,
0x00
,
0x00
,
VARIABLE
(
0
),
0x00
,
0x00
,
0x00
,
VARIABLE
(
2
),
EXPECT
({
VARIABLE
(
4
),
0x10
,
0x00
,
0x00
,
0x00
,
VARIABLE
(
5
),
0x00
,
0x00
,
0x00
,
VARIABLE
(
6
),
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
VARIABLE
(
4
)});
0x00
,
0x00
,
0x00
,
VARIABLE
(
7
)});
return
0
;
}
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment