clang-format
All checks were successful
Run Unit Tests / build-and-run-unit-tests (push) Successful in 4s

This commit is contained in:
Stephen Seo 2024-09-21 11:43:25 +09:00
parent bb574d2a2c
commit 5068a1b90d
4 changed files with 10 additions and 12 deletions

View file

@ -20,8 +20,8 @@
#define SEODISPARATE_COM_SIMPLE_ARCHIVER_ARCHIVER_H_
// Standard library includes.
#include <stdio.h>
#include <stdint.h>
#include <stdio.h>
// Local includes.
#include "data_structures/hash_map.h"

View file

@ -19,8 +19,8 @@
#include "linked_list.h"
// Standard library includes.
#include <stdlib.h>
#include <stdint.h>
#include <stdlib.h>
SDArchiverLinkedList *simple_archiver_list_init(void) {
SDArchiverLinkedList *list = malloc(sizeof(SDArchiverLinkedList));

View file

@ -17,10 +17,10 @@
// `data_structures/test.c` is the source for testing data structure code.
// Standard library includes.
#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <stdint.h>
// Local includes.
#include "../algorithms/linear_congruential_gen.h"
@ -148,8 +148,8 @@ int main(void) {
key = malloc(sizeof(int32_t));
*value = idx;
*key = idx;
simple_archiver_hash_map_insert(hash_map, value, key, sizeof(int32_t), NULL,
NULL);
simple_archiver_hash_map_insert(hash_map, value, key, sizeof(int32_t),
NULL, NULL);
}
}
@ -205,16 +205,14 @@ int main(void) {
CHECK_TRUE(simple_archiver_hash_map_iter(hash_map, hash_map_iter_check_fn,
found) == 0);
for (uint32_t idx = 0; idx < SDARCHIVER_DS_TEST_HASH_MAP_ITER_SIZE;
++idx) {
for (uint32_t idx = 0; idx < SDARCHIVER_DS_TEST_HASH_MAP_ITER_SIZE; ++idx) {
CHECK_TRUE(found[idx] == 1);
}
CHECK_TRUE(simple_archiver_hash_map_iter(hash_map, hash_map_iter_check_fn2,
found) == 2);
for (uint32_t idx = 0; idx < SDARCHIVER_DS_TEST_HASH_MAP_ITER_SIZE;
++idx) {
for (uint32_t idx = 0; idx < SDARCHIVER_DS_TEST_HASH_MAP_ITER_SIZE; ++idx) {
CHECK_TRUE(found[idx] == 1);
}
@ -289,7 +287,7 @@ int main(void) {
// Deterministic randomization.
for (uint32_t idx = max - 1; idx-- > 0;) {
uint32_t other_idx = simple_archiver_algo_lcg_defaults(idx) %
(unsigned long long)(idx + 1);
(unsigned long long)(idx + 1);
if (max - 1 != other_idx) {
uint32_t temp = array[max - 1];
array[max - 1] = array[other_idx];
@ -357,7 +355,7 @@ int main(void) {
// Deterministic randomization.
for (uint32_t idx = max - 1; idx-- > 0;) {
uint32_t other_idx = simple_archiver_algo_lcg_defaults(idx) %
(unsigned long long)(idx + 1);
(unsigned long long)(idx + 1);
if (max - 1 != other_idx) {
uint32_t temp = array[max - 1];
array[max - 1] = array[other_idx];

View file

@ -17,10 +17,10 @@
// `test.c` is the source for testing code.
// Standard library includes.
#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <stdint.h>
// Local includes.
#include "helpers.h"