summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorTavian Barnes <tavianator@gmail.com>2010-03-03 23:35:31 -0500
committerTavian Barnes <tavianator@gmail.com>2010-03-03 23:35:31 -0500
commit79d0dd0f54d459467dfe88fba68d4b64a461c187 (patch)
tree83c98e136ef5f23c47e5f205fbdcaa8b6d3baf62 /tests
parentc497ac253504a73fbbb35788ddd8faec1163248a (diff)
downloadlibsandglass-79d0dd0f54d459467dfe88fba68d4b64a461c187.tar.xz
Make the API not suck.
Seriously, not sure what I was thinking with the attributes type.
Diffstat (limited to 'tests')
-rw-r--r--tests/introspective-cputime.c5
-rw-r--r--tests/introspective-system.c5
-rw-r--r--tests/monotonic-cputime.c5
-rw-r--r--tests/monotonic-realticks.c3
-rw-r--r--tests/monotonic-system.c5
-rw-r--r--tests/noprecache.c5
6 files changed, 11 insertions, 17 deletions
diff --git a/tests/introspective-cputime.c b/tests/introspective-cputime.c
index 7ce9a36..3f4158e 100644
--- a/tests/introspective-cputime.c
+++ b/tests/introspective-cputime.c
@@ -29,17 +29,16 @@ int
main()
{
sandglass_t sandglass;
- sandglass_attributes_t attr = { SANDGLASS_INTROSPECTIVE, SANDGLASS_CPUTIME };
struct timespec tosleep = { .tv_sec = 0, .tv_nsec = 111111111L };
- if (sandglass_create(&sandglass, &attr, &attr) != 0) {
+ if (sandglass_init_introspective(&sandglass, SANDGLASS_CPUTIME) != 0) {
perror("sandglass_create()");
return EXIT_FAILURE;
}
sandglass_bench(&sandglass, sandglass_spin(&tosleep));
- printf("%.15g\n", sandglass.grains/sandglass.resolution);
+ printf("%.15g\n", sandglass.grains/sandglass.freq);
return EXIT_SUCCESS;
}
diff --git a/tests/introspective-system.c b/tests/introspective-system.c
index 81e3397..5dee23a 100644
--- a/tests/introspective-system.c
+++ b/tests/introspective-system.c
@@ -29,17 +29,16 @@ int
main()
{
sandglass_t sandglass;
- sandglass_attributes_t attr = { SANDGLASS_INTROSPECTIVE, SANDGLASS_SYSTEM };
struct timespec tosleep = { .tv_sec = 0, .tv_nsec = 111111111L };
- if (sandglass_create(&sandglass, &attr, &attr) != 0) {
+ if (sandglass_init_introspective(&sandglass, SANDGLASS_SYSTEM) != 0) {
perror("sandglass_create()");
return EXIT_FAILURE;
}
sandglass_bench(&sandglass, sandglass_spin(&tosleep));
- printf("%.15g\n", sandglass.grains/sandglass.resolution);
+ printf("%.15g\n", sandglass.grains/sandglass.freq);
return EXIT_SUCCESS;
}
diff --git a/tests/monotonic-cputime.c b/tests/monotonic-cputime.c
index d0a7de1..f034df3 100644
--- a/tests/monotonic-cputime.c
+++ b/tests/monotonic-cputime.c
@@ -29,17 +29,16 @@ int
main()
{
sandglass_t sandglass;
- sandglass_attributes_t attr = { SANDGLASS_MONOTONIC, SANDGLASS_CPUTIME };
struct timespec tosleep = { .tv_sec = 0, .tv_nsec = 111111111L };
- if (sandglass_create(&sandglass, &attr, &attr) != 0) {
+ if (sandglass_init_monotonic(&sandglass, SANDGLASS_CPUTIME) != 0) {
perror("sandglass_create()");
return EXIT_FAILURE;
}
sandglass_bench(&sandglass, sandglass_spin(&tosleep));
- printf("%.15g\n", sandglass.grains/sandglass.resolution);
+ printf("%.15g\n", sandglass.grains/sandglass.freq);
return EXIT_SUCCESS;
}
diff --git a/tests/monotonic-realticks.c b/tests/monotonic-realticks.c
index 51404f5..5fff86e 100644
--- a/tests/monotonic-realticks.c
+++ b/tests/monotonic-realticks.c
@@ -30,9 +30,8 @@ int
main()
{
sandglass_t sandglass;
- sandglass_attributes_t attr = { SANDGLASS_MONOTONIC, SANDGLASS_CPUTIME };
- if (sandglass_create(&sandglass, &attr, &attr) != 0) {
+ if (sandglass_init_monotonic(&sandglass, SANDGLASS_CPUTIME) != 0) {
perror("sandglass_create()");
return EXIT_FAILURE;
}
diff --git a/tests/monotonic-system.c b/tests/monotonic-system.c
index 0774908..d8ffba9 100644
--- a/tests/monotonic-system.c
+++ b/tests/monotonic-system.c
@@ -29,17 +29,16 @@ int
main()
{
sandglass_t sandglass;
- sandglass_attributes_t attr = { SANDGLASS_MONOTONIC, SANDGLASS_SYSTEM };
struct timespec tosleep = { .tv_sec = 0, .tv_nsec = 111111111L };
- if (sandglass_create(&sandglass, &attr, &attr) != 0) {
+ if (sandglass_init_monotonic(&sandglass, SANDGLASS_SYSTEM) != 0) {
perror("sandglass_create()");
return EXIT_FAILURE;
}
sandglass_bench(&sandglass, sandglass_spin(&tosleep));
- printf("%.15g\n", sandglass.grains/sandglass.resolution);
+ printf("%.15g\n", sandglass.grains/sandglass.freq);
return EXIT_SUCCESS;
}
diff --git a/tests/noprecache.c b/tests/noprecache.c
index 071920d..e48929d 100644
--- a/tests/noprecache.c
+++ b/tests/noprecache.c
@@ -31,10 +31,9 @@ main()
{
int i = 0;
sandglass_t sandglass;
- sandglass_attributes_t attr = { SANDGLASS_MONOTONIC, SANDGLASS_CPUTIME };
struct timespec tosleep = { .tv_sec = 0, .tv_nsec = 111111111L };
- if (sandglass_create(&sandglass, &attr, &attr) != 0) {
+ if (sandglass_init_monotonic(&sandglass, SANDGLASS_SYSTEM) != 0) {
perror("sandglass_create()");
return EXIT_FAILURE;
}
@@ -49,7 +48,7 @@ main()
"sandglass_bench_noprecache() evaluated routine %d times!\n", i);
}
- printf("%.15g\n", sandglass.grains/sandglass.resolution);
+ printf("%.15g\n", sandglass.grains/sandglass.freq);
return EXIT_SUCCESS;
}