LMMS
Loading...
Searching...
No Matches
lilv_test.c File Reference
#include <assert.h>
#include <ctype.h>
#include <errno.h>
#include <float.h>
#include <limits.h>
#include <math.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <sys/stat.h>
#include <dirent.h>
#include <unistd.h>
#include "lilv/lilv.h"
#include "../src/lilv_internal.h"
#include "lv2/lv2plug.in/ns/ext/presets/presets.h"
#include "lv2/lv2plug.in/ns/ext/state/state.h"
#include "lv2/lv2plug.in/ns/ext/urid/urid.h"

Classes

struct  TestCase

Macros

#define _POSIX_C_SOURCE   200809L /* for setenv */
#define _XOPEN_SOURCE   600 /* for mkstemp */
#define TEST_PATH_MAX   1024
#define SHLIB_EXT   ".so"
#define TEST_CASE(name)
#define TEST_ASSERT(check)
#define PREFIX_ATOM   "@prefix atom: <http://lv2plug.in/ns/ext/atom#> . \n"
#define PREFIX_LINE   "@prefix : <http://example.org/> .\n"
#define PREFIX_LV2   "@prefix lv2: <http://lv2plug.in/ns/lv2core#> .\n"
#define PREFIX_LV2EV   "@prefix lv2ev: <http://lv2plug.in/ns/ext/event#> . \n"
#define PREFIX_LV2UI   "@prefix lv2ui: <http://lv2plug.in/ns/extensions/ui#> .\n"
#define PREFIX_RDF   "@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .\n"
#define PREFIX_RDFS   "@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .\n"
#define PREFIX_FOAF   "@prefix foaf: <http://xmlns.com/foaf/0.1/> .\n"
#define PREFIX_DOAP   "@prefix doap: <http://usefulinc.com/ns/doap#> .\n"
#define PREFIX_PSET   "@prefix pset: <http://lv2plug.in/ns/ext/presets#> .\n"
#define MANIFEST_PREFIXES   PREFIX_LINE PREFIX_LV2 PREFIX_RDFS
#define BUNDLE_PREFIXES   PREFIX_ATOM PREFIX_LINE PREFIX_LV2 PREFIX_RDF PREFIX_RDFS PREFIX_FOAF PREFIX_DOAP PREFIX_PSET
#define PLUGIN_NAME(name)
#define LICENSE_GPL   "doap:license <http://usefulinc.com/doap/licenses/gpl>"

Typedefs

typedef int(* TestFunc) (void)

Functions

static void delete_bundle (void)
static void init_tests (void)
static void fatal_error (const char *err, const char *arg)
static void write_file (const char *name, const char *content)
static int init_world (void)
static int load_all_bundles (void)
static void create_bundle (const char *manifest, const char *content)
static int start_bundle (const char *manifest, const char *content)
static void unload_bundle (void)
static void cleanup (void)
static void init_uris (void)
static void cleanup_uris (void)
static int test_value (void)
static int test_util (void)
static void discovery_verify_plugin (const LilvPlugin *plugin)
static int test_discovery (void)
static int test_lv2_path (void)
static int test_verify (void)
static int test_no_verify (void)
static int test_classes (void)
static int test_plugin (void)
static int test_project (void)
static int test_no_author (void)
static int test_project_no_author (void)
static int test_preset (void)
static int test_prototype (void)
static int test_port (void)
static unsigned ui_supported (const char *container_type_uri, const char *ui_type_uri)
static int test_ui (void)
static const voidget_port_value (const char *port_symbol, void *user_data, uint32_t *size, uint32_t *type)
static void set_port_value (const char *port_symbol, void *user_data, const void *value, uint32_t size, uint32_t type)
static LV2_URID map_uri (LV2_URID_Map_Handle handle, const char *uri)
static const char * unmap_uri (LV2_URID_Map_Handle handle, LV2_URID urid)
static char * lilv_make_path (LV2_State_Make_Path_Handle handle, const char *path)
static int test_state (void)
static int test_bad_port_symbol (void)
static int test_bad_port_index (void)
static int test_string (void)
static int test_world (void)
static int test_reload_bundle (void)
static int test_replace_version (void)
static int test_get_symbol (void)
static void run_tests (void)
int main (int argc, char *argv[])

Variables

