Example #1
0
static int _testIsPresetCompatibleWithPlugin(void) {
  CharString c = newCharStringWithCString(TEST_PRESET_FILENAME);
  PluginPreset p = newPluginPreset(PRESET_TYPE_FXP, c);
  CharString name = newCharStringWithCString("name");
  CharString location = newCharStringWithCString("location");
  Plugin plug1 = newPlugin(PLUGIN_TYPE_INTERNAL, name, location);
  Plugin plug2 = newPlugin(PLUGIN_TYPE_UNSUPPORTED, name, location);

  _pluginPresetSetCompatibleWith(p, PLUGIN_TYPE_INTERNAL);
  assert(pluginPresetIsCompatibleWith(p, plug1));
  assertFalse(pluginPresetIsCompatibleWith(p, plug2));

  freePlugin(plug1);
  freePlugin(plug2);
  freeCharString(name);
  freeCharString(location);
  freeCharString(c);
  freePluginPreset(p);
  return 0;
}
Example #2
0
static int _testPluginFactoryNullPluginName(void)
{
    CharString pluginRoot = newCharString();
    Plugin p = pluginFactory(NULL, pluginRoot);

    assertIsNull(p);

    freeCharString(pluginRoot);
    freePlugin(p);
    return 0;
}
Example #3
0
static int _testPluginFactoryNullRoot(void)
{
    CharString silence = newCharStringWithCString("mrs_silence");
    Plugin p = pluginFactory(silence, NULL);

    assertNotNull(p);
    assertIntEquals(PLUGIN_TYPE_INTERNAL, p->interfaceType);
    assertCharStringEquals(silence->data, p->pluginName);

    freeCharString(silence);
    freePlugin(p);
    return 0;
}
Example #4
0
static int _testPluginFactoryEmptyPluginName(void)
{
    CharString invalid = newCharString();
    CharString pluginRoot = newCharString();
    Plugin p = pluginFactory(invalid, pluginRoot);

    assertIsNull(p);

    freeCharString(invalid);
    freeCharString(pluginRoot);
    freePlugin(p);
    return 0;
}
Example #5
0
static int _testPluginFactoryInvalidPlugin(void)
{
    CharString invalid = newCharStringWithCString("invalid");
    CharString pluginRoot = newCharString();
    Plugin p = pluginFactory(invalid, pluginRoot);

    assertIsNull(p);

    freeCharString(invalid);
    freeCharString(pluginRoot);
    freePlugin(p);
    return 0;
}
Example #6
0
static int _testFreeNullPlugin(void)
{
    freePlugin(NULL);
    return 0;
}