aboutsummaryrefslogtreecommitdiffhomepage
path: root/test
diff options
context:
space:
mode:
Diffstat (limited to 'test')
-rw-r--r--test/common.h12
-rw-r--r--test/test_devices.cpp16
2 files changed, 14 insertions, 14 deletions
diff --git a/test/common.h b/test/common.h
index 6643b7c..9e5a002 100644
--- a/test/common.h
+++ b/test/common.h
@@ -70,7 +70,7 @@ layout_info const layout_infos[CUBEB_LAYOUT_MAX] = {
int has_available_input_device(cubeb * ctx)
{
- cubeb_device_collection * devices;
+ cubeb_device_collection devices;
int input_device_available = 0;
int r;
/* Bail out early if the host does not have input devices. */
@@ -80,14 +80,14 @@ int has_available_input_device(cubeb * ctx)
return 0;
}
- if (devices->count == 0) {
+ if (devices.count == 0) {
fprintf(stderr, "no input device available, skipping test.\n");
- cubeb_device_collection_destroy(ctx, devices);
+ cubeb_device_collection_destroy(ctx, &devices);
return 0;
}
- for (uint32_t i = 0; i < devices->count; i++) {
- input_device_available |= (devices->device[i]->state ==
+ for (uint32_t i = 0; i < devices.count; i++) {
+ input_device_available |= (devices.device[i].state ==
CUBEB_DEVICE_STATE_ENABLED);
}
@@ -96,7 +96,7 @@ int has_available_input_device(cubeb * ctx)
"available, skipping\n");
}
- cubeb_device_collection_destroy(ctx, devices);
+ cubeb_device_collection_destroy(ctx, &devices);
return !!input_device_available;
}
diff --git a/test/test_devices.cpp b/test/test_devices.cpp
index d0a524d..8bc9190 100644
--- a/test/test_devices.cpp
+++ b/test/test_devices.cpp
@@ -102,14 +102,14 @@ print_device_collection(cubeb_device_collection * collection, FILE * f)
uint32_t i;
for (i = 0; i < collection->count; i++)
- print_device_info(collection->device[i], f);
+ print_device_info(&collection->device[i], f);
}
TEST(cubeb, enumerate_devices)
{
int r;
cubeb * ctx = NULL;
- cubeb_device_collection * collection = NULL;
+ cubeb_device_collection collection;
r = common_init(&ctx, "Cubeb audio test");
ASSERT_EQ(r, CUBEB_OK) << "Error initializing cubeb library";
@@ -128,9 +128,9 @@ TEST(cubeb, enumerate_devices)
}
ASSERT_EQ(r, CUBEB_OK) << "Error enumerating devices " << r;
- fprintf(stdout, "Found %u input devices\n", collection->count);
- print_device_collection(collection, stdout);
- cubeb_device_collection_destroy(ctx, collection);
+ fprintf(stdout, "Found %zu input devices\n", collection.count);
+ print_device_collection(&collection, stdout);
+ cubeb_device_collection_destroy(ctx, &collection);
fprintf(stdout, "Enumerating output devices for backend %s\n",
cubeb_get_backend_id(ctx));
@@ -138,7 +138,7 @@ TEST(cubeb, enumerate_devices)
r = cubeb_enumerate_devices(ctx, CUBEB_DEVICE_TYPE_OUTPUT, &collection);
ASSERT_EQ(r, CUBEB_OK) << "Error enumerating devices " << r;
- fprintf(stdout, "Found %u output devices\n", collection->count);
- print_device_collection(collection, stdout);
- cubeb_device_collection_destroy(ctx, collection);
+ fprintf(stdout, "Found %zu output devices\n", collection.count);
+ print_device_collection(&collection, stdout);
+ cubeb_device_collection_destroy(ctx, &collection);
}