# SDG2042X v0.2 — Test Procedure
**Milestone:** v0.2.0 - first bugfix round  
**Issues:** #1 · #2 · #6 · #12  
**Date:** 2026-04-18

---

## Files Required

| File | Purpose |
|------|---------|
| `SDG2042X_V0.2.py` | Script under test |
| `test_v0.2_all.py` | Automated test suite |

Both files must be in the **same directory**.

---

## Part 1 — Automated Tests (no instrument required)

Covers: **#1** `_recv_line()` · **#6** screenshot path · **#12** `human_to_eng()`  
Covers structurally: **#2** ARB thread (AST check)

### Run

```bash
cd /path/to/scripts
python3 test_v0.2_all.py
```

Single issue:

```bash
python3 test_v0.2_all.py --issue 12
```

### Expected output

```
Issue #1   PASS (5/5)
Issue #12  PASS (20/20)
Issue #2   PASS (8/8)
Issue #6   PASS (2/2)

Total: 35/35 passed
✓ All tests passed — safe to close all four issues
```

Exit code `0` = pass, `1` = fail. Suitable for CI.

### Close criteria

All 35 TCs green → close **#1, #6, #12** immediately.  
**#2** additionally requires the hardware test below.

---

## Part 2 — Hardware Test (instrument required)

Covers: **#2** ARB download GUI responsiveness

### Setup

- SDG2042X powered and reachable on LAN
- At least one USER waveform stored on the instrument  
  *(if none: upload any `.bin` via ARB Manager → Upload first)*

### Procedure

| Step | Action | Expected |
|------|--------|---------|
| 1 | Start GUI: `python3 SDG2042X_V0.2.py --ip <addr>` | Window opens |
| 2 | Click **Connect** | Log: `Connected to <addr>:5025` |
| 3 | Tab **ARB Manager** → click **Refresh** | USER list populated |
| 4 | Select a USER waveform → click **Download USER → file** | Log: `ARB download started…` |
| 5 | **While download runs**: click IDN?, change waveform combo, click SYST:ERR? | UI responds immediately — no freeze |
| 6 | Wait for completion | Log: `Downloaded -> <path> (N bytes)` |
| 7 | Verify saved file: `ls -lh <saved_file>` | Non-zero size |

### Close criteria

Steps 5 and 6 both pass → close **#2**.

---

## Summary Checklist

```
[ ] python3 test_v0.2_all.py  →  35/35
[ ] #1  close
[ ] #6  close
[ ] #12 close
[ ] Hardware test step 5: GUI responsive during ARB download
[ ] Hardware test step 6: file saved, non-zero size
[ ] #2  close
[ ] Milestone v0.2.0 → mark closed
```
