Browse Source

lv2_rdf test, spotted a few minor issues

tags/1.9.4
falkTX 10 years ago
parent
commit
ed6695598d
3 changed files with 114 additions and 1 deletions
  1. +17
    -1
      source/modules/lv2_rdf.hpp
  2. +91
    -0
      source/tests/RDF.cpp
  3. +6
    -0
      source/utils/CarlaLv2Utils.hpp

+ 17
- 1
source/modules/lv2_rdf.hpp View File

@@ -519,6 +519,14 @@ struct LV2_RDF_UI {
}
if (Extensions != nullptr)
{
for (uint32_t i=0; i<ExtensionCount; ++i)
{
if (Extensions[i] != nullptr)
{
delete[] Extensions[i];
Extensions[i] = nullptr;
}
}
delete[] Extensions;
Extensions = nullptr;
}
@@ -536,7 +544,7 @@ struct LV2_RDF_Descriptor {
const char* License;
const char* Binary;
const char* Bundle;
unsigned long UniqueID;
ulong UniqueID;

uint32_t PortCount;
LV2_RDF_Port* Ports;
@@ -624,6 +632,14 @@ struct LV2_RDF_Descriptor {
}
if (Extensions != nullptr)
{
for (uint32_t i=0; i<ExtensionCount; ++i)
{
if (Extensions[i] != nullptr)
{
delete[] Extensions[i];
Extensions[i] = nullptr;
}
}
delete[] Extensions;
Extensions = nullptr;
}


+ 91
- 0
source/tests/RDF.cpp View File

@@ -48,6 +48,97 @@ int main()
desc3.Ports[0].ScalePoints[0].Label = carla_strdup("");
}

// lv2
{
LV2_RDF_PortMidiMap portMidiMap;
LV2_RDF_PortPoints portPoints;

LV2_RDF_PortUnit portUnit1, portUnit2;
portUnit2.Name = carla_strdup("");
portUnit2.Render = carla_strdup("");
portUnit2.Symbol = carla_strdup("");

LV2_RDF_PortScalePoint portScalePoint1, portScalePoint2;
portScalePoint2.Label = carla_strdup("");

LV2_RDF_Port port1, port2, port3;
port2.Name = carla_strdup("");
port3.Name = carla_strdup("");
port2.Symbol = carla_strdup("");
port3.Symbol = carla_strdup("");
port3.Unit.Name = carla_strdup("");
port3.Unit.Render = carla_strdup("");
port3.Unit.Symbol = carla_strdup("");
port3.ScalePoints = new LV2_RDF_PortScalePoint[2];
port3.ScalePoints[0].Label = carla_strdup("");
port3.ScalePoints[1].Label = carla_strdup("");

LV2_RDF_Preset preset1, preset2;
preset2.URI = carla_strdup("");
preset2.Label = carla_strdup("");

LV2_RDF_Feature feat1, feat2;
feat2.URI = carla_strdup("");

LV2_RDF_UI ui1, ui2, ui3;
ui2.URI = carla_strdup("");
ui3.URI = carla_strdup("");
ui2.Binary = carla_strdup("");
ui3.Binary = carla_strdup("");
ui2.Bundle = carla_strdup("");
ui3.Bundle = carla_strdup("");
ui3.Features = new LV2_RDF_Feature[1];
ui3.Features[0].URI = carla_strdup("");
ui3.Extensions = new LV2_URI[3];
ui3.Extensions[0] = carla_strdup("");
ui3.Extensions[1] = nullptr;
ui3.Extensions[2] = carla_strdup("");
ui3.ExtensionCount = 3;

LV2_RDF_Descriptor desc1, desc2, desc3;
desc2.URI = carla_strdup("");
desc3.URI = carla_strdup("");
desc2.Name = carla_strdup("");
desc3.Name = carla_strdup("");
desc2.Author = carla_strdup("");
desc3.Author = carla_strdup("");
desc2.License = carla_strdup("");
desc3.License = carla_strdup("");
desc2.Binary = carla_strdup("");
desc3.Binary = carla_strdup("");
desc2.Bundle = carla_strdup("");
desc3.Bundle = carla_strdup("");
desc3.Ports = new LV2_RDF_Port[1];
desc3.Ports[0].Name = carla_strdup("");
desc3.Ports[0].Symbol = carla_strdup("");
desc3.Ports[0].Unit.Name = carla_strdup("");
desc3.Ports[0].Unit.Render = carla_strdup("");
desc3.Ports[0].Unit.Symbol = carla_strdup("");
desc3.Ports[0].ScalePoints = new LV2_RDF_PortScalePoint[1];
desc3.Ports[0].ScalePoints[0].Label = carla_strdup("");
desc3.Presets = new LV2_RDF_Preset[1];
desc3.Presets[0].URI = carla_strdup("");
desc3.Presets[0].Label = carla_strdup("");
desc3.Features = new LV2_RDF_Feature[1];
desc3.Features[0].URI = carla_strdup("");
desc3.Extensions = new LV2_URI[3];
desc3.Extensions[0] = carla_strdup("");
desc3.Extensions[1] = nullptr;
desc3.Extensions[2] = carla_strdup("");
desc3.ExtensionCount = 3;
desc3.UIs = new LV2_RDF_UI[1];
desc3.UIs[0].URI = carla_strdup("");
desc3.UIs[0].Binary = carla_strdup("");
desc3.UIs[0].Bundle = carla_strdup("");
desc3.UIs[0].Features = new LV2_RDF_Feature[1];
desc3.UIs[0].Features[0].URI = carla_strdup("");
desc3.UIs[0].Extensions = new LV2_URI[3];
desc3.UIs[0].Extensions[0] = carla_strdup("");
desc3.UIs[0].Extensions[1] = nullptr;
desc3.UIs[0].Extensions[2] = carla_strdup("");
desc3.UIs[0].ExtensionCount = 3;
}

return 0;
}



+ 6
- 0
source/utils/CarlaLv2Utils.hpp View File

@@ -1166,6 +1166,9 @@ const LV2_RDF_Descriptor* lv2_rdf_new(const LV2_URI uri, const bool doInit)
}
*rdfExtension = nullptr;
}

for (uint32_t x=h; x < rdfDescriptor->ExtensionCount; ++x)
rdfDescriptor->Extensions[x] = nullptr;
}
}

@@ -1284,6 +1287,9 @@ const LV2_RDF_Descriptor* lv2_rdf_new(const LV2_URI uri, const bool doInit)
}
*rdfExtension = nullptr;
}

for (uint32_t x2=h2; x2 < rdfDescriptor->ExtensionCount; ++x2)
rdfUI->Extensions[x2] = nullptr;
}
}
}


Loading…
Cancel
Save