GrafX2 2.9.3227
The ultimate 256-color painting program
tests.c File Reference

Unit tests. More...

#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
#include "tests.h"
#include "../struct.h"
#include "../oldies.h"
#include "../packbits.h"
#include "../io.h"
#include "../gfx2log.h"
+ Include dependency graph for tests.c:

Functions

unsigned int MOTO_MAP_pack (byte *packed, const byte *unpacked, unsigned int unpacked_len)
 Pack a stream of byte in the format used by Thomson MO/TO MAP files. More...
 
int Test_MOTO_MAP_pack (char *errmsg)
 Tests for MOTO_MAP_pack() More...
 
int Test_CPC_compare_colors (char *errmsg)
 Test for Test_CPC_compare_colors() More...
 
int Test_Packbits (char *errmsg)
 Tests for the packbits compression used in IFF ILBM, etc. More...
 

Detailed Description

Unit tests.

Function Documentation

◆ MOTO_MAP_pack()

unsigned int MOTO_MAP_pack ( byte packed,
const byte unpacked,
unsigned int  unpacked_len 
)

Pack a stream of byte in the format used by Thomson MO/TO MAP files.

  • 00 cc xx yy .. : encodes a "copy run" (cc = bytes to copy)
  • cc xx : encodes a "repeat run" (cc > 0 : count)

References GFX2_DEBUG, GFX2_ERROR, GFX2_Log(), and GFX2_malloc.

Referenced by Save_MOTO(), and Test_MOTO_MAP_pack().

◆ Test_MOTO_MAP_pack()

int Test_MOTO_MAP_pack ( char *  errmsg)

◆ Test_CPC_compare_colors()

int Test_CPC_compare_colors ( char *  errmsg)

◆ Test_Packbits()