Files
fluxengine/tests/amiga.cc
David Given 792cc88192 The Amiga writer now generates valid flux files --- but it looks like the
writer's broken (both the Amiga and the Brother have failed).
2019-12-14 20:44:48 +01:00

39 lines
817 B
C++

#include "globals.h"
#include "bytes.h"
#include "record.h"
#include "decoders/decoders.h"
#include "arch/amiga/amiga.h"
#include <assert.h>
static const Bytes testData = {
0x52, /* 0101 0010 */
0xff, /* 1111 1111 */
0x4a, /* 0100 1010 */
0x22, /* 0010 0010 */
};
static const Bytes testDataInterleaved = {
0x1f, /* 0001 1111 */
0x35, /* 0011 0101 */
0xcf, /* 1100 1111 */
0x80, /* 1000 0000 */
};
static void testInterleave(void)
{
Bytes interleaved = amigaInterleave(testData);
assert(interleaved == testDataInterleaved);
}
static void testDeinterleave(void)
{
Bytes deinterleaved = amigaDeinterleave(testDataInterleaved);
assert(deinterleaved == testData);
}
int main(int argc, const char* argv[])
{
testDeinterleave();
testInterleave();
return 0;
}