From e1265fa32837f457ee2c2fa259d12c9545af4bbf Mon Sep 17 00:00:00 2001 From: "Suren A. Chilingaryan" Date: Mon, 27 Apr 2015 02:28:57 +0200 Subject: First stand-alone ipecamera implementation --- apps/check_counter.c | 45 --------------------------------------------- 1 file changed, 45 deletions(-) delete mode 100644 apps/check_counter.c (limited to 'apps/check_counter.c') diff --git a/apps/check_counter.c b/apps/check_counter.c deleted file mode 100644 index b19b7d0..0000000 --- a/apps/check_counter.c +++ /dev/null @@ -1,45 +0,0 @@ -#include -#include -#include - -int main(int argc, char *argv[]) { - int block = 0; - uint32_t value = 0; - uint32_t buf[1024]; - - if (argc < 2) { - printf("Usage:\n\t\t%s \n", argv[0]); - exit(0); - } - - FILE *f = fopen(argv[1], "r"); - if (!f) { - printf("Failed to open file %s\n", argv[1]); - exit(1); - } - - - while (!feof(f)) { - int i, n = fread(buf, 4, 1024, f); - - if (block) i = 0; - else { - i = 1; - value = (buf[0]); - } - - for (; i < n; i++) { - if ((buf[i]) != ++value) { - printf("Pos %lx (Block %i, dword %i) expected %x, but got %x\n", block * 4096 + i * 4, block, i, value, (buf[i])); - exit(1); - } - } - - if (n) block++; - } - - fclose(f); - - printf("Checked %i blocks. All is fine\n", block); - return 0; -} -- cgit v1.2.3