Skip to content

Commit 3d2f8a4

Browse files
committed
Remove test logs after successful run.
Reduce raster debug logging.
1 parent f0f57e9 commit 3d2f8a4

File tree

3 files changed

+24
-23
lines changed

3 files changed

+24
-23
lines changed

.github/workflows/build.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ jobs:
2020
- name: Update Build Environment
2121
run: sudo apt-get update --fix-missing -y
2222
- name: Install Prerequisites
23-
run: sudo apt-get install -y avahi-daemon libavahi-client-dev libpng-dev libssl-dev libpam-dev libusb-1.0-0-dev zlib1g-dev
23+
run: sudo apt-get install -y avahi-daemon libavahi-client-dev libpam-dev libpng-dev libssl-dev libusb-1.0-0-dev zlib1g-dev
2424
- name: Start Avahi
2525
run: sudo systemctl start avahi-daemon
2626
- name: Configure libcups
@@ -34,7 +34,7 @@ jobs:
3434
ASAN_OPTIONS: leak_check_at_exit=false
3535
CUPS_DEBUG_LOG: test-debug.log
3636
CUPS_DEBUG_LEVEL: 4
37-
run: make test || (cat cups/test*.log; test tools/test.log && cat tools/test*.log; exit 1)
37+
run: make test || (test cups/test.log && cat cups/test*.log; test tools/test.log && cat tools/test*.log; exit 1)
3838

3939
build-linux-gnutls:
4040

@@ -62,7 +62,7 @@ jobs:
6262
ASAN_OPTIONS: leak_check_at_exit=false
6363
CUPS_DEBUG_LOG: test-debug.log
6464
CUPS_DEBUG_LEVEL: 4
65-
run: make test || (cat cups/test*.log; test tools/test.log && cat tools/test*.log; exit 1)
65+
run: make test || (test cups/test.log && cat cups/test*.log; test tools/test.log && cat tools/test*.log; exit 1)
6666

6767
build-macos:
6868

@@ -81,7 +81,7 @@ jobs:
8181
env:
8282
CUPS_DEBUG_LOG: test-debug.log
8383
CUPS_DEBUG_LEVEL: 4
84-
run: make test || (cat cups/test*.log; test tools/test.log && cat tools/test*.log; exit 1)
84+
run: make test || (test cups/test.log && cat cups/test*.log; test tools/test.log && cat tools/test*.log; exit 1)
8585

8686
build-windows:
8787

cups/Makefile

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -190,7 +190,7 @@ all: $(TARGETS)
190190
#
191191

192192
test: $(UNITTARGETS)
193-
rm -ff test.log test-debug.log .testssl
193+
rm -rf test.log test-debug.log .testssl
194194
date >test.log
195195
echo Running array API tests...
196196
./testarray 2>>test.log
@@ -240,6 +240,7 @@ test: $(UNITTARGETS)
240240
echo Running raster API tests...
241241
./testraster 2>>test.log
242242
./testtestpage 2>>test.log
243+
rm -rf test.log test-debug.log .testssl
243244

244245
fuzz: $(UNITTARGETS)
245246
echo Fuzzing IPP API...

