~cypheon/xos

xos/test.c -rw-r--r-- 533 bytes
567db604 — Johann Rudloff Implement scanning and allocation of physical memory. 7 years ago
                                                                                
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
#include <stdio.h>

#include "boot2.c"

void pread_sector(){};

void test_strncmp(const char *a, const char *b, int n) {
  printf("strncmp(%s, %s, %d) = %d\n", a, b, n, strncmp(a,b,n));
}
void main(int argc, char **argv) {
  test_strncmp("boot", "boot", 4);
  test_strncmp("boot#", "boot", 4);
  test_strncmp("boot", "boot#", 4);
  test_strncmp("boot#", "boot", 5);
  test_strncmp("aoot#", "boot", 5);
  test_strncmp("boot", "boot", 9);
  test_strncmp("boot", "boot2", 9);
  test_strncmp("a", "b", 4);
  test_strncmp("a", "b", 1);
}