CI Tests: Test cover rhbz2188064

This commit is contained in:
Martin Cermak 2023-04-25 12:40:59 +02:00
parent 25ede0eead
commit 7c06a3670c
3 changed files with 106 additions and 0 deletions

View File

@ -0,0 +1,36 @@
/* Bubble sort code */
#include <stdio.h>
int main()
{
int array[100], n, c, d, swap;
printf("Enter number of elements\n");
scanf("%d", &n);
printf("Enter %d integers\n", n);
for (c = 0; c < n; c++)
scanf("%d", &array[c]);
for (c = 0 ; c < n - 1; c++)
{
for (d = 0 ; d < n - c - 1; d++)
{
if (array[d] > array[d+1]) /* For decreasing order use '<' instead of '>' */
{
swap = array[d];
array[d] = array[d+1];
array[d+1] = swap;
}
}
}
printf("Sorted list in ascending order:\n");
for (c = 0; c < n; c++)
printf("%d\n", array[c]);
return 0;
}

View File

@ -0,0 +1,15 @@
summary: eu-elfcompress-breaks-hard-links
description: ''
link:
- relates: https://bugzilla.redhat.com/show_bug.cgi?id=2188064
contact: Martin Cermak <mcermak@redhat.com>
component:
- elfutils
test: ./runtest.sh
framework: beakerlib
recommend:
- elfutils
- gcc
duration: 1h
extra-summary: /tools/elfutils/Regression/eu-elfcompress-breaks-hard-links
extra-task: /tools/elfutils/Regression/eu-elfcompress-breaks-hard-links

View File

@ -0,0 +1,55 @@
#!/bin/bash
# vim: dict+=/usr/share/beakerlib/dictionary.vim cpt=.,w,b,u,t,i,k
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#
# runtest.sh of /tools/elfutils/Regression/eu-elfcompress-breaks-hard-links
# Description: eu-elfcompress-breaks-hard-links
# Author: Martin Cermak <mcermak@redhat.com>
#
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#
# Copyright (c) 2023 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/.
#
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# Include Beaker environment
. /usr/share/beakerlib/beakerlib.sh || exit 1
PACKAGE="elfutils"
rlJournalStart
rlPhaseStartSetup
rlAssertRpm $PACKAGE
rlRun "TMP=$(mktemp -d)"
rlRun "cp bubble.c $TMP/"
rlRun "pushd $TMP"
rlPhaseEnd
rlPhaseStartTest
rlRun "gcc -o a.out -g bubble.c"
rlRun "ln a.out a.lnk"
rlRun "eu-elfcompress -q -p -t none a.lnk"
rlRun "i0=$(stat -c '%i' a.out)"
rlRun "i1=$(stat -c '%i' a.lnk)"
rlRun "test $i0 -eq $i1"
rlPhaseEnd
rlPhaseStartCleanup
rlRun "popd"
rlRun "rm -r $TMP"
rlPhaseEnd
rlJournalPrintText
rlJournalEnd