cups/raster-stream.c

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
//
22
// Raster file routines for CUPS.
33
//
4-
// Copyright © 2022-2024 by OpenPrinting.
4+
// Copyright © 2022-2025 by OpenPrinting.
55
// Copyright © 2007-2019 by Apple Inc.
66
// Copyright © 1997-2006 by Easy Software Products.
77
//
@@ -1430,7 +1430,7 @@ cups_raster_read(cups_raster_t *r, // I - Raster stream
14301430
total; // Total bytes read
14311431

14321432

1433-
DEBUG_printf("4cups_raster_read(r=%p, buf=%p, bytes=" CUPS_LLFMT "), offset=" CUPS_LLFMT, (void *)r, (void *)buf, CUPS_LLCAST bytes, CUPS_LLCAST (r->iostart + r->bufptr - r->buffer));
1433+
DEBUG_printf("5cups_raster_read(r=%p, buf=%p, bytes=" CUPS_LLFMT "), offset=" CUPS_LLFMT, (void *)r, (void *)buf, CUPS_LLCAST bytes, CUPS_LLCAST (r->iostart + r->bufptr - r->buffer));
14341434

14351435
if (!r->compressed)
14361436
return (cups_raster_io(r, buf, bytes));
@@ -1466,7 +1466,7 @@ cups_raster_read(cups_raster_t *r, // I - Raster stream
14661466
{
14671467
count = (ssize_t)bytes - total;
14681468

1469-
DEBUG_printf("5cups_raster_read: count=" CUPS_LLFMT ", remaining=" CUPS_LLFMT ", buf=%p, bufptr=%p, bufend=%p", CUPS_LLCAST count, CUPS_LLCAST remaining, (void *)buf, (void *)r->bufptr, (void *)r->bufend);
1469+
DEBUG_printf("6cups_raster_read: count=" CUPS_LLFMT ", remaining=" CUPS_LLFMT ", buf=%p, bufptr=%p, bufend=%p", CUPS_LLCAST count, CUPS_LLCAST remaining, (void *)buf, (void *)r->bufptr, (void *)r->bufend);
14701470

14711471
if (remaining == 0)
14721472
{
@@ -1538,7 +1538,7 @@ cups_raster_read(cups_raster_t *r, // I - Raster stream
15381538
}
15391539
}
15401540

1541-
DEBUG_printf("5cups_raster_read: Returning %ld", (long)total);
1541+
DEBUG_printf("6cups_raster_read: Returning %ld", (long)total);
15421542

15431543
return (total);
15441544
}
@@ -1639,13 +1639,13 @@ cups_raster_update(cups_raster_t *r) // I - Raster stream
16391639
break;
16401640
}
16411641

1642-
DEBUG_printf("4cups_raster_update: cupsNumColors=%u", r->header.cupsNumColors);
1642+
DEBUG_printf("6cups_raster_update: cupsNumColors=%u", r->header.cupsNumColors);
16431643
}
16441644

16451645
// Set the number of bytes per pixel/color...
1646-
DEBUG_printf("4cups_raster_update: cupsColorOrder=%u", r->header.cupsColorOrder);
1647-
DEBUG_printf("4cups_raster_update: cupsBitsPerPixel=%u", r->header.cupsBitsPerPixel);
1648-
DEBUG_printf("4cups_raster_update: cupsBitsPerColor=%u", r->header.cupsBitsPerColor);
1646+
DEBUG_printf("6cups_raster_update: cupsColorOrder=%u", r->header.cupsColorOrder);
1647+
DEBUG_printf("6cups_raster_update: cupsBitsPerPixel=%u", r->header.cupsBitsPerPixel);
1648+
DEBUG_printf("6cups_raster_update: cupsBitsPerColor=%u", r->header.cupsBitsPerColor);
16491649

16501650
if (r->header.cupsColorOrder == CUPS_ORDER_CHUNKED)
16511651
r->bpp = (r->header.cupsBitsPerPixel + 7) / 8;
@@ -1655,7 +1655,7 @@ cups_raster_update(cups_raster_t *r) // I - Raster stream
16551655
if (r->bpp == 0)
16561656
r->bpp = 1;
16571657

1658-
DEBUG_printf("4cups_raster_update: bpp=%u", r->bpp);
1658+
DEBUG_printf("6cups_raster_update: bpp=%u", r->bpp);
16591659

16601660
if (r->bpp > 30)
16611661
return (false); // Something went wrong!
@@ -1666,7 +1666,7 @@ cups_raster_update(cups_raster_t *r) // I - Raster stream
16661666
else
16671667
r->remaining = r->header.cupsHeight;
16681668

1669-
DEBUG_printf("4cups_raster_update: remaining=%u", r->remaining);
1669+
DEBUG_printf("6cups_raster_update: remaining=%u", r->remaining);
16701670

16711671
// Validate the page header...
16721672
if (r->header.cupsBytesPerLine == 0)
@@ -1729,7 +1729,7 @@ cups_raster_update(cups_raster_t *r) // I - Raster stream
17291729
r->pend = r->pixels + r->header.cupsBytesPerLine;
17301730
r->count = 0;
17311731

1732-
DEBUG_printf("4cups_raster_update: Allocated %u bytes at %p.", r->header.cupsBytesPerLine, r->pixels);
1732+
DEBUG_printf("6cups_raster_update: Allocated %u bytes at %p.", r->header.cupsBytesPerLine, r->pixels);
17331733
}
17341734
}
17351735

@@ -1756,13 +1756,13 @@ cups_raster_write(
17561756
_cups_copyfunc_t cf; // Copy function
17571757

17581758

1759-
DEBUG_printf("3cups_raster_write(r=%p, pixels=%p)", (void *)r, (void *)pixels);
1760-
DEBUG_printf("4cups_raster_write: cupsBytesPerLine=%u", r->header.cupsBytesPerLine);
1759+
DEBUG_printf("5cups_raster_write(r=%p, pixels=%p)", (void *)r, (void *)pixels);
1760+
DEBUG_printf("6cups_raster_write: cupsBytesPerLine=%u", r->header.cupsBytesPerLine);
17611761

17621762
// Determine whether we need to swap bytes...
17631763
if (r->swapped && (r->header.cupsBitsPerColor == 16 || r->header.cupsBitsPerPixel == 12 || r->header.cupsBitsPerPixel == 16))
17641764
{
1765-
DEBUG_puts("4cups_raster_write: Swapping bytes when writing.");
1765+
DEBUG_puts("6cups_raster_write: Swapping bytes when writing.");
17661766
cf = (_cups_copyfunc_t)cups_swap_copy;
17671767
}
17681768
else
@@ -1782,7 +1782,7 @@ cups_raster_write(
17821782

17831783
if (!wptr)
17841784
{
1785-
DEBUG_printf("4cups_raster_write: Unable to allocate " CUPS_LLFMT " bytes for raster buffer: %s", CUPS_LLCAST count, strerror(errno));
1785+
DEBUG_printf("6cups_raster_write: Unable to allocate " CUPS_LLFMT " bytes for raster buffer: %s", CUPS_LLCAST count, strerror(errno));
17861786
return (-1);
17871787
}
17881788

@@ -1797,7 +1797,7 @@ cups_raster_write(
17971797
wptr = r->buffer;
17981798
*wptr++ = (unsigned char)(r->count - 1);
17991799

1800-
DEBUG_printf("4cups_raster_write: bpp=%u, pend=%ld, plast=%ld, wptr=%ld", bpp, pend - pixels, plast - pixels, wptr - r->buffer);
1800+
DEBUG_printf("6cups_raster_write: bpp=%u, pend=%ld, plast=%ld, wptr=%ld", bpp, pend - pixels, plast - pixels, wptr - r->buffer);
18011801

18021802
// Write using a modified PackBits compression...
18031803
for (ptr = pixels; ptr < pend;)
@@ -1808,7 +1808,7 @@ cups_raster_write(
18081808
if (ptr >= pend)
18091809
{
18101810
// Encode a single pixel at the end...
1811-
DEBUG_printf("4cups_raster_write: SINGLE-END - ptr=%ld, pend=%ld, plast=%ld, start=%ld, wptr=%ld", ptr - pixels, pend - pixels, plast - pixels, start - pixels, wptr - r->buffer);
1811+
DEBUG_printf("6cups_raster_write: SINGLE-END - ptr=%ld, pend=%ld, plast=%ld, start=%ld, wptr=%ld", ptr - pixels, pend - pixels, plast - pixels, start - pixels, wptr - r->buffer);
18121812

18131813
*wptr++ = 0;
18141814
(*cf)(wptr, start, bpp);
@@ -1851,7 +1851,7 @@ cups_raster_write(
18511851
}
18521852
}
18531853

1854-
DEBUG_printf("4cups_raster_write: Writing " CUPS_LLFMT " bytes.", CUPS_LLCAST (wptr - r->buffer));
1854+
DEBUG_printf("6cups_raster_write: Writing " CUPS_LLFMT " bytes.", CUPS_LLCAST (wptr - r->buffer));
18551855

18561856
return (cups_raster_io(r, r->buffer, (size_t)(wptr - r->buffer)));
18571857
}

0 commit comments

Comments
 (0)