OXYGENHUB
◆ rrdc-perf enhanced-x16-emulator / tests / support / signature.h
1.1 KiB · Objective-C · last changed chore(): initial commit 26 days ago source blame history raw
9120e874 Andy McCall 1
// A hash of everything a scenario can observe, so a test can say "do this, and
2
// nothing changed" without listing what "nothing" covers.
3
//
4
// The point is to catch the accidental. Asserting on named fields only finds
5
// what the author thought to name, and the failures worth catching here are the
6
// ones nobody predicted -- a debugger feature that quietly advances a device,
7
// spends a cycle, or perturbs memory it only meant to read.
8
//
9
// Everything the fixtures can reach is folded in: CPU registers, the cycle
10
// counter, RAM, the bank registers, and each fake device's access counts and
11
// state. If a test wants to allow one specific change, it compares the fields
12
// it cares about instead.
13
14
#ifndef X16_TEST_SIGNATURE_H
15
#define X16_TEST_SIGNATURE_H
16
17
#include <stdint.h>
18
19
// A signature is deliberately opaque: comparing two is the only useful thing to
20
// do with one, and a numeric value invites reading meaning into a hash.
21
typedef struct {
22
	uint64_t value;
23
} machine_sig_t;
24
25
machine_sig_t machine_signature(void);
26
27
// Equal signatures mean nothing observable moved.
28
int machine_sig_equal(machine_sig_t a, machine_sig_t b);
29
30
#endif // X16_TEST_SIGNATURE_H