pico9918-core 1.3.0
TMS9918A / F18A video display processor emulation in C99
Loading...
Searching...
No Matches
config_test.c File Reference

pico9918-core - the config block's validation, defaults and migration More...

#include "pico9918_config.h"
#include <stdio.h>
#include <string.h>
+ Include dependency graph for config_test.c:

Go to the source code of this file.

Macros

#define HW_V0_3   0x03
 
#define HW_V1_X   0x10
 
#define HW_V2_X   0x20
 

Functions

static void check (const char *what, unsigned wanted, unsigned got)
 
static void storedAt (uint8_t *config, uint8_t major, uint8_t minor, uint8_t patch)
 
static const pico9918_config_field_t * field (uint8_t offset)
 
int main (void)
 

Variables

static int failures
 

Detailed Description

pico9918-core - the config block's validation, defaults and migration

Copyright (c) 2026 Troy Schrapel

This code is licensed under the MIT license

https://github.com/visrealm/pico9918-core

Nothing else covers these. The goldens and the scene suite both start from a block that is already valid, so the paths that decide what "valid" means - the identity check, the reset to defaults, and the per-version migration that decides which fields a firmware upgrade re-defaults - have never been exercised by a test.

The migration case is the one that matters: it is driven by a version number compared against this library's own descriptor table, and the two have to come from the same build to mean anything.

Definition in file config_test.c.

Macro Definition Documentation

◆ HW_V0_3

#define HW_V0_3   0x03

Definition at line 26 of file config_test.c.

◆ HW_V1_X

#define HW_V1_X   0x10

Definition at line 27 of file config_test.c.

◆ HW_V2_X

#define HW_V2_X   0x20

Definition at line 28 of file config_test.c.

Function Documentation

◆ check()

static void check ( const char *  what,
unsigned  wanted,
unsigned  got 
)
static

Definition at line 32 of file config_test.c.

◆ storedAt()

static void storedAt ( uint8_t *  config,
uint8_t  major,
uint8_t  minor,
uint8_t  patch 
)
static

Definition at line 42 of file config_test.c.

◆ field()

static const pico9918_config_field_t * field ( uint8_t  offset)
static

Definition at line 53 of file config_test.c.

◆ main()

int main ( void  )

Definition at line 62 of file config_test.c.

Variable Documentation

◆ failures

int failures
static

Definition at line 30 of file config_test.c.