diff options
author | William Joye <wjoye@cfa.harvard.edu> | 2017-01-03 21:52:18 (GMT) |
---|---|---|
committer | William Joye <wjoye@cfa.harvard.edu> | 2017-01-03 21:52:18 (GMT) |
commit | 4302a869f0212a3e4878e66a7260b434f6584476 (patch) | |
tree | e6976e66edf648406e32b092395121e045301692 /tkimg/raw/tests/raw.test | |
parent | a780057cc1b51dd3a557549c3cf2431f09136c0d (diff) | |
parent | 60d692811c12788ed4468d5ff680633304e8f641 (diff) | |
download | blt-4302a869f0212a3e4878e66a7260b434f6584476.zip blt-4302a869f0212a3e4878e66a7260b434f6584476.tar.gz blt-4302a869f0212a3e4878e66a7260b434f6584476.tar.bz2 |
Merge commit '60d692811c12788ed4468d5ff680633304e8f641' as 'tkimg'
Diffstat (limited to 'tkimg/raw/tests/raw.test')
-rwxr-xr-x | tkimg/raw/tests/raw.test | 53 |
1 files changed, 53 insertions, 0 deletions
diff --git a/tkimg/raw/tests/raw.test b/tkimg/raw/tests/raw.test new file mode 100755 index 0000000..37cdb4e --- /dev/null +++ b/tkimg/raw/tests/raw.test @@ -0,0 +1,53 @@ +# This file is a Tcl script to test out RAW reading and writing.
+# It is organized in the standard fashion for Tcl tests.
+#
+
+puts "img::raw [package require img::raw]"
+
+set rawdata \
+{TWFnaWM9UkFXCldpZHRoPTE2CkhlaWdodD0xMgpOdW1DaGFuPTMKQnl0ZU9yZGVyPUludGVs
+ClNjYW5PcmRlcj1Ub3BEb3duClBpeGVsVHlwZT1ieXRlCtnZ2dnZ2dnZ2QAAAAAAAAAAAAAA
+ANnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2QAAAPD/gPD/gPD/gPD/gAAAANnZ
+2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2QAAAPD/gPD/gPD/gPD/gPD/gPD/gAAAANnZ2dnZ
+2dnZ2dnZ2dnZ2dnZ2dnZ2QAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
+ANnZ2dnZ2dnZ2QAAAPD/gPD/gPD/gPD/gPD/gPD/gPD/gPD/gPD/gPD/gPD/gAAAANnZ2dnZ
+2dnZ2QAAAPD/gPD/gPD/gPD/gPD/gPD/gPD/gPD/gPD/gPD/gPD/gAAAANnZ2dnZ2dnZ2QAA
+APD/gPD/gPD/gPD/gPD/gPD/gPD/gPD/gPD/gPD/gPD/gAAAANnZ2dnZ2dnZ2QAAAPD/gPD/
+gPD/gPD/gPD/gPD/gPD/gPD/gPD/gPD/gPD/gAAAANnZ2dnZ2dnZ2QAAAPD/gPD/gPD/gPD/
+gPD/gPD/gPD/gPD/gPD/gPD/gPD/gAAAANnZ2dnZ2dnZ2QAAAPD/gPD/gPD/gPD/gPD/gPD/
+gPD/gPD/gPD/gPD/gPD/gAAAANnZ2dnZ2dnZ2QAAAPD/gPD/gPD/gPD/gPD/gPD/gPD/gPD/
+gPD/gPD/gPD/gAAAANnZ2dnZ2dnZ2QAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
+AAAAAAAAANnZ2dnZ2dnZ2Q==}
+
+test raw-1.1 {} {
+ catch {image delete i}
+ image create photo i -file [file join $tcltest::testsDirectory folder.raw]
+ i data -format "raw -useheader true -nomap true -nchan 3"
+} $rawdata
+test raw-1.2 {} {
+ catch {image delete i}
+ image create photo i -data $rawdata
+ set data [i data -format "raw -useheader true -nomap true -nchan 3"]
+} $rawdata
+test raw-1.3 {} {
+ i blank
+ i put $rawdata
+ set data [i data -format "raw -useheader true -nomap true -nchan 3"]
+} $rawdata
+test raw-1.4 {} {
+ i blank
+ i put $rawdata -format raw
+ set data [i data -format "raw -useheader true -nomap true -nchan 3"]
+} $rawdata
+if {[info tclversion] < 8.0} {
+ return
+}
+
+test raw-2.0 {Binary I/O with RAW images} {
+ i blank
+ set f [open [file join $tcltest::testsDirectory folder.raw] r]
+ fconfigure $f -translation binary
+ set return [catch {i put [read $f]} msg]
+ close $f
+ lappend return $msg
+} {0 {}}
|