summaryrefslogtreecommitdiff
path: root/src/lib/tests/crc32_test.c
diff options
context:
space:
mode:
authorDimitri Staessens <dimitri@ouroboros.rocks>2026-04-26 07:56:38 +0200
committerSander Vrijders <sander@ouroboros.rocks>2026-05-06 09:05:02 +0200
commit4cfc607ebbff840991d893a8c0fa3a004caeb416 (patch)
tree5fd8029adab78566a429b55997482c626d6b4542 /src/lib/tests/crc32_test.c
parent8b5e03fff17dcfcdd73ed40d950ee998d7e9d9f1 (diff)
downloadouroboros-4cfc607ebbff840991d893a8c0fa3a004caeb416.tar.gz
ouroboros-4cfc607ebbff840991d893a8c0fa3a004caeb416.zip
lib: Move CRC implementations to a subfolder
Signed-off-by: Dimitri Staessens <dimitri@ouroboros.rocks> Signed-off-by: Sander Vrijders <sander@ouroboros.rocks>
Diffstat (limited to 'src/lib/tests/crc32_test.c')
-rw-r--r--src/lib/tests/crc32_test.c72
1 files changed, 0 insertions, 72 deletions
diff --git a/src/lib/tests/crc32_test.c b/src/lib/tests/crc32_test.c
deleted file mode 100644
index 5a1ddd87..00000000
--- a/src/lib/tests/crc32_test.c
+++ /dev/null
@@ -1,72 +0,0 @@
-/*
- * Ouroboros - Copyright (C) 2016 - 2026
- *
- * Test of the CRC32 function
- *
- * Dimitri Staessens <dimitri@ouroboros.rocks>
- * Sander Vrijders <sander@ouroboros.rocks>
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License version 2 as
- * published by the Free Software Foundation.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., http://www.fsf.org/about/contact/.
- */
-
-#include <ouroboros/crc32.h>
-
-#include <stdlib.h>
-#include <stdint.h>
-#include <assert.h>
-#include <string.h>
-#include <stdio.h>
-
-/*
- * Test vectors calculated at
- * https://www.lammertbies.nl/comm/info/crc-calculation.html
- */
-
-int crc32_test(int argc,
- char ** argv)
-{
- uint32_t crc = 0;
- int i = 0;
-
- (void) argc;
- (void) argv;
-
- crc32(&crc, "0", 1);
- if (crc != 0xF4DBDF21)
- return -1;
-
- crc = 0;
-
- crc32(&crc, "123456789", 9);
- if (crc != 0xCBF43926)
- return -1;
-
- crc = 0;
-
- crc32(&crc, "987654321", 9);
- if (crc != 0x015F0201)
- return -1;
-
- crc32(&crc, "123456789", 9);
- if (crc != 0x806B60E3)
- return -1;
-
- crc = 0;
-
- crc32(&crc, &i , 1);
- if (crc != 0xD202EF8D)
- return -1;
-
- return 0;
-}