Changeset 3904 in MondoRescue


Ignore:
Timestamp:
Dec 24, 2024, 2:55:10 AM (6 months ago)
Author:
Bruno Cornec
Message:

quality now also reports mr_getcwd

Location:
branches/3.3
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • branches/3.3/MondoRescue/lib/MondoRescue/File.pm

    r3843 r3904  
    156156        if (defined $link) {
    157157            $link = mr_file_normalize($link,"$curdir/$dir");
    158             # It's a real symlink on a file so handle it
    159             $files->{$f}->{"$curdir/$dir"} = 1 if ((not -d $link) && (not -d "/$link"));
     158            # It's a real symlink so handle it
     159            $files->{$f}->{"$curdir/$dir"} = 1;
    160160            if (substr($link,0,1) eq "/") {
    161161                $curdir = $link;
  • branches/3.3/MondoRescue/t/01-read-all-link.t

    r3843 r3904  
    77# Create the structure for the tests
    88my $bd = tempdir(
    9     #CLEANUP => 1
     9    CLEANUP => 1
    1010    );
    1111
     
    2323copy "/usr/bin/perl","usr/bin" || die "$!";
    2424chmod 0755,"usr/bin/perl";
     25my $libc;
    2526foreach my $f (<"/lib/libc.so.[0-9]*">) {
    2627    copy "$f","usr/lib" || die "$!";
     28    $libc = $f;
    2729}
    2830
     
    5557    );
    5658
    57 eval {
    58     require Test;
    59     Test->import();
     59my $more = 1;
     60
     61eval
     62{
     63        require Test::More;
     64        Test::More->import();
     65        no_plan();
    6066};
     67# Test::More not found so simpler test
    6168if ($@) {
    62         require Test::Simple;
    63     Test::Simple->import();
     69    $more = 0;
     70    eval {
     71        require Test;
     72        Test->import();
     73    };
     74    if ($@) {
     75        require Test::Simple;
     76        Test::Simple->import();
     77    }
    6478}
    6579plan(tests => 12);
     
    7286myis($h->{"$bd/var/spool/toto"}->{"$bd/var/spool/toto"}, 1, "File link in another relative dir to itself");
    7387myis($h->{"$bd/var/spool/toto"}->{"$bd/usr/bin/perl"}, 1, "File link in another relative dir to link");
    74 # Dirs
    7588myis($h->{"$bd/var/spool/titi"}->{"$bd/var/spool/titi"}, 1, "Directory link in same dir to itself");
    7689myis($h->{"$bd/var/spool/titi"}->{"$bd/var/spool/mail"}, 1, "Directory link in same dir to link");
     
    8497sub myis {
    8598
     99if ($more eq 1) {
     100    return(is(@_));
     101} else {
    86102    my $p1 = shift;
    87103    my $p2 = shift;
    88104    my $p3 = shift;
     105    print "# test $p3\n";
     106    return(ok($p1,$p2));
     107}
     108}
    89109
    90     my $list1 = mr_file_read_all_link($p1);
    91     my $list2 = mr_file_read_all_link($p2);
    92     # TBD return(ok(mr_file_normalize($p1),mr_file_normalize($p2),$p3));
    93     return(ok(1,1,$p3));
    94 }
  • branches/3.3/tools/quality

    r3899 r3904  
    2828
    2929# How many sprintf/strcat/strcpy vs asprintf are they
    30 for s in asprintf mr_asprintf sprintf snprintf strcat mr_strcat strcpy strncpy fgets malloc mr_malloc malloc_string getline mr_getline MAX_STR_LEN getcwd goto free mr_free paranoid_free paranoid_system mr_system assert; do
     30for s in asprintf mr_asprintf sprintf snprintf strcat mr_strcat strcpy strncpy fgets malloc mr_malloc malloc_string getline mr_getline MAX_STR_LEN getcwd mr_getcwd goto free mr_free paranoid_free paranoid_system mr_system assert; do
    3131    echo "mondorescue $s usage : "
    3232    tot=0
Note: See TracChangeset for help on using the changeset viewer.