Compare commits
44 commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
af99b2f9c3 | ||
|
|
ef034919dc | ||
|
|
1675915cff | ||
|
|
914eb9ba61 | ||
|
|
177b732caf | ||
|
|
40f872b788 |
||
|
|
3db58434d8 | ||
|
|
2a2fc12a7f | ||
|
|
569de0fee3 |
||
|
|
bb75ad2c78 | ||
|
|
4ad603df19 | ||
|
|
c7d985bd9b | ||
|
|
d9494a370f | ||
|
|
910caf86b2 | ||
|
|
9c1c527bb3 | ||
|
|
d0203cb590 | ||
|
|
58e85981d8 | ||
|
|
09c439fb1e | ||
|
|
af1fe1c9f5 | ||
|
|
d268e290af | ||
|
|
f032b0e758 | ||
|
|
57e0d0872f | ||
|
|
0cab0ae6e2 | ||
|
|
b1a47ba9d4 | ||
|
|
f598ba2597 | ||
|
|
1c9aa8fd23 | ||
|
|
54762ca7f0 | ||
|
|
79860aea6b |
||
|
|
c0ed9ff578 |
||
|
|
77ac392493 | ||
|
|
ca8718061e | ||
|
|
d5d008a1c4 | ||
|
|
ed939e4d11 | ||
|
|
8dcdfc931b | ||
|
|
c5e34d68e8 | ||
|
|
0d9db339b1 |
||
|
|
593dcde8d4 | ||
|
|
ef4784ff6d | ||
|
|
7af7642b85 | ||
|
|
45cb0aad1f |
||
|
|
ff0d975e57 | ||
|
|
98e1f6f6b1 | ||
|
|
a970695ff4 | ||
|
|
5e44c88e0e |
13 changed files with 330 additions and 97 deletions
1
.fmf/version
Normal file
1
.fmf/version
Normal file
|
|
@ -0,0 +1 @@
|
|||
1
|
||||
5
.gitignore
vendored
5
.gitignore
vendored
|
|
@ -1,3 +1,8 @@
|
|||
libunistring-0.9.3.tar.gz
|
||||
/libunistring-0.9.4.tar.xz
|
||||
/libunistring-0.9.7.tar.xz
|
||||
/libunistring-0.9.8.tar.xz
|
||||
/libunistring-0.9.9.tar.xz
|
||||
/libunistring-0.9.10.tar.xz
|
||||
/libunistring-1.0.tar.xz
|
||||
/libunistring-1.1.tar.xz
|
||||
|
|
|
|||
3
README.md
Normal file
3
README.md
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
# libunistring
|
||||
|
||||
This project conatains libunistring i18n testcases
|
||||
127
changelog
Normal file
127
changelog
Normal file
|
|
@ -0,0 +1,127 @@
|
|||
* Thu Jul 21 2022 Fedora Release Engineering <releng@fedoraproject.org> - 1.0-2
|
||||
- Rebuilt for https://fedoraproject.org/wiki/Fedora_37_Mass_Rebuild
|
||||
|
||||
* Sun Jan 23 2022 Daiki Ueno <dueno@redhat.com> - 1.0-1
|
||||
- Update to upstream 1.0 release
|
||||
- Switch to %%autosetup
|
||||
|
||||
* Thu Jan 20 2022 Fedora Release Engineering <releng@fedoraproject.org> - 0.9.10-15
|
||||
- Rebuilt for https://fedoraproject.org/wiki/Fedora_36_Mass_Rebuild
|
||||
|
||||
* Thu Jul 22 2021 Fedora Release Engineering <releng@fedoraproject.org> - 0.9.10-14
|
||||
- Rebuilt for https://fedoraproject.org/wiki/Fedora_35_Mass_Rebuild
|
||||
|
||||
* Mon Jun 21 2021 Mike FABIAN <mfabian@redhat.com> - 0.9.10-13
|
||||
- Related rhbz#1938800: Fix CI tests and convert them to tmt
|
||||
|
||||
* Mon Jun 14 2021 Mike FABIAN <mfabian@redhat.com> - 0.9.10-12
|
||||
- Fix memory leak in vasnprint. Resolves: rhbz#1938800
|
||||
(Backported from upstream: https://git.savannah.gnu.org/cgit/gnulib.git/commit/?id=4d288a80bf7ebe29334b9805cdcc70eacb6059c1)
|
||||
- Fix spelling in license GPLV2+ -> GPLv2+
|
||||
|
||||
* Tue Jan 26 2021 Fedora Release Engineering <releng@fedoraproject.org> - 0.9.10-10
|
||||
- Rebuilt for https://fedoraproject.org/wiki/Fedora_34_Mass_Rebuild
|
||||
|
||||
* Tue Jul 28 2020 Fedora Release Engineering <releng@fedoraproject.org> - 0.9.10-9
|
||||
- Rebuilt for https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild
|
||||
|
||||
* Mon Jul 13 2020 Tom Stellard <tstellar@redhat.com> - 0.9.10-8
|
||||
- Use make macros
|
||||
- https://fedoraproject.org/wiki/Changes/UseMakeBuildInstallMacro
|
||||
|
||||
* Wed Jan 29 2020 Fedora Release Engineering <releng@fedoraproject.org> - 0.9.10-7
|
||||
- Rebuilt for https://fedoraproject.org/wiki/Fedora_32_Mass_Rebuild
|
||||
|
||||
* Thu Jul 25 2019 Fedora Release Engineering <releng@fedoraproject.org> - 0.9.10-6
|
||||
- Rebuilt for https://fedoraproject.org/wiki/Fedora_31_Mass_Rebuild
|
||||
|
||||
* Fri Feb 01 2019 Fedora Release Engineering <releng@fedoraproject.org> - 0.9.10-5
|
||||
- Rebuilt for https://fedoraproject.org/wiki/Fedora_30_Mass_Rebuild
|
||||
|
||||
* Tue Jul 31 2018 Florian Weimer <fweimer@redhat.com> - 0.9.10-4
|
||||
- Rebuild with fixed binutils
|
||||
|
||||
* Sat Jul 28 2018 Igor Gnatenko <ignatenkobrain@fedoraproject.org> - 0.9.10-3
|
||||
- Replace obsolete scriptlets
|
||||
|
||||
* Fri Jul 13 2018 Fedora Release Engineering <releng@fedoraproject.org> - 0.9.10-2
|
||||
- Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild
|
||||
|
||||
* Mon May 28 2018 Daiki Ueno <dueno@redhat.com> - 0.9.10-1
|
||||
- Update to upstream 0.9.10 release
|
||||
|
||||
* Thu Mar 01 2018 Daiki Ueno <dueno@redhat.com> - 0.9.9-1
|
||||
- Update to upstream 0.9.9 release
|
||||
|
||||
* Wed Feb 07 2018 Fedora Release Engineering <releng@fedoraproject.org> - 0.9.8-3
|
||||
- Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild
|
||||
|
||||
* Sat Feb 03 2018 Igor Gnatenko <ignatenkobrain@fedoraproject.org> - 0.9.8-2
|
||||
- Switch to %%ldconfig_scriptlets
|
||||
|
||||
* Sat Dec 2 2017 Daiki Ueno <dueno@redhat.com> - 0.9.8-1
|
||||
- Update to 0.9.8
|
||||
|
||||
* Thu Aug 03 2017 Fedora Release Engineering <releng@fedoraproject.org> - 0.9.7-3
|
||||
- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Binutils_Mass_Rebuild
|
||||
|
||||
* Wed Jul 26 2017 Fedora Release Engineering <releng@fedoraproject.org> - 0.9.7-2
|
||||
- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild
|
||||
|
||||
* Fri Feb 17 2017 Daiki Ueno <dueno@redhat.com> - 0.9.7-1
|
||||
- Update to 0.9.7
|
||||
- Update license to "GPLv2+ or LGPLv2+"
|
||||
|
||||
* Wed Feb 01 2017 Stephen Gallagher <sgallagh@redhat.com> - 0.9.4-4
|
||||
- Add missing %%license macro
|
||||
|
||||
* Thu Feb 04 2016 Fedora Release Engineering <releng@fedoraproject.org> - 0.9.4-3
|
||||
- Rebuilt for https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild
|
||||
|
||||
* Wed Jun 17 2015 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.9.4-2
|
||||
- Rebuilt for https://fedoraproject.org/wiki/Fedora_23_Mass_Rebuild
|
||||
|
||||
* Tue Sep 02 2014 Pádraig Brady <pbrady@redhat.com> - 0.9.4-1
|
||||
- Latest upstream
|
||||
|
||||
* Sun Aug 17 2014 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.9.3-11
|
||||
- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_22_Mass_Rebuild
|
||||
|
||||
* Sat Jun 07 2014 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.9.3-10
|
||||
- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_Mass_Rebuild
|
||||
|
||||
* Thu Aug 29 2013 Pádraig Brady <P@draigBrady.com> 0.9.3-9
|
||||
- Adjust to avoid duplicate docs caused by %%doc macro changes in Fedora 20
|
||||
|
||||
* Sat Aug 03 2013 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.9.3-8
|
||||
- Rebuilt for https://fedoraproject.org/wiki/Fedora_20_Mass_Rebuild
|
||||
|
||||
* Thu Feb 14 2013 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.9.3-7
|
||||
- Rebuilt for https://fedoraproject.org/wiki/Fedora_19_Mass_Rebuild
|
||||
|
||||
* Thu Jul 19 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.9.3-6
|
||||
- Rebuilt for https://fedoraproject.org/wiki/Fedora_18_Mass_Rebuild
|
||||
|
||||
* Tue Jun 26 2012 Akira TAGOH <tagoh@redhat.com> - 0.9.3-5
|
||||
- Fix a typo in %%preun. (#737638)
|
||||
|
||||
* Tue May 15 2012 Mikolaj Izdebski <mizdebsk@redhat.com> - 0.9.3-4
|
||||
- Add bundled(gnulib) provides
|
||||
|
||||
* Fri Jan 13 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.9.3-3
|
||||
- Rebuilt for https://fedoraproject.org/wiki/Fedora_17_Mass_Rebuild
|
||||
|
||||
* Tue Feb 08 2011 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.9.3-2
|
||||
- Rebuilt for https://fedoraproject.org/wiki/Fedora_15_Mass_Rebuild
|
||||
|
||||
* Sun May 23 2010 Pádraig Brady <P@draigBrady.com> 0.9.3-1
|
||||
- Update to 0.9.3
|
||||
|
||||
* Thu Nov 19 2009 Pádraig Brady <P@draigBrady.com> 0.9.1-3
|
||||
- Remove glibc-devel and texinfo build deps
|
||||
|
||||
* Thu Nov 19 2009 Pádraig Brady <P@draigBrady.com> 0.9.1-2
|
||||
- Changes as per initial review by panemade@gmail.com
|
||||
|
||||
* Tue Nov 17 2009 Pádraig Brady <P@draigBrady.com> 0.9.1-1
|
||||
- Initial version
|
||||
|
|
@ -1,14 +1,13 @@
|
|||
# This spec file has been automatically updated
|
||||
Version: 1.1
|
||||
Release: %{?autorelease}%{!?autorelease:1%{?dist}}
|
||||
Name: libunistring
|
||||
Version: 0.9.7
|
||||
Release: 3%{?dist}
|
||||
Group: System Environment/Libraries
|
||||
Summary: GNU Unicode string library
|
||||
License: GPLV2+ or LGPLv3+
|
||||
Url: http://www.gnu.org/software/libunistring/
|
||||
Source0: http://ftp.gnu.org/gnu/libunistring/%{name}-%{version}.tar.xz
|
||||
BuildRoot: %(mktemp -ud %{_tmppath}/%{name}-%{version}-%{release}-XXXXXX)
|
||||
Requires(post): info
|
||||
Requires(preun): info
|
||||
License: GPL-2.0-or-later OR LGPL-3.0-or-later
|
||||
URL: https://www.gnu.org/software/libunistring/
|
||||
Source0: https://ftp.gnu.org/gnu/libunistring/%{name}-%{version}.tar.xz
|
||||
BuildRequires: gcc
|
||||
BuildRequires: make
|
||||
Provides: bundled(gnulib)
|
||||
|
||||
%description
|
||||
|
|
@ -19,38 +18,32 @@ This portable C library implements Unicode string types in three flavours:
|
|||
case folding and regular expressions).
|
||||
|
||||
%package devel
|
||||
Group: Development/Libraries
|
||||
Summary: GNU Unicode string library - development files
|
||||
Requires: %{name} = %{version}-%{release}
|
||||
Requires: %{name}%{?_isa} = %{version}-%{release}
|
||||
|
||||
%description devel
|
||||
Development files for programs using libunistring.
|
||||
|
||||
%prep
|
||||
%setup -q
|
||||
%autosetup
|
||||
|
||||
%build
|
||||
%configure --disable-static --disable-rpath
|
||||
make %{?_smp_mflags}
|
||||
%make_build
|
||||
|
||||
%install
|
||||
make install DESTDIR=$RPM_BUILD_ROOT INSTALL="install -p"
|
||||
rm -f $RPM_BUILD_ROOT/%{_infodir}/dir
|
||||
rm -f $RPM_BUILD_ROOT/%{_libdir}/%{name}.la
|
||||
%make_install
|
||||
rm -f $RPM_BUILD_ROOT%{_infodir}/dir
|
||||
rm -f $RPM_BUILD_ROOT%{_libdir}/%{name}.la
|
||||
# Move staged docs so not picked up by %%doc in main package
|
||||
mv $RPM_BUILD_ROOT%{_datadir}/doc/%{name} __doc
|
||||
|
||||
%clean
|
||||
rm -rf $RPM_BUILD_ROOT
|
||||
|
||||
%files
|
||||
%defattr(-,root,root,-)
|
||||
%license COPYING COPYING.LIB
|
||||
%doc AUTHORS NEWS README
|
||||
%{_libdir}/%{name}.so.*
|
||||
%{_libdir}/%{name}.so.5*
|
||||
|
||||
%files devel
|
||||
%defattr(-,root,root,-)
|
||||
%doc HACKING DEPENDENCIES THANKS ChangeLog
|
||||
%doc __doc/*
|
||||
%{_infodir}/%{name}.info*
|
||||
|
|
@ -58,79 +51,7 @@ rm -rf $RPM_BUILD_ROOT
|
|||
%{_includedir}/unistring
|
||||
%{_includedir}/*.h
|
||||
|
||||
%post -p /sbin/ldconfig
|
||||
|
||||
%postun -p /sbin/ldconfig
|
||||
|
||||
%post devel
|
||||
/sbin/install-info %{_infodir}/%{name}.info %{_infodir}/dir || :
|
||||
|
||||
%preun devel
|
||||
if [ $1 = 0 ]; then
|
||||
/sbin/install-info --delete %{_infodir}/%{name}.info %{_infodir}/dir || :
|
||||
fi
|
||||
%ldconfig_scriptlets
|
||||
|
||||
%changelog
|
||||
* Thu Aug 03 2017 Fedora Release Engineering <releng@fedoraproject.org> - 0.9.7-3
|
||||
- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Binutils_Mass_Rebuild
|
||||
|
||||
* Wed Jul 26 2017 Fedora Release Engineering <releng@fedoraproject.org> - 0.9.7-2
|
||||
- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild
|
||||
|
||||
* Fri Feb 17 2017 Daiki Ueno <dueno@redhat.com> - 0.9.7-1
|
||||
- Update to 0.9.7
|
||||
- Update license to "GPLv2+ or LGPLv2+"
|
||||
|
||||
* Wed Feb 01 2017 Stephen Gallagher <sgallagh@redhat.com> - 0.9.4-4
|
||||
- Add missing %%license macro
|
||||
|
||||
* Thu Feb 04 2016 Fedora Release Engineering <releng@fedoraproject.org> - 0.9.4-3
|
||||
- Rebuilt for https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild
|
||||
|
||||
* Wed Jun 17 2015 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.9.4-2
|
||||
- Rebuilt for https://fedoraproject.org/wiki/Fedora_23_Mass_Rebuild
|
||||
|
||||
* Tue Sep 02 2014 Pádraig Brady <pbrady@redhat.com> - 0.9.4-1
|
||||
- Latest upstream
|
||||
|
||||
* Sun Aug 17 2014 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.9.3-11
|
||||
- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_22_Mass_Rebuild
|
||||
|
||||
* Sat Jun 07 2014 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.9.3-10
|
||||
- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_Mass_Rebuild
|
||||
|
||||
* Thu Aug 29 2013 Pádraig Brady <P@draigBrady.com> 0.9.3-9
|
||||
- Adjust to avoid duplicate docs caused by %%doc macro changes in Fedora 20
|
||||
|
||||
* Sat Aug 03 2013 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.9.3-8
|
||||
- Rebuilt for https://fedoraproject.org/wiki/Fedora_20_Mass_Rebuild
|
||||
|
||||
* Thu Feb 14 2013 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.9.3-7
|
||||
- Rebuilt for https://fedoraproject.org/wiki/Fedora_19_Mass_Rebuild
|
||||
|
||||
* Thu Jul 19 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.9.3-6
|
||||
- Rebuilt for https://fedoraproject.org/wiki/Fedora_18_Mass_Rebuild
|
||||
|
||||
* Tue Jun 26 2012 Akira TAGOH <tagoh@redhat.com> - 0.9.3-5
|
||||
- Fix a typo in %%preun. (#737638)
|
||||
|
||||
* Tue May 15 2012 Mikolaj Izdebski <mizdebsk@redhat.com> - 0.9.3-4
|
||||
- Add bundled(gnulib) provides
|
||||
|
||||
* Fri Jan 13 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.9.3-3
|
||||
- Rebuilt for https://fedoraproject.org/wiki/Fedora_17_Mass_Rebuild
|
||||
|
||||
* Tue Feb 08 2011 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.9.3-2
|
||||
- Rebuilt for https://fedoraproject.org/wiki/Fedora_15_Mass_Rebuild
|
||||
|
||||
* Sun May 23 2010 Pádraig Brady <P@draigBrady.com> 0.9.3-1
|
||||
- Update to 0.9.3
|
||||
|
||||
* Thu Nov 19 2009 Pádraig Brady <P@draigBrady.com> 0.9.1-3
|
||||
- Remove glibc-devel and texinfo build deps
|
||||
|
||||
* Thu Nov 19 2009 Pádraig Brady <P@draigBrady.com> 0.9.1-2
|
||||
- Changes as per initial review by panemade@gmail.com
|
||||
|
||||
* Tue Nov 17 2009 Pádraig Brady <P@draigBrady.com> 0.9.1-1
|
||||
- Initial version
|
||||
%autochangelog
|
||||
|
|
|
|||
5
plans/basic.fmf
Normal file
5
plans/basic.fmf
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
summary: Basic smoke test
|
||||
discover:
|
||||
how: fmf
|
||||
execute:
|
||||
how: tmt
|
||||
2
sources
2
sources
|
|
@ -1 +1 @@
|
|||
SHA512 (libunistring-0.9.7.tar.xz) = 52d5240dbf9b483976e980027187484dae6bbc103d44be8f9797832e772cde2ea03fcd27b062c81d42ea9b9f5a21216993695f2435bf8c06e48af916be0475f9
|
||||
SHA512 (libunistring-1.1.tar.xz) = 01a4267bbd301ea5c389b17ee918ae5b7d645da8b2c6c6f0f004ff2dead9f8e50cda2c6047358890a5fceadc8820ffc5154879193b9bb8970f3fb1fea1f411d6
|
||||
|
|
|
|||
3
tests/README.md
Normal file
3
tests/README.md
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
# libunistring
|
||||
|
||||
This project conatains libunistring i18n testcases
|
||||
2
tests/libunistring-tests/.gitignore
vendored
Normal file
2
tests/libunistring-tests/.gitignore
vendored
Normal file
|
|
@ -0,0 +1,2 @@
|
|||
test
|
||||
testfile.utf*
|
||||
58
tests/libunistring-tests/libunistring_test.py
Normal file
58
tests/libunistring-tests/libunistring_test.py
Normal file
|
|
@ -0,0 +1,58 @@
|
|||
# -*- coding: utf-8 -*-
|
||||
|
||||
import sys
|
||||
import os
|
||||
import subprocess
|
||||
import logging
|
||||
|
||||
"""
|
||||
Creating a result.log file for saving logs
|
||||
"""
|
||||
logging.basicConfig(level=logging.INFO)
|
||||
|
||||
logging.info("TEST RESULTS FOR <uniconv.h> FUNCTION\n\n")
|
||||
|
||||
data = []
|
||||
|
||||
TESTTEXT = 'Viele Grüße\n日本語\n'
|
||||
|
||||
def create_testfiles():
|
||||
dummy = subprocess.run("./test '" + TESTTEXT + "'", shell=True)
|
||||
|
||||
def test(path='', encoding=''):
|
||||
"""
|
||||
Read the file at path using the specified encoding and check
|
||||
whether the TESTTEXT can be read back correctly.
|
||||
"""
|
||||
logging.info('Testing file %s using encoding %s', path, encoding)
|
||||
try:
|
||||
with open(path, mode='rt', encoding=encoding) as testfile:
|
||||
text = testfile.read()
|
||||
logging.info('TESTTEXT="%s", text read ="%s"\n', TESTTEXT, text)
|
||||
if text == TESTTEXT:
|
||||
logging.info(
|
||||
'testfile: %s testencoding: %s Read test: SUCCESS',
|
||||
path, encoding)
|
||||
else:
|
||||
logging.info(
|
||||
'testfile: %s testencoding: %s Read test: ERROR',
|
||||
path, encoding)
|
||||
except UnicodeError:
|
||||
logging.error("UTF-8 Conversion Test: UnicodeError")
|
||||
|
||||
if __name__ == "__main__":
|
||||
if sys.byteorder == 'little':
|
||||
endianness = 'le'
|
||||
else:
|
||||
endianness = 'be'
|
||||
testfiles = {
|
||||
'testfile.utf-8': 'utf-8',
|
||||
'testfile.utf-16': 'utf-16' + endianness,
|
||||
'testfile.utf-32': 'utf-32' + endianness,
|
||||
}
|
||||
for testfile in testfiles:
|
||||
if os.path.isfile(testfile):
|
||||
os.unlink(testfile)
|
||||
create_testfiles()
|
||||
for testfile in testfiles:
|
||||
test(path=testfile, encoding=testfiles[testfile])
|
||||
16
tests/libunistring-tests/main.fmf
Normal file
16
tests/libunistring-tests/main.fmf
Normal file
|
|
@ -0,0 +1,16 @@
|
|||
summary: Functional test for the gettext module
|
||||
contact: Pooja Yadav <poyadav@redhat.com>
|
||||
component:
|
||||
- python
|
||||
require:
|
||||
- gcc
|
||||
- make
|
||||
- libunistring
|
||||
- libunistring-devel
|
||||
test: bash runtest.sh
|
||||
framework: beakerlib
|
||||
recommend:
|
||||
- python
|
||||
duration: 5m
|
||||
extra-summary: /CoreOS/python/libunistring-tests
|
||||
extra-task: /CoreOS/python/libunistring-tests
|
||||
54
tests/libunistring-tests/runtest.sh
Executable file
54
tests/libunistring-tests/runtest.sh
Executable file
|
|
@ -0,0 +1,54 @@
|
|||
#!/bin/bash
|
||||
# vim: dict=/usr/share/beakerlib/dictionary.vim cpt=.,w,b,u,t,i,k
|
||||
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
#
|
||||
# runtest.sh of /CoreOS/python/libunistring-tests
|
||||
# Description: Functional tests for libunistring to check i18n features.
|
||||
# Author: Pooja Yadav <poyadav@redhat.com>
|
||||
#
|
||||
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
#
|
||||
# Copyright (c) 2010 Red Hat, Inc. All rights reserved.
|
||||
#
|
||||
# This copyrighted material is made available to anyone wishing
|
||||
# to use, modify, copy, or redistribute it subject to the terms
|
||||
# and conditions of the GNU General Public License version 2.
|
||||
#
|
||||
# This program 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 for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public
|
||||
# License along with this program; if not, write to the Free
|
||||
# Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
|
||||
# Boston, MA 02110-1301, USA.
|
||||
#
|
||||
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
# Include Beaker environment
|
||||
. /usr/share/beakerlib/beakerlib.sh || exit 1
|
||||
|
||||
PACKAGE="libunistring"
|
||||
|
||||
rlJournalStart
|
||||
rlPhaseStartSetup
|
||||
rlAssertRpm $PACKAGE
|
||||
rlRun "gcc test.c -lunistring -o test"
|
||||
rlRun "TmpDir=\`mktemp -d\`" 0 "Creating tmp directory"
|
||||
rlRun "cp libunistring_test.py test $TmpDir"
|
||||
rlRun "pushd $TmpDir"
|
||||
rlPhaseEnd
|
||||
|
||||
rlPhaseStartTest
|
||||
rlLog "Run libunistring_test.py"
|
||||
rlRun "python libunistring_test.py"
|
||||
rlPhaseEnd
|
||||
|
||||
rlPhaseStartCleanup
|
||||
rlRun "popd"
|
||||
rlRun "rm -r $TmpDir" 0 "Removing tmp directory"
|
||||
rlPhaseEnd
|
||||
rlJournalPrintText
|
||||
rlJournalEnd
|
||||
|
||||
38
tests/libunistring-tests/test.c
Normal file
38
tests/libunistring-tests/test.c
Normal file
|
|
@ -0,0 +1,38 @@
|
|||
#include <stdio.h>
|
||||
#include <uniconv.h>
|
||||
#include <sys/types.h>
|
||||
#include <sys/stat.h>
|
||||
#include <fcntl.h>
|
||||
#include <string.h>
|
||||
#include <unistd.h>
|
||||
|
||||
int
|
||||
main (int argc, char **argv)
|
||||
{
|
||||
if (argc < 2) {
|
||||
printf ("Usage: %s <a string>\n", argv[0]);
|
||||
return 1;
|
||||
}
|
||||
|
||||
size_t len8, len16, len32;
|
||||
|
||||
uint8_t *res8 = u8_conv_from_encoding ("UTF-8", iconveh_question_mark, argv[1], strlen (argv[1]), NULL, NULL, &len8);
|
||||
uint16_t *res16 = u16_conv_from_encoding ("UTF-8", iconveh_question_mark, argv[1], strlen (argv[1]), NULL, NULL, &len16);
|
||||
uint32_t *res32 = u32_conv_from_encoding ("UTF-8", iconveh_question_mark, argv[1], strlen (argv[1]), NULL, NULL, &len32);
|
||||
|
||||
int fd = open ("testfile.utf-8", O_WRONLY | O_CREAT, S_IRUSR | S_IWUSR);
|
||||
for (int i = 0; i < len8; i++)
|
||||
write (fd, &res8[i], sizeof (uint8_t));
|
||||
close (fd);
|
||||
|
||||
fd = open ("testfile.utf-16", O_WRONLY | O_CREAT, S_IRUSR | S_IWUSR);
|
||||
for (int i = 0; i < len16; i++)
|
||||
write (fd, &res16[i], sizeof (uint16_t));
|
||||
close (fd);
|
||||
|
||||
fd = open ("testfile.utf-32", O_WRONLY | O_CREAT, S_IRUSR | S_IWUSR);
|
||||
for (int i = 0; i < len32; i++)
|
||||
write (fd, &res32[i], sizeof (uint32_t));
|
||||
close (fd);
|
||||
}
|
||||
|
||||
Loading…
Add table
Add a link
Reference in a new issue