#
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
#
# under the terms of the GNU General Public License version 2 only, as
# published by the Free Software Foundation.
#
# This code is distributed in the hope that it will be useful, but WITHOUT
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
# version 2 for more details (a copy is included in the LICENSE file that
# accompanied this code).
#
# You should have received a copy of the GNU General Public License version
# 2 along with this work; if not, write to the Free Software Foundation,
# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
#
# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
# or visit www.oracle.com if you need additional information or have any
# questions.
#
# @test
# @bug 4630463 4630971 4636448 4701617 4721296 4710890 6247817 7021987
# @summary Tests miscellaneous native2ascii bugfixes and regressions
esac
bug=$1; shift
expected=$1; shift
out=$1; shift
# Strip carriage returns from output when comparing with n2a test output
# on win32 systems
else
fi
echo "$bug passed"
else
echo "$bug failed"
exit 1
fi
}
# Check that native2ascii -reverse with an ISO-8859-1 encoded file works
# as documented. 4630463 fixes a bug in the ISO-8859-1 encoder which
# prevented encoding of valid ISO-8859-1 chars > 0x7f
rm -f x.*
# Take file encoded in ISO-8859-1 with range of chars , 0x7f < c < 0xff
# invoke native2ascii with input filename and output filename identical
# Ensure that output file is as expected by comparing to expected output.
# 4636448 Fixed bug whereby output file was clobbered if infile and outfile
# Windows you can't write to a file that's open for reading.
rm -f x.*
fi
fi
# Ensure that files containing backslashes adjacent to EOF don't
# hang native2ascii -reverse
rm -f x.*
# Check reverse (char -> native) encoding of Japanese Halfwidth
# Katakana characters for MS932 (default WinNT Japanese encoding)
# Regression test for bugID 4701617
rm -f x.*
# Check that the inputfile appears in the error message when not found
badin="DoesNotExist"
if [ $? != 0 ]; then
echo "\"$badin\" expected to appear in error message"
exit 1
fi
# for win32 only ensure when output file pre-exists that
# native2ascii tool will simply overwrite with the expected
# output file (fixed bugID 4710890)
rm -f x.*
fi