aboutsummaryrefslogtreecommitdiffstats
path: root/lv2/lv2plug.in/ns/ext/contexts/test.c
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2012-03-23 01:30:37 +0000
committerDavid Robillard <d@drobilla.net>2012-03-23 01:30:37 +0000
commit97472398f0cfca2d696958520cd7a89b3b7ea3c4 (patch)
tree5bf6571500436ebf9534699a5dfde5d2434023e4 /lv2/lv2plug.in/ns/ext/contexts/test.c
parent5ef77d9bd9b102c76dbef24fbcd006c4534e9fc1 (diff)
downloadlv2-97472398f0cfca2d696958520cd7a89b3b7ea3c4.tar.xz
Remove rotten extensions.
Diffstat (limited to 'lv2/lv2plug.in/ns/ext/contexts/test.c')
-rw-r--r--lv2/lv2plug.in/ns/ext/contexts/test.c67
1 files changed, 0 insertions, 67 deletions
diff --git a/lv2/lv2plug.in/ns/ext/contexts/test.c b/lv2/lv2plug.in/ns/ext/contexts/test.c
deleted file mode 100644
index ca41a10..0000000
--- a/lv2/lv2plug.in/ns/ext/contexts/test.c
+++ /dev/null
@@ -1,67 +0,0 @@
-#include <stdio.h>
-#include <stdint.h>
-#include <stdbool.h>
-#include <limits.h>
-#include <assert.h>
-#include <unistd.h>
-#include "contexts.h"
-
-#define TEST_ASSERT(check) do {\
- if (!(check)) {\
- fprintf(stderr, "Failure at line %d: %s\n", __LINE__, #check);\
- assert(false);\
- _exit(1);\
- }\
-} while (0)
-
-#define NUM_PORTS 64
-
-void
-print_flags(void* flags)
-{
- for (int i = NUM_PORTS; i >= 0; --i)
- printf((lv2_contexts_port_is_valid(flags, i)) ? "1" : "0");
- printf("\n");
-}
-
-
-int
-main()
-{
- uint64_t flags = 0;
- print_flags(&flags);
-
- lv2_contexts_set_port_valid(&flags, 16);
- print_flags(&flags);
- for (int i = 0; i < NUM_PORTS; ++i) {
- if (i == 16) {
- TEST_ASSERT(lv2_contexts_port_is_valid(&flags, i));
- } else {
- TEST_ASSERT(!lv2_contexts_port_is_valid(&flags, i));
- }
- }
-
- lv2_contexts_set_port_valid(&flags, 46);
- lv2_contexts_set_port_valid(&flags, 0);
- print_flags(&flags);
- for (int i = 0; i < NUM_PORTS; ++i) {
- if (i == 0 || i == 16 || i == 46) {
- TEST_ASSERT(lv2_contexts_port_is_valid(&flags, i));
- } else {
- TEST_ASSERT(!lv2_contexts_port_is_valid(&flags, i));
- }
- }
-
- lv2_contexts_unset_port_valid(&flags, 16);
- print_flags(&flags);
- for (int i = 0; i < NUM_PORTS; ++i) {
- if (i == 0 || i == 46) {
- TEST_ASSERT(lv2_contexts_port_is_valid(&flags, i));
- } else {
- TEST_ASSERT(!lv2_contexts_port_is_valid(&flags, i));
- }
- }
-
- return 0;
-}
-