static char bundle_dir_name [TEST_PATH_MAX]
static char bundle_dir_uri [TEST_PATH_MAX]
static char manifest_name [TEST_PATH_MAX]
static char content_name [TEST_PATH_MAX]
static LilvWorldworld
int test_count = 0
int error_count = 0
static const char * uris_plugin = "http://example.org/plug"
static LilvNodeplugin_uri_value
static LilvNodeplugin2_uri_value
static int discovery_plugin_found = 0
uint32_t atom_Float = 0
float in = 1.0
float out = 42.0
float control = 1234.0
char ** uris = NULL
size_t n_uris = 0
static char * temp_dir = NULL
static struct TestCase tests []

Macro Definition Documentation

◆ _POSIX_C_SOURCE

#define _POSIX_C_SOURCE   200809L /* for setenv */

◆ _XOPEN_SOURCE

#define _XOPEN_SOURCE   600 /* for mkstemp */

◆ BUNDLE_PREFIXES

◆ LICENSE_GPL

#define LICENSE_GPL   "doap:license <http://usefulinc.com/doap/licenses/gpl>"

◆ MANIFEST_PREFIXES

#define MANIFEST_PREFIXES   PREFIX_LINE PREFIX_LV2 PREFIX_RDFS

◆ PLUGIN_NAME

#define PLUGIN_NAME ( name)
Value:
"doap:name \"" name "\""
static const char * name
Definition pugl.h:1582

◆ PREFIX_ATOM

#define PREFIX_ATOM   "@prefix atom: <http://lv2plug.in/ns/ext/atom#> . \n"

◆ PREFIX_DOAP

#define PREFIX_DOAP   "@prefix doap: <http://usefulinc.com/ns/doap#> .\n"

◆ PREFIX_FOAF

#define PREFIX_FOAF   "@prefix foaf: <http://xmlns.com/foaf/0.1/> .\n"

◆ PREFIX_LINE

#define PREFIX_LINE   "@prefix : <http://example.org/> .\n"

◆ PREFIX_LV2

#define PREFIX_LV2   "@prefix lv2: <http://lv2plug.in/ns/lv2core#> .\n"

◆ PREFIX_LV2EV

#define PREFIX_LV2EV   "@prefix lv2ev: <http://lv2plug.in/ns/ext/event#> . \n"

◆ PREFIX_LV2UI

#define PREFIX_LV2UI   "@prefix lv2ui: <http://lv2plug.in/ns/extensions/ui#> .\n"

◆ PREFIX_PSET

#define PREFIX_PSET   "@prefix pset: <http://lv2plug.in/ns/ext/presets#> .\n"

◆ PREFIX_RDF

#define PREFIX_RDF   "@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .\n"

◆ PREFIX_RDFS

#define PREFIX_RDFS   "@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .\n"

◆ SHLIB_EXT

#define SHLIB_EXT   ".so"

◆ TEST_ASSERT

