#!/usr/bin/env bash
#
# Copyright (c) 2011, 2012, Simon Howard
#
# Permission to use, copy, modify, and/or distribute this software
# for any purpose with or without fee is hereby granted, provided
# that the above copyright notice and this permission notice appear
# in all copies.
#
# THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL
# WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED
# WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE
# AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR
# CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
# LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
# NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
# CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
#
#
# Test script that tests the extract functionality.
# This file tests archives generated by tools on the Amiga and Atari.
#

. test_extract.sh

test_archive lha_amiga_122/level0.lzh       "subdir/subdir2/hello.txt"
test_archive lha_amiga_122/level1.lzh       "subdir/subdir2/hello.txt"
test_archive lha_amiga_122/level2.lzh       "subdir/subdir2/hello.txt"
test_archive lha_amiga_122/lh0.lzh          "gpl-2.gz"
test_archive lha_amiga_122/lh1.lzh          "gpl-2"
test_archive lha_amiga_122/lh4_long.lzh     "long.txt"
test_archive lha_amiga_122/lh4.lzh          "gpl-2"
test_archive lha_amiga_122/lh5.lzh          "gpl-2"
test_archive lha_amiga_122/subdir.lzh       "subdir/subdir2/hello.txt"
test_archive lha_amiga_122/sfx.run          "gpl-2"

test_archive lha_amiga_212/level0.lzh       "subdir/subdir2/hello.txt"
test_archive lha_amiga_212/level1.lzh       "subdir/subdir2/hello.txt"
test_archive lha_amiga_212/level2.lzh       "subdir/subdir2/hello.txt"
test_archive lha_amiga_212/lh1.lzh          "gpl-2"
test_archive lha_amiga_212/lh6.lzh          "gpl-2"

test_archive lharc_atari_313a/lh0.lzh       "gpl2.gz"
test_archive lharc_atari_313a/lh5.lzh       "gpl2"
test_archive lharc_atari_313a/lz5.lzh       "gpl2"
test_archive lharc_atari_313a/subdir.lzh    "subdir/subdir2/hello.txt"
test_archive lharc_atari_313a/sfx.tos       "gpl2"
test_archive lharc_atari_313a/shorter.lzh   "shorter.txt"
test_archive lharc_atari_313a/h1_lh5.lzh    "gpl2"
test_archive lharc_atari_313a/h1_lz5.lzh    "gpl2"
test_archive lharc_atari_313a/h1_subdir.lzh "subdir/subdir2/hello.txt"
test_archive lharc_atari_313a/h2_lh5.lzh    "gpl2"
test_archive lharc_atari_313a/h2_lz5.lzh    "gpl2"
test_archive lharc_atari_313a/h2_subdir.lzh "subdir/subdir2/hello.txt"

test_archive morphos_lha_2717/h0_lh0.lzh       "gpl-2.gz"
test_archive morphos_lha_2717/h0_lh1.lzh       "gpl-2"
test_archive morphos_lha_2717/h0_lh5.lzh       "gpl-2"
test_archive morphos_lha_2717/h0_lh6.lzh       "gpl-2"
test_archive morphos_lha_2717/h0_metadata.lzh  "metadata.txt"
test_archive morphos_lha_2717/h0_subdir.lzh    "subdir/subdir2/hello.txt"
test_archive morphos_lha_2717/h1_lh0.lzh       "gpl-2.gz"
test_archive morphos_lha_2717/h1_lh1.lzh       "gpl-2"
test_archive morphos_lha_2717/h1_lh5.lzh       "gpl-2"
test_archive morphos_lha_2717/h1_lh6.lzh       "gpl-2"
test_archive morphos_lha_2717/h1_metadata.lzh  "metadata.txt"
test_archive morphos_lha_2717/h1_subdir.lzh    "subdir/subdir2/hello.txt"
test_archive morphos_lha_2717/h2_lh0.lzh       "gpl-2.gz"
test_archive morphos_lha_2717/h2_lh1.lzh       "gpl-2"
test_archive morphos_lha_2717/h2_lh5.lzh       "gpl-2"
test_archive morphos_lha_2717/h2_lh6.lzh       "gpl-2"
test_archive morphos_lha_2717/h2_metadata.lzh  "metadata.txt"
test_archive morphos_lha_2717/h2_subdir.lzh    "subdir/subdir2/hello.txt"
# We don't run extract tests on h2_huge.lzh because it contains a 4.7GiB
# file that takes a long time to extract. Extraction is already tested using
# other tests, eg. test-crc-output, test-decompress
#test_archive morphos_lha_2717/h2_huge.lzh      "zero.bin"
