blob: 1f4b2c3b33d1fc6129148d54644129639621fc72 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
|
#include <inttypes.h>
#include <stdarg.h>
#include <stdbool.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#define STRLENMAX 10000
#if defined(CUBE_AVX2)
#include <immintrin.h>
typedef __m256i cube_t;
#elif defined(CUBE_NEON)
#include <stdlib.h>
#include <arm_neon.h>
typedef struct {
uint8x16_t corner;
uint8x16_t edge;
} cube_t;
#else
typedef struct {
uint8_t corner[8];
uint8_t edge[12];
} cube_t;
#endif
/* Basic functions used in most tests */
cube_t solvedcube(void);
bool iserror(cube_t);
bool isconsistent(cube_t);
bool issolvable(cube_t);
bool issolved(cube_t);
cube_t readcube(char *, char *);
void writecube(char *, cube_t, char *);
void nissy_setlogger(void (*logger_function)(const char *, ...));
/* Test function to be implemented by all tests */
void run(void);
void log_stderr(const char *str, ...)
{
va_list args;
va_start(args, str);
vfprintf(stderr, str, args);
va_end(args);
}
int main(void) {
nissy_setlogger(log_stderr);
run();
return 0;
}
|