Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
O
osv
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Verlässliche Systemsoftware
projects
osv
Commits
e5ed5803
Commit
e5ed5803
authored
12 years ago
by
Guy Zana
Browse files
Options
Downloads
Patches
Plain Diff
Add a basic unit-test for the partly implemented callout interface
parent
c913ab05
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
bootfs.manifest
+1
-0
1 addition, 0 deletions
bootfs.manifest
build.mak
+2
-1
2 additions, 1 deletion
build.mak
tests/tst-bsd-callout.c
+42
-0
42 additions, 0 deletions
tests/tst-bsd-callout.c
with
45 additions
and
1 deletion
bootfs.manifest
+
1
−
0
View file @
e5ed5803
...
...
@@ -20,6 +20,7 @@
#/tests/tst-ramdisk.so: ./tests/tst-ramdisk.so
#/tests/tst-vblk.so: ./tests/tst-vblk.so
#/tests/tst-bsd-evh.so: ./tests/tst-bsd-evh.so
/tests/tst-bsd-callout.so: ./tests/tst-bsd-callout.so
/testrunner.so: ./tests/testrunner.so
/java/Hello.class: ./tests/hello/Hello.class
/java.so: java/java.so
...
...
This diff is collapsed.
Click to expand it.
build.mak
+
2
−
1
View file @
e5ed5803
...
...
@@ -71,7 +71,7 @@ do-sys-includes = $(foreach inc, $(sys-includes), -isystem $(inc))
tests
:=
tests/tst-pthread.so tests/tst-ramdisk.so tests/hello/Hello.class
tests
+=
tests/tst-vblk.so tests/bench/bench.jar
tests
+=
tests/tst-bsd-evh.so
tests
+=
tests/tst-bsd-evh.so
tests/tst-bsd-callout.so
tests/hello/Hello.class
:
javabase=tests/hello
...
...
@@ -81,6 +81,7 @@ tests/tst-pthread.so: tests/tst-pthread.o
tests/tst-ramdisk.so
:
tests/tst-ramdisk.o
tests/tst-vblk.so
:
tests/tst-vblk.o
tests/tst-bsd-evh.so
:
tests/tst-bsd-evh.o
tests/tst-bsd-callout.so
:
tests/tst-bsd-callout.o
all
:
loader.img loader.bin
...
...
This diff is collapsed.
Click to expand it.
tests/tst-bsd-callout.c
0 → 100644
+
42
−
0
View file @
e5ed5803
#include
<stdio.h>
#include
<unistd.h>
#include
<bsd/porting/callout.h>
struct
callout
c1
,
c2
;
int
ctr
;
void
aaa
(
void
*
unused
)
{
ctr
++
;
printf
(
"TICK %d
\n
"
,
ctr
);
callout_reset
(
&
c1
,
hz
,
aaa
,
NULL
);
}
void
bbb
(
void
*
unused
)
{
// Stop aaa
printf
(
"SHUT-UP
\n
"
);
_callout_stop_safe
(
&
c1
,
1
);
}
void
test1
(
void
)
{
printf
(
"BSD Callout Test
\n
"
);
ctr
=
0
;
callout_init
(
&
c1
,
1
);
callout_reset
(
&
c1
,
hz
,
aaa
,
NULL
);
callout_init
(
&
c2
,
1
);
callout_reset
(
&
c2
,
10
.
1
*
hz
,
bbb
,
NULL
);
sleep
(
11
);
printf
(
"BSD Callout Test Done
\n
"
);
}
int
main
(
int
argc
,
char
**
argv
)
{
test1
();
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