public void CanRoundtripMaps() { InstalledFilesTestData.ReadFiles(".map", _output, entry => { // These maps have false positive differences, so ignore them. switch (entry.FilePath) { // Differences in passability data, because the original file appears to have // un-initialized (random) values for partial passability bytes beyond the map width. case @"Maps\USA07-TaskForces\USA07-TaskForces.map": return; // Uses unknown ZL5 compression. case @"maps\Woodcrest Circle\Woodcrest Circle.map": return; } using (var entryStream = entry.Open()) { TestUtility.DoRoundtripTest( () => MapFile.Decompress(entryStream), stream => MapFile.FromStream(stream), (mapFile, stream) => mapFile.WriteTo(stream)); } }); }
public void CanRoundtripScbFiles() { InstalledFilesTestData.ReadFiles(".scb", _output, entry => { using (var fileStream = entry.Open()) { TestUtility.DoRoundtripTest( () => MapFile.Decompress(fileStream), stream => ScbFile.FromStream(stream), (scbFile, stream) => scbFile.WriteTo(stream)); } }); }
public void CanRoundtripBases() { InstalledFilesTestData.ReadFiles(".bse", _output, entry => { using (var entryStream = entry.Open()) { TestUtility.DoRoundtripTest( () => MapFile.Decompress(entryStream), stream => MapFile.FromStream(stream), (mapFile, stream) => mapFile.WriteTo(stream)); } }); }
public void CanRoundtripMaps() { InstalledFilesTestData.ReadFiles(".map", _output, entry => { // These maps have false positive differences, so ignore differences. bool skipRoundtripEqualityTest = false; switch (entry.FilePath) { // Differences in passability data, because the original files have unusual // values for partial passability bytes beyond the map width. case @"maps\usa07-taskforces\usa07-taskforces.map": case @"maps\map evil shelobslair\map evil shelobslair.map": // BFME case @"maps\map good shelobslair\map good shelobslair.map": // BFME case @"data\maps\official\map_sp_aliens_1_1_london\map_sp_aliens_1_1_london.map": // CNC3 case @"data\maps\official\map_sp_gdi_2_4_nuke_facility\map_sp_gdi_2_4_nuke_facility.map": // CNC3 case @"data\maps\official\map_sp_gdi_4_4_berne\map_sp_gdi_4_4_berne.map": // CNC3 case @"data\maps\official\map_sp_nod_2_3_coastal_brazil\map_sp_nod_2_3_coastal_brazil.map": // CNC3 case @"data\maps\official\map_sp_nod_5_5_the_tower\map_sp_nod_5_5_the_tower.map": // CNC3 case @"data\maps\official\map_mp_4_black1\map_mp_4_black1.map": // CNC3 case @"data\maps\official\metagameworld\metagameworld.map": // CNC3 case @"data\maps\official\metagameworldact1\metagameworldact1.map": // CNC3 case @"data\maps\official\metagameworldact2\metagameworldact2.map": // CNC3 case @"data\maps\official\metagameworldact3\metagameworldact3.map": // CNC3 case @"data\maps\official\map_mp_4_ssmith2-remix\map_mp_4_ssmith2-remix.map": // RA3 case @"data\maps\official\camp_j09_amsterdam_bass\camp_j09_amsterdam_bass.map": // RA3 case @"data\maps\official\tutorial_protocols_smith\tutorial_protocols_smith.map": // RA3 case @"data\maps\official\camp_ep01_a01_igaprefecture_davis\camp_ep01_a01_igaprefecture_davis.map": // RA3 Uprising case @"data\maps\official\camp_ep01_j03_vladivostok_smith\camp_ep01_j03_vladivostok_smith.map": // RA3 Uprising case @"data\maps\official\camp_ep01_s03_yucatan_stewart\camp_ep01_s03_yucatan_stewart.map": // RA3 Uprising case @"data\maps\official\map_mp_3_feasel1\map_mp_3_feasel1.map": // RA3 Uprising case @"data\maps\official\tutorial_protocols_smith_360\tutorial_protocols_smith_360.map": // RA3 Uprising case @"data\maps\official\camp_gdi_2_1_stewart\camp_gdi_2_1_stewart.map": // C&C4 case @"data\maps\official\camp_gdi_2_4_smith\camp_gdi_2_4_smith.map": // C&C4 case @"data\maps\official\camp_gdi_3_2_smith\camp_gdi_3_2_smith.map": // C&C4 case @"data\maps\official\map_mp_10_capitalcity_smith_1\map_mp_10_capitalcity_smith_1.map": // C&C4 case @"data\maps\official\map_mp_10_panamerica_ombao_4\map_mp_10_panamerica_ombao_4.map": // C&C4 skipRoundtripEqualityTest = true; break; } using (var entryStream = entry.Open()) { TestUtility.DoRoundtripTest( () => MapFile.Decompress(entryStream), stream => MapFile.FromStream(stream), (mapFile, stream) => mapFile.WriteTo(stream), skipRoundtripEqualityTest); } }); }
public void CanRoundtripMaps() { InstalledFilesTestData.ReadFiles(".map", _output, entry => { // These maps have false positive differences, so ignore differences. bool skipRoundtripEqualityTest = false; switch (entry.FilePath) { // Differences in passability data, because the original files have unusual // values for partial passability bytes beyond the map width. case @"Maps\USA07-TaskForces\USA07-TaskForces.map": case @"maps\map evil shelobslair\map evil shelobslair.map": // BFME case @"maps\map good shelobslair\map good shelobslair.map": // BFME case @"data\maps\official\map_sp_aliens_1_1_london\map_sp_aliens_1_1_london.map": // CNC3 case @"data\maps\official\map_sp_gdi_2_4_nuke_facility\map_sp_gdi_2_4_nuke_facility.map": // CNC3 case @"data\maps\official\map_sp_gdi_4_4_berne\map_sp_gdi_4_4_berne.map": // CNC3 case @"data\maps\official\map_sp_nod_2_3_coastal_brazil\map_sp_nod_2_3_coastal_brazil.map": // CNC3 case @"data\maps\official\map_sp_nod_5_5_the_tower\map_sp_nod_5_5_the_tower.map": // CNC3 case @"data\maps\official\map_mp_4_black1\map_mp_4_black1.map": // CNC3 case @"data\maps\official\metagameworld\metagameworld.map": // CNC3 case @"data\maps\official\metagameworldact1\metagameworldact1.map": // CNC3 case @"data\maps\official\metagameworldact2\metagameworldact2.map": // CNC3 case @"data\maps\official\metagameworldact3\metagameworldact3.map": // CNC3 skipRoundtripEqualityTest = true; break; } using (var entryStream = entry.Open()) { TestUtility.DoRoundtripTest( () => MapFile.Decompress(entryStream), stream => MapFile.FromStream(stream), (mapFile, stream) => mapFile.WriteTo(stream), skipRoundtripEqualityTest); } }); }