File: test-file-types

package info (click to toggle)
xplanet 1.3.1-5
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 7,280 kB
  • sloc: cpp: 24,219; ansic: 6,553; sh: 3,430; makefile: 350
file content (34 lines) | stat: -rwxr-xr-x 1,122 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
#!/bin/sh

set -e


oneTimeSetUp () {

  # ensure temporary directory exists
  if [ -z "$AUTOPKGTEST_TMP" ] ; then
    AUTOPKGTEST_TMP=$( mktemp -d )
  fi

  mkdir -p $AUTOPKGTEST_TMP/filetype/

  # ppm support missing?
  for filetype in gif jpg jpeg png tiff ; do
    xplanet -geometry 1024x768 -config /etc/xplanet/config/default -date 20220826.163000 -num_times 1 -output $AUTOPKGTEST_TMP/filetype/default.$filetype
  done

}


# first we check, if the created images are of the expected filetype
test_filetypes () {
    assertEquals "image/gif" "$(file --mime-type --brief $AUTOPKGTEST_TMP/filetype/default.gif)"
    assertEquals "image/jpeg" "$(file --mime-type --brief $AUTOPKGTEST_TMP/filetype/default.jpeg)"
    assertEquals "image/jpeg" "$(file --mime-type --brief $AUTOPKGTEST_TMP/filetype/default.jpg)"
    #assertEquals "image/ppm" "$(file --mime-type --brief $AUTOPKGTEST_TMP/filetype/default.ppm)"
    assertEquals "image/png" "$(file --mime-type --brief $AUTOPKGTEST_TMP/filetype/default.png)"
    assertEquals "image/tiff" "$(file --mime-type --brief $AUTOPKGTEST_TMP/filetype/default.tiff)"
}

. shunit2