Search in sources :

Example 6 with Outputs

use of func.lib.Outputs in project mkgmap by openstreetmap.

the class ArgsTest method testDisplayPriority.

@Test
public void testDisplayPriority() throws FileNotFoundException {
    TestUtils.registerFile("osmmap.img");
    int pri = 42;
    Outputs op = TestUtils.run("--draw-priority=" + pri, Args.TEST_RESOURCE_OSM + "uk-test-1.osm.gz");
    op.checkNoError();
    FileSystem fs = openFs(Args.DEF_MAP_FILENAME);
    ImgChannel chan = fs.open(Args.DEF_MAP_ID + ".TRE", "r");
    TREFileReader treFile = new TREFileReader(chan);
    assertEquals("display priority", pri, ((TREHeader) treFile.getHeader()).getDisplayPriority());
}
Also used : ImgChannel(uk.me.parabola.imgfmt.fs.ImgChannel) FileSystem(uk.me.parabola.imgfmt.fs.FileSystem) Outputs(func.lib.Outputs) TREFileReader(uk.me.parabola.imgfmt.app.trergn.TREFileReader) Test(org.junit.Test)

Example 7 with Outputs

use of func.lib.Outputs in project mkgmap by openstreetmap.

the class ArgsTest method testHelpOptions.

@Test
public void testHelpOptions() {
    Outputs outputs = TestUtils.run("--help=options");
    outputs.checkNoError();
    outputs.checkOutput("--mapname=name", "--latin1", "--list-styles");
    checkNoStdFile();
}
Also used : Outputs(func.lib.Outputs) Test(org.junit.Test)

Example 8 with Outputs

use of func.lib.Outputs in project mkgmap by openstreetmap.

the class ArgsTest method testListStylesVerbose.

@Test
public void testListStylesVerbose() {
    Outputs op = TestUtils.run("--style-file=test/resources/teststyles", "--verbose", "--list-styles");
    op.checkNoError();
    op.checkOutput("empty", "main", "simple", "derived", "2.2: A simple test style", "Used for many functional tests");
    checkNoStdFile();
}
Also used : Outputs(func.lib.Outputs) Test(org.junit.Test)

Example 9 with Outputs

use of func.lib.Outputs in project mkgmap by openstreetmap.

the class IndexTest method testCreateIndex.

@Test
public void testCreateIndex() throws IOException {
    File f = new File(MDR_IMG);
    f.delete();
    assertFalse("does not pre-exist", f.exists());
    Outputs outputs = TestUtils.run(Args.TEST_STYLE_ARG, "--index", "--latin1", "--family-id=1002", "--overview-mapname=" + OVERVIEW_NAME, Args.TEST_RESOURCE_IMG + "63240001.img", Args.TEST_RESOURCE_IMG + "63240002.img");
    outputs.checkNoError();
    TestUtils.registerFile(MDR_IMG);
    TestUtils.registerFile(OVERVIEW_NAME + ".tdb");
    TestUtils.registerFile(OVERVIEW_NAME + ".mdx");
    TestUtils.registerFile(OVERVIEW_NAME + ".img");
    assertTrue(MDR_IMG + " is created", f.exists());
    FileSystem fs = openFs(MDR_IMG);
    DirectoryEntry entry = fs.lookup(OVERVIEW_NAME.toUpperCase() + ".MDR");
    assertNotNull("Contains the MDR file", entry);
    entry = fs.lookup(OVERVIEW_NAME.toUpperCase() + ".SRT");
    assertNotNull("contains the SRT file", entry);
    fs.close();
}
Also used : FileSystem(uk.me.parabola.imgfmt.fs.FileSystem) Outputs(func.lib.Outputs) DirectoryEntry(uk.me.parabola.imgfmt.fs.DirectoryEntry) File(java.io.File) Test(org.junit.Test)

Aggregations

Outputs (func.lib.Outputs)9 Test (org.junit.Test)9 FileSystem (uk.me.parabola.imgfmt.fs.FileSystem)2 File (java.io.File)1 TREFileReader (uk.me.parabola.imgfmt.app.trergn.TREFileReader)1 DirectoryEntry (uk.me.parabola.imgfmt.fs.DirectoryEntry)1 ImgChannel (uk.me.parabola.imgfmt.fs.ImgChannel)1