Skip to content

Commit 2910dea

Browse files
committed
Almost fix extra_coverage test
1 parent 22a44c6 commit 2910dea

File tree

10 files changed

+30
-29
lines changed

10 files changed

+30
-29
lines changed

.gitmodules

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -293,7 +293,7 @@
293293
url = https://github.com/adafruit/Adafruit_CircuitPython_Ticks.git
294294
[submodule "frozen/Adafruit_CircuitPython_asyncio"]
295295
path = frozen/Adafruit_CircuitPython_asyncio
296-
url = https://github.com/adafruit/Adafruit_CircuitPython_asyncio.git
296+
url = https://github.com/tannewt/Adafruit_CircuitPython_asyncio.git
297297
[submodule "frozen/circuitpython_ef_music"]
298298
path = frozen/circuitpython_ef_music
299299
url = https://github.com/elecfreaks/circuitpython_ef_music.git

ports/espressif/supervisor/usb_serial_jtag.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ static void usb_serial_jtag_isr_handler(void *arg) {
8989
}
9090

9191
void usb_serial_jtag_init(void) {
92-
ringbuf_init(&ringbuf, buf, sizeof(buf) - 1);
92+
ringbuf_init(&ringbuf, buf, sizeof(buf));
9393
usb_serial_jtag_ll_clr_intsts_mask(USB_SERIAL_JTAG_INTR_SOF | USB_SERIAL_JTAG_INTR_SERIAL_OUT_RECV_PKT | USB_SERIAL_JTAG_INTR_TOKEN_REC_IN_EP1);
9494
usb_serial_jtag_ll_ena_intr_mask(USB_SERIAL_JTAG_INTR_SOF | USB_SERIAL_JTAG_INTR_SERIAL_OUT_RECV_PKT | USB_SERIAL_JTAG_INTR_TOKEN_REC_IN_EP1);
9595
ESP_ERROR_CHECK(esp_intr_alloc(ETS_USB_SERIAL_JTAG_INTR_SOURCE, ESP_INTR_FLAG_LEVEL1,

ports/unix/coverage.c

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -612,8 +612,11 @@ STATIC mp_obj_t extra_coverage(void) {
612612

613613
// ringbuf
614614
{
615-
byte buf[100];
616-
ringbuf_t ringbuf = {buf, sizeof(buf), 0, 0, 0};
615+
#define RINGBUF_SIZE 99
616+
617+
byte buf[RINGBUF_SIZE];
618+
ringbuf_t ringbuf;
619+
ringbuf_init(&ringbuf, buf, sizeof(buf));
617620

618621
mp_printf(&mp_plat_print, "# ringbuf\n");
619622

@@ -631,7 +634,7 @@ STATIC mp_obj_t extra_coverage(void) {
631634
mp_printf(&mp_plat_print, "%d %d\n", ringbuf_num_empty(&ringbuf), ringbuf_num_filled(&ringbuf));
632635

633636
// Two-byte put with full ringbuf.
634-
for (int i = 0; i < 99; ++i) {
637+
for (int i = 0; i < RINGBUF_SIZE; ++i) {
635638
ringbuf_put(&ringbuf, i);
636639
}
637640
mp_printf(&mp_plat_print, "%d %d\n", ringbuf_num_empty(&ringbuf), ringbuf_num_filled(&ringbuf));
@@ -643,15 +646,15 @@ STATIC mp_obj_t extra_coverage(void) {
643646
ringbuf_get(&ringbuf);
644647
mp_printf(&mp_plat_print, "%d %d\n", ringbuf_num_empty(&ringbuf), ringbuf_num_filled(&ringbuf));
645648
mp_printf(&mp_plat_print, "%d\n", ringbuf_put16(&ringbuf, 0xcc99));
646-
for (int i = 0; i < 97; ++i) {
649+
for (int i = 0; i < RINGBUF_SIZE - 2; ++i) {
647650
ringbuf_get(&ringbuf);
648651
}
649652
mp_printf(&mp_plat_print, "%04x\n", ringbuf_get16(&ringbuf));
650653
mp_printf(&mp_plat_print, "%d %d\n", ringbuf_num_empty(&ringbuf), ringbuf_num_filled(&ringbuf));
651654

652655
// Two-byte put with wrap around on first byte:
653656
ringbuf_clear(&ringbuf);
654-
for (int i = 0; i < 99; ++i) {
657+
for (int i = 0; i < RINGBUF_SIZE; ++i) {
655658
ringbuf_put(&ringbuf, i);
656659
ringbuf_get(&ringbuf);
657660
}
@@ -660,7 +663,7 @@ STATIC mp_obj_t extra_coverage(void) {
660663

661664
// Two-byte put with wrap around on second byte:
662665
ringbuf_clear(&ringbuf);
663-
for (int i = 0; i < 98; ++i) {
666+
for (int i = 0; i < RINGBUF_SIZE - 1; ++i) {
664667
ringbuf_put(&ringbuf, i);
665668
ringbuf_get(&ringbuf);
666669
}

py/makeversionhdr.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,6 @@ def get_version_info_from_git(repo_path):
2828

2929
# Note: git describe doesn't work if no tag is available
3030
try:
31-
print(tools_describe)
3231
git_tag = subprocess.check_output(
3332
[tools_describe],
3433
cwd=repo_path,
@@ -95,10 +94,8 @@ def make_version_header(repo_path, filename):
9594
# Get version info using git (required)
9695
info = get_version_info_from_git(repo_path)
9796
if info is None:
98-
print(info)
9997
cannot_determine_version()
10098
git_tag, git_hash, ver = info
101-
print(git_tag, git_hash, ver)
10299
if len(ver) < 3:
103100
cannot_determine_version()
104101
else:

supervisor/shared/usb/host_keyboard.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -318,7 +318,7 @@ void tuh_hid_report_received_cb(uint8_t dev_addr, uint8_t instance, uint8_t cons
318318
}
319319

320320
void usb_keyboard_init(void) {
321-
ringbuf_init(&_incoming_ringbuf, _buf, sizeof(_buf) - 1);
321+
ringbuf_init(&_incoming_ringbuf, _buf, sizeof(_buf));
322322
}
323323

324324
bool usb_keyboard_chars_available(void) {

supervisor/shared/web_workflow/websocket.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ static _websocket cp_serial;
5959
void websocket_init(void) {
6060
socketpool_socket_reset(&cp_serial.socket);
6161

62-
ringbuf_init(&_incoming_ringbuf, _buf, sizeof(_buf) - 1);
62+
ringbuf_init(&_incoming_ringbuf, _buf, sizeof(_buf));
6363
}
6464

6565
void websocket_handoff(socketpool_socket_obj_t *socket) {

tests/frozen/frozentest.mpy

196 Bytes
Binary file not shown.

tests/frozen/frozentest.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
print("uPy")
2+
print("a long string that is not interned")
3+
print("a string that has unicode αβγ chars")
4+
print(b"bytes 1234\x01")
5+
print(123456789)
6+
for i in range(4):
7+
print(i)

tests/unix/extra_coverage.py.exp

Lines changed: 9 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -15,12 +15,12 @@ false true
1515
abc
1616
%
1717
# GC
18-
0
19-
0
18+
0x0
19+
0x0
2020
# GC part 2
2121
pass
2222
# tracked allocation
23-
m_tracked_head = 0
23+
m_tracked_head = 0x0
2424
0 1
2525
1 1
2626
2 1
@@ -37,7 +37,7 @@ m_tracked_head = 0
3737
5 1
3838
6 1
3939
7 1
40-
m_tracked_head = 0
40+
m_tracked_head = 0x0
4141
# vstr
4242
tests
4343
sts
@@ -55,19 +55,13 @@ _uasyncio aesio array audiocore
5555
audiomixer bitmaptools cexample cmath
5656
collections cppexample displayio gc
5757
math qrio rainbowio struct
58-
synthio termios traceback ubinascii
59-
uctypes uerrno uhashlib uheapq
60-
uio ujson ulab ulab.numpy
61-
ulab.numpy.fft ulab.numpy.linalg ulab.scipy
62-
ulab.scipy.linalg ulab.scipy.optimize
63-
ulab.scipy.signal ulab.scipy.special
64-
ulab.utils uos urandom ure
65-
uselect usys utime utimeq
66-
uzlib zlib
58+
synthio traceback ubinascii uctypes
59+
uerrno uhashlib uheapq uio
60+
ujson ulab uos uplatform
61+
urandom ure uselect usys
62+
utime uzlib zlib
6763
ime
6864

69-
utime utimeq
70-
7165
argv atexit byteorder exc_info
7266
executable exit getsizeof implementation
7367
maxsize modules path platform

0 commit comments

Comments
 (0)