#define TEST_ASSERT ( check)
Value:
do {\
if (!(check)) {\
fprintf(stderr, "lilv_test.c:%d: error: test `%s' failed\n", __LINE__, #check);\
assert(check);\
}\
} while (0)
#define check(expr)
Definition blargg_source.h:32
int test_count
Definition lilv_test.c:66
int error_count
Definition lilv_test.c:67

◆ TEST_CASE

#define TEST_CASE ( name)
Value:
{ #name, test_##name }

◆ TEST_PATH_MAX

#define TEST_PATH_MAX   1024

Typedef Documentation

◆ TestFunc

typedef int(* TestFunc) (void)

Function Documentation

◆ cleanup()

void cleanup ( void )
static

◆ cleanup_uris()

void cleanup_uris ( void )
static

◆ create_bundle()

void create_bundle ( const char * manifest,
const char * content )
static

◆ delete_bundle()

void delete_bundle ( void )
static

◆ discovery_verify_plugin()

void discovery_verify_plugin ( const LilvPlugin * plugin)
static

◆ fatal_error()

void fatal_error ( const char * err,
const char * arg )
static

◆ get_port_value()

const void * get_port_value ( const char * port_symbol,
void * user_data,
uint32_t * size,
uint32_t * type )
static

◆ init_tests()

void init_tests ( void )
static

◆ init_uris()

void init_uris ( void )
static

◆ init_world()

int init_world ( void )
static

◆ lilv_make_path()

char * lilv_make_path ( LV2_State_Make_Path_Handle handle,
const char * path )
static

◆ load_all_bundles()

int load_all_bundles ( void )
static

◆ main()

int main ( int argc,
char * argv[] )

◆ map_uri()

LV2_URID map_uri ( LV2_URID_Map_Handle handle,
const char * uri )
static

◆ run_tests()

void run_tests ( void )
static

◆ set_port_value()

void set_port_value ( const char * port_symbol,
void * user_data,
const void * value,
uint32_t size,
uint32_t type )
static

◆ start_bundle()

int start_bundle ( const char * manifest,
const char * content )
static

◆ test_bad_port_index()

int test_bad_port_index ( void )
static

◆ test_bad_port_symbol()

int test_bad_port_symbol ( void )
static

◆ test_classes()

int test_classes ( void )
static

◆ test_discovery()

int test_discovery ( void )
static

◆ test_get_symbol()

int test_get_symbol ( void )
static

◆ test_lv2_path()

int test_lv2_path ( void )
static

◆ test_no_author()

int test_no_author ( void )
static

◆ test_no_verify()

int test_no_verify ( void )
static

◆ test_plugin()

int test_plugin ( void )
static

◆ test_port()

int test_port ( void )
static

◆ test_preset()

int test_preset ( void )
static

◆ test_project()

int test_project ( void )
static

◆ test_project_no_author()

int test_project_no_author ( void )
static

◆ test_prototype()

int test_prototype ( void )
static

◆ test_reload_bundle()

int test_reload_bundle ( void )
static

◆ test_replace_version()

int test_replace_version ( void )
static

◆ test_state()

int test_state ( void )
static

◆ test_string()

int test_string ( void )
static

◆ test_ui()

int test_ui ( void )
static

◆ test_util()

int test_util ( void )
static

◆ test_value()

int test_value ( void )
static

◆ test_verify()

int test_verify ( void )
static

◆ test_world()

int test_world ( void )
static

◆ ui_supported()

unsigned ui_supported ( const char * container_type_uri,
const char * ui_type_uri )
static

◆ unload_bundle()

void unload_bundle ( void )
static

◆ unmap_uri()

const char * unmap_uri ( LV2_URID_Map_Handle handle,
LV2_URID urid )
static

◆ write_file()

void write_file ( const char * name,
const char * content )
static

Variable Documentation

◆ atom_Float

uint32_t atom_Float = 0

◆ bundle_dir_name

char bundle_dir_name[TEST_PATH_MAX]
static

◆ bundle_dir_uri

char bundle_dir_uri[TEST_PATH_MAX]
static

◆ content_name

char content_name[TEST_PATH_MAX]
static

◆ control

float control = 1234.0

◆ discovery_plugin_found

int discovery_plugin_found = 0
static

◆ error_count

int error_count = 0

◆ in

float in = 1.0

◆ manifest_name

char manifest_name[TEST_PATH_MAX]
static

◆ n_uris

size_t n_uris = 0

◆ out

float out = 42.0

◆ plugin2_uri_value

LilvNode* plugin2_uri_value
static

◆ plugin_uri_value

LilvNode* plugin_uri_value
static

◆ temp_dir

char* temp_dir = NULL
static

◆ test_count

int test_count = 0

◆ tests

struct TestCase tests[]
static
Initial value:
= {
TEST_CASE(util),
TEST_CASE(verify),
TEST_CASE(no_verify),
TEST_CASE(discovery),
TEST_CASE(lv2_path),
TEST_CASE(classes),
TEST_CASE(plugin),
TEST_CASE(project),
TEST_CASE(no_author),
TEST_CASE(project_no_author),
TEST_CASE(preset),
TEST_CASE(prototype),
TEST_CASE(port),
TEST_CASE(bad_port_symbol),
TEST_CASE(bad_port_index),
TEST_CASE(bad_port_index),
TEST_CASE(string),
TEST_CASE(state),
TEST_CASE(reload_bundle),
TEST_CASE(replace_version),
TEST_CASE(get_symbol),
{ NULL, NULL }
}
#define NULL
Definition CarlaBridgeFormat.cpp:30
class MasterUI * ui
Definition Connection.cpp:39
static PuglViewHint int value
Definition pugl.h:1708
#define TEST_CASE(name)
Definition lilv_test.c:159
static LilvWorld * world
Definition lilv_test.c:64

◆ uris

char** uris = NULL

◆ uris_plugin

const char* uris_plugin = "http://example.org/plug"
static

◆ world

LilvWorld* world
static