Esempio n. 1
0
  @Test
  public void testRegistry() {
    assertTrue(Sys.initializeRegistry());

    final File binDir = Path.combine(Path.nativeResourcesDirectory, "bin/");

    assertTrue(Path.delete(binDir));
    assertTrue(Sys.loadNativeResources(NativeResource.Images));

    // Shouldn't matter how many times we call this - it shouldn't do
    // anything different after its first initialization...
    for (int i = 0; i < 100; ++i) assertTrue(Sys.loadNativeResources(NativeResource.Images));

    assertTrue(Path.exists(binDir));

    switch (Sys.getOSFamily()) {
      case Unix:
        assertTrue(Path.exists(Path.combine(binDir, "libtiff.so.3")));
        break;
      case Windows:
        assertTrue(Path.exists(Path.combine(binDir, "libtiff-3.dll")));
        break;
      default:
        assertTrue("Unsupported test platform", false);
        break;
    }

    assertTrue(Sys.cleanRegistry());
  }
Esempio n. 2
0
  @Override
  public File writeToDotFile(
      String name, boolean includeTimeStampInFileName, DebugGraphDetails... details) {
    // This won't output a dot file if we haven't defined this env var.
    // It should have been set in GStreamer.initialize() however. But we're doing
    // a sanity check just in case.
    if (StringUtil.isNullOrEmpty(Sys.getEnvironmentVariable("GST_DEBUG_DUMP_DOT_DIR"))) return null;

    if (name == null) {
      name = g_get_application_name();
      if (name == null) name = "unnamed";
    }

    if (includeTimeStampInFileName) name = name + "-" + System.currentTimeMillis();

    _gst_debug_bin_to_dot_file(ptr, DebugGraphDetails.toNative(details), name);

    // Return the path to the newly created file
    return new File(Sys.getEnvironmentVariable("GST_DEBUG_DUMP_DOT_DIR"), name + ".dot");
  }
Esempio n. 3
0
 @Before
 public void setUp() {
   assertTrue("These unit tests require Windows to complete", Sys.isOSFamily(OSFamily.Windows));
 }