Compare commits
No commits in common. "c8s" and "c8" have entirely different histories.
6
.gitignore
vendored
6
.gitignore
vendored
@ -1,5 +1 @@
|
||||
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
|
||||
SOURCES/libunistring-0.9.9.tar.xz
|
||||
|
||||
1
.libunistring.metadata
Normal file
1
.libunistring.metadata
Normal file
@ -0,0 +1 @@
|
||||
0f7049cf9cdea9d010235cf6c56254693da17eaa SOURCES/libunistring-0.9.9.tar.xz
|
||||
@ -1,3 +0,0 @@
|
||||
# libunistring
|
||||
|
||||
This project conatains libunistring i18n testcases
|
||||
@ -1,6 +0,0 @@
|
||||
--- !Policy
|
||||
product_versions:
|
||||
- rhel-8
|
||||
decision_context: osci_compose_gate
|
||||
rules:
|
||||
- !PassingTestCaseRule {test_case_name: osci.brew-build.tier0.functional}
|
||||
1
sources
1
sources
@ -1 +0,0 @@
|
||||
SHA512 (libunistring-0.9.9.tar.xz) = c5f3619d0b064c0256dc9326b609cb72871c85102cd67cfc46d85f72b67c564924cd76198c6d6ab60fbf7d6f76ddcb9fbe6c8116f779ca7e24570ae84e31fea8
|
||||
@ -1,3 +0,0 @@
|
||||
# libunistring
|
||||
|
||||
This project conatains libunistring i18n testcases
|
||||
@ -1,63 +0,0 @@
|
||||
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
#
|
||||
# Makefile of /CoreOS/python/libunistring-tests
|
||||
# Description: Functional tests for libunistring.
|
||||
# Author: Pooja Yadav <poyadav@redhat.com>
|
||||
#
|
||||
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
#
|
||||
# Copyright (c) 2015 Red Hat, Inc.
|
||||
#
|
||||
# This program is free software: you can redistribute it and/or
|
||||
# modify it under the terms of the GNU General Public License as
|
||||
# published by the Free Software Foundation, either version 2 of
|
||||
# the License, or (at your option) any later version.
|
||||
#
|
||||
# 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, see http://www.gnu.org/licenses/.
|
||||
#
|
||||
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
|
||||
export TEST=/CoreOS/python/libunistring-tests
|
||||
export TESTVERSION=1.0
|
||||
|
||||
BUILT_FILES=
|
||||
|
||||
FILES=$(METADATA) libunistring_test.py Makefile test runtest.sh
|
||||
|
||||
.PHONY: all install download clean
|
||||
|
||||
run: $(FILES) build
|
||||
./runtest.sh
|
||||
|
||||
build: $(BUILT_FILES)
|
||||
test -x runtest.sh || chmod a+x runtest.sh
|
||||
|
||||
clean:
|
||||
rm -f *~ $(BUILT_FILES)
|
||||
|
||||
include /usr/share/rhts/lib/rhts-make.include
|
||||
|
||||
$(METADATA): Makefile
|
||||
@echo "Owner: Pooja Yadav <poyadav@redhat.com>" > $(METADATA)
|
||||
@echo "Name: $(TEST)" >> $(METADATA)
|
||||
@echo "TestVersion: $(TESTVERSION)" >> $(METADATA)
|
||||
@echo "Path: $(TEST_DIR)" >> $(METADATA)
|
||||
@echo "Description: Functional test for the gettext module" >> $(METADATA)
|
||||
@echo "Type: Sanity" >> $(METADATA)
|
||||
@echo "TestTime: 5m" >> $(METADATA)
|
||||
@echo "RunFor: python" >> $(METADATA)
|
||||
@echo "Requires: python" >> $(METADATA)
|
||||
@echo "Priority: Normal" >> $(METADATA)
|
||||
@echo "License: GPLv2" >> $(METADATA)
|
||||
@echo "Confidential: no" >> $(METADATA)
|
||||
@echo "Destructive: no" >> $(METADATA)
|
||||
|
||||
rhts-lint $(METADATA)
|
||||
|
||||
@ -1,79 +0,0 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
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 = []
|
||||
|
||||
def create_testfile():
|
||||
testfile = subprocess.call("./test 'Bonjour le monde'" , shell=True)
|
||||
with open("./testfile.in") as fh:
|
||||
lines = fh.readlines()
|
||||
global data
|
||||
data = lines
|
||||
|
||||
def test_utf8():
|
||||
"""
|
||||
Check UTF-8 encoding
|
||||
"""
|
||||
try:
|
||||
conv8 = data[0].strip("\n").decode('utf-8')
|
||||
conv16 = data[0].strip("\n").decode('utf-16')
|
||||
if conv8 == ("Bonjour le monde") and conv16 != ("Bonjour le monde"):
|
||||
logging.info("UTF-8 Conversion Test: SUCCESS")
|
||||
else:
|
||||
logging.error("UTF-8 Conversion Test: ERROR")
|
||||
except UnicodeError:
|
||||
logging.error("UTF-8 Conversion Test: UnicodeError")
|
||||
|
||||
def test_utf_16():
|
||||
"""
|
||||
Check UTF-16 encoding
|
||||
"""
|
||||
try:
|
||||
conv16 = data[1].strip("\n").decode('utf-16')
|
||||
conv8 = data[1].strip("\n").decode('utf-8')
|
||||
if conv16 == ("Bonjour le monde") and conv8 != ("Bonjour le monde"):
|
||||
logging.info("UTF-16 Conversion Test: SUCCESS")
|
||||
else:
|
||||
logging.error("UTF-16 Conversion Test: ERROR")
|
||||
except UnicodeError:
|
||||
logging.error("UTF-16 Conversion Test: UnicodeError")
|
||||
|
||||
def test_utf_32():
|
||||
"""
|
||||
Check UTF-32 encoding
|
||||
"""
|
||||
try:
|
||||
conv8 = data[2].strip("\n").decode('utf-8')
|
||||
conv16= data[2].strip("\n").decode('utf-16')
|
||||
conv32 = data[2].strip("\n").decode('utf-32')
|
||||
if conv32 == ("Bonjour le monde") and conv8 and conv16 != ("Bonjour le monde"):
|
||||
logging.info("UTF-32 Conversion Test: SUCCESS")
|
||||
else:
|
||||
logging.error("UTF-32 Conversion Test: ERROR")
|
||||
except UnicodeError:
|
||||
logging.error("UTF-32 Conversion Test: UnicodeError")
|
||||
|
||||
def del_testfile():
|
||||
try:
|
||||
subprocess.call(['rm', '-rf', './testfile.in'])
|
||||
except OSError as e:
|
||||
logging.error("OSError\n")
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
del_testfile()
|
||||
create_testfile()
|
||||
test_utf8()
|
||||
test_utf_16()
|
||||
test_utf_32()
|
||||
|
||||
@ -1,54 +0,0 @@
|
||||
#!/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/bin/rhts-environment.sh
|
||||
. /usr/lib/beakerlib/beakerlib.sh
|
||||
|
||||
PACKAGE="libunistring"
|
||||
|
||||
rlJournalStart
|
||||
rlPhaseStartSetup
|
||||
rlAssertRpm $PACKAGE
|
||||
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
|
||||
|
||||
Binary file not shown.
@ -1,37 +0,0 @@
|
||||
#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;
|
||||
const char newline = '\n';
|
||||
|
||||
uint8_t *res8 = u8_conv_from_encoding ("ASCII", iconveh_question_mark, argv[1], strlen (argv[1]), NULL, NULL, &len8);
|
||||
uint16_t *res16 = u16_conv_from_encoding ("ASCII", iconveh_question_mark, argv[1], strlen (argv[1]), NULL, NULL, &len16);
|
||||
uint32_t *res32 = u32_conv_from_encoding ("ASCII", iconveh_question_mark, argv[1], strlen (argv[1]), NULL, NULL, &len32);
|
||||
|
||||
int fd = open ("testfile.in", O_WRONLY | O_CREAT, S_IRUSR);
|
||||
|
||||
for (int i = 0; i < len8; i++)
|
||||
write (fd, &res8[i], sizeof (uint8_t));
|
||||
write (fd, &newline, 1);
|
||||
for (int i = 0; i < len16; i++)
|
||||
write (fd, &res16[i], sizeof (uint16_t));
|
||||
write (fd, &newline, 1);
|
||||
for (int i = 0; i < len32; i++)
|
||||
write (fd, &res32[i], sizeof (uint32_t));
|
||||
|
||||
close (fd);
|
||||
}
|
||||
|
||||
@ -1,23 +0,0 @@
|
||||
---
|
||||
|
||||
# Tests for Atomic
|
||||
- hosts: localhost
|
||||
tags:
|
||||
- atomic
|
||||
roles:
|
||||
- role: standard-test-beakerlib
|
||||
tests:
|
||||
- libunistring-tests
|
||||
|
||||
# Tests for Classic and Container
|
||||
- hosts: localhost
|
||||
tags:
|
||||
- classic
|
||||
- container
|
||||
roles:
|
||||
- role: standard-test-beakerlib
|
||||
tests:
|
||||
- libunistring-tests
|
||||
required_packages:
|
||||
- libunistring
|
||||
- libunistring-devel
|
||||
Loading…
Reference in New Issue
Block a user