diff --git a/Makefile b/Makefile index f37ae84..a167873 100644 --- a/Makefile +++ b/Makefile @@ -12,6 +12,7 @@ INC_DIR = include LIBFT_DIR = libft TEST_DIR = test GTEST_DIR = test/gtest +TEST_BUILD_DIR = test/build SRC = $(SRC_DIR)/main.c \ $(SRC_DIR)/initialization/check_args.c \ @@ -51,10 +52,10 @@ TEST_SRC = $(TEST_DIR)/test_check_args.cpp \ $(TEST_DIR)/test_greedy_operation.cpp \ $(TEST_DIR)/test_is_sorted_stack.cpp \ $(TEST_DIR)/test_sort.cpp -TEST_OBJ = $(patsubst $(TEST_DIR)/%.cpp, $(BUILD_DIR)/$(TEST_DIR)/%.o, $(TEST_SRC)) +TEST_OBJ = $(patsubst $(TEST_DIR)/%.cpp, $(TEST_BUILD_DIR)/%.o, $(TEST_SRC)) DEPFLAGS = -MMD -MP GTEST_SRC = $(GTEST_DIR)/gtest_main.cc $(GTEST_DIR)/gtest-all.cc -GTEST_OBJ = $(patsubst $(GTEST_DIR)/%.cc, $(BUILD_DIR)/$(GTEST_DIR)/%.o, $(GTEST_SRC)) +GTEST_OBJ = $(patsubst $(GTEST_DIR)/%.cc, $(TEST_BUILD_DIR)/%.o, $(GTEST_SRC)) GTEST_VERSION = 1.14.0 GTEST_ARCHIVE = v$(GTEST_VERSION).tar.gz @@ -116,9 +117,9 @@ test_main: all $(GTEST_OBJ) $(TEST_OBJ) test_clean: @echo "$(BLUE)test cleaning$(RESET)" - @$(RM) -r $(BUILD_DIR)/$(TEST_DIR) + @$(RM) -r $(TEST_BUILD_DIR) -$(BUILD_DIR)/$(TEST_DIR)/%.o: $(TEST_DIR)/%.cpp +$(TEST_BUILD_DIR)/%.o: $(TEST_DIR)/%.cpp @mkdir -p $(@D) @$(CXX) $(CXXFLAGS) -I $(TEST_DIR) $(INCLUDE) -c $< -o $@ @printf "$(GREEN).$(RESET)" @@ -126,9 +127,9 @@ $(BUILD_DIR)/$(TEST_DIR)/%.o: $(TEST_DIR)/%.cpp $(GTEST_OBJ): $(GTEST_DIR) @echo "$(BLUE)test compiling$(RESET)" @mkdir -p $(@D) - @$(CXX) $(CXXFLAGS) -I $(TEST_DIR) $(INCLUDE) -c $(GTEST_DIR)/gtest-all.cc -o $(BUILD_DIR)/$(GTEST_DIR)/gtest-all.o + @$(CXX) $(CXXFLAGS) -I $(TEST_DIR) $(INCLUDE) -c $(GTEST_DIR)/gtest-all.cc -o $(TEST_BUILD_DIR)/gtest-all.o @printf "$(GREEN).$(RESET)" - @$(CXX) $(CXXFLAGS) -I $(TEST_DIR) $(INCLUDE) -c $(GTEST_DIR)/gtest_main.cc -o $(BUILD_DIR)/$(GTEST_DIR)/gtest_main.o + @$(CXX) $(CXXFLAGS) -I $(TEST_DIR) $(INCLUDE) -c $(GTEST_DIR)/gtest_main.cc -o $(TEST_BUILD_DIR)/gtest_main.o @printf "$(GREEN).$(RESET)" $(GTEST_DIR): diff --git a/include/initialization.h b/include/initialization.h new file mode 100644 index 0000000..376fb6c --- /dev/null +++ b/include/initialization.h @@ -0,0 +1,22 @@ +/* ************************************************************************** */ +/* */ +/* ::: :::::::: */ +/* initialization.h :+: :+: :+: */ +/* +:+ +:+ +:+ */ +/* By: reasuke +#+ +:+ +#+ */ +/* +#+#+#+#+#+ +#+ */ +/* Created: 2024/02/11 12:30:37 by reasuke #+# #+# */ +/* Updated: 2024/02/11 12:33:50 by reasuke ### ########.fr */ +/* */ +/* ************************************************************************** */ + +#ifndef INITIALIZATION_H +# define INITIALIZATION_H + +# include "push_swap.h" + +int check_args(int argc, char **argv); +t_stack *generate_stack(int argc, char **argv); +void exit_with_error(void); + +#endif diff --git a/include/large_sort.h b/include/large_sort.h new file mode 100644 index 0000000..92c1c2d --- /dev/null +++ b/include/large_sort.h @@ -0,0 +1,23 @@ +/* ************************************************************************** */ +/* */ +/* ::: :::::::: */ +/* large_sort.h :+: :+: :+: */ +/* +:+ +:+ +:+ */ +/* By: reasuke +#+ +:+ +#+ */ +/* +#+#+#+#+#+ +#+ */ +/* Created: 2024/02/11 12:36:38 by reasuke #+# #+# */ +/* Updated: 2024/02/11 12:37:50 by reasuke ### ########.fr */ +/* */ +/* ************************************************************************** */ + +#ifndef LARGE_SORT_H +# define LARGE_SORT_H + +# include "push_swap.h" + +void large_sort(t_stack **p_a, t_stack **p_b); +void set_cost(t_stack **p_a, t_stack **p_b); +void set_opt(t_stack **p_b); +void greedy_operation(t_stack **p_a, t_stack **p_b); + +#endif diff --git a/include/push_swap.h b/include/push_swap.h index 428b773..6301243 100644 --- a/include/push_swap.h +++ b/include/push_swap.h @@ -6,7 +6,7 @@ /* By: reasuke +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2024/01/10 12:37:54 by reasuke #+# #+# */ -/* Updated: 2024/02/10 21:18:02 by reasuke ### ########.fr */ +/* Updated: 2024/02/11 12:58:12 by reasuke ### ########.fr */ /* */ /* ************************************************************************** */ @@ -14,73 +14,11 @@ # define PUSH_SWAP_H # include "../libft/libft.h" +# include "types.h" +# include "utils.h" # include # include # include # include -typedef t_list t_stack; - -typedef enum e_method -{ - INIT, - FF, - FR, - RF, - RR, -} t_method; - -typedef struct s_content -{ - int index; - int sf_cost; - int sr_cost; - int if_cost; - int ir_cost; - int min_cost; - t_method opt_method; - bool is_opt; -} t_content; - -int check_args(int argc, char **argv); -t_stack *generate_stack(int argc, char **argv); -void exit_with_error(void); - -void sort(t_stack **p_a, t_stack **p_b); -void nano_sort(t_stack **p_a); -void micro_sort(t_stack **p_a, t_stack **p_b); -void large_sort(t_stack **p_a, t_stack **p_b); -void set_cost(t_stack **p_a, t_stack **p_b); -void set_opt(t_stack **p_b); -void greedy_operation(t_stack **p_a, t_stack **p_b); -bool is_sorted_stack(t_stack *st); - -void operate_sa(t_stack **p_a); -void operate_sb(t_stack **p_b); -void operate_ss(t_stack **p_a, t_stack **p_b); -void operate_ra(t_stack **p_a); -void operate_rb(t_stack **p_b); -void operate_rr(t_stack **p_a, t_stack **p_b); -void operate_rra(t_stack **p_a); -void operate_rrb(t_stack **p_a); -void operate_rrr(t_stack **p_a, t_stack **p_b); -void operate_pa(t_stack **p_b, t_stack **p_a); -void operate_pb(t_stack **p_a, t_stack **p_b); -void do_single_n_operations(t_stack **p_st, int n, - void (*operation)(t_stack **)); -void do_double_n_operations(t_stack **p_a, t_stack **p_b, int n, - void (*operation)(t_stack **, t_stack **)); - -void push_stack(t_stack **p_s1, t_stack **p_s2); -void swap_stack(t_stack **p_stack); -void rotate_stack(t_stack **p_stack); -void reverse_rotate_stack(t_stack **p_stack); - -void clear_stack(t_stack **p_stack, void (*del)(void *)); -t_content *get_content(t_stack *st); -int get_first_index(t_stack **p_stack); -int get_second_index(t_stack **p_stack); -int get_third_index(t_stack **p_stack); -int stack_size(t_stack *stack); - #endif diff --git a/include/sort.h b/include/sort.h new file mode 100644 index 0000000..ba48c1b --- /dev/null +++ b/include/sort.h @@ -0,0 +1,24 @@ +/* ************************************************************************** */ +/* */ +/* ::: :::::::: */ +/* sort.h :+: :+: :+: */ +/* +:+ +:+ +:+ */ +/* By: reasuke +#+ +:+ +#+ */ +/* +#+#+#+#+#+ +#+ */ +/* Created: 2024/02/11 12:42:03 by reasuke #+# #+# */ +/* Updated: 2024/02/11 12:45:45 by reasuke ### ########.fr */ +/* */ +/* ************************************************************************** */ + +#ifndef SORT_H +# define SORT_H + +# include "push_swap.h" + +void sort(t_stack **p_a, t_stack **p_b); +void nano_sort(t_stack **p_a); +void micro_sort(t_stack **p_a, t_stack **p_b); +void large_sort(t_stack **p_a, t_stack **p_b); +bool is_sorted_stack(t_stack *st); + +#endif diff --git a/include/stack_operations.h b/include/stack_operations.h new file mode 100644 index 0000000..40bf5ff --- /dev/null +++ b/include/stack_operations.h @@ -0,0 +1,39 @@ +/* ************************************************************************** */ +/* */ +/* ::: :::::::: */ +/* stack_operations.h :+: :+: :+: */ +/* +:+ +:+ +:+ */ +/* By: reasuke +#+ +:+ +#+ */ +/* +#+#+#+#+#+ +#+ */ +/* Created: 2024/02/11 12:41:01 by reasuke #+# #+# */ +/* Updated: 2024/02/11 12:41:49 by reasuke ### ########.fr */ +/* */ +/* ************************************************************************** */ + +#ifndef STACK_OPERATIONS_H +# define STACK_OPERATIONS_H + +# include "push_swap.h" + +void operate_sa(t_stack **p_a); + +void operate_sb(t_stack **p_b); +void operate_ss(t_stack **p_a, t_stack **p_b); +void operate_ra(t_stack **p_a); +void operate_rb(t_stack **p_b); +void operate_rr(t_stack **p_a, t_stack **p_b); +void operate_rra(t_stack **p_a); +void operate_rrb(t_stack **p_a); +void operate_rrr(t_stack **p_a, t_stack **p_b); +void operate_pa(t_stack **p_b, t_stack **p_a); +void operate_pb(t_stack **p_a, t_stack **p_b); +void do_single_n_operations(t_stack **p_st, int n, + void (*operation)(t_stack **)); +void do_double_n_operations(t_stack **p_a, t_stack **p_b, int n, + void (*operation)(t_stack **, t_stack **)); + +void push_stack(t_stack **p_s1, t_stack **p_s2); +void swap_stack(t_stack **p_stack); +void rotate_stack(t_stack **p_stack); +void reverse_rotate_stack(t_stack **p_stack); +#endif diff --git a/include/types.h b/include/types.h new file mode 100644 index 0000000..2788114 --- /dev/null +++ b/include/types.h @@ -0,0 +1,38 @@ +/* ************************************************************************** */ +/* */ +/* ::: :::::::: */ +/* types.h :+: :+: :+: */ +/* +:+ +:+ +:+ */ +/* By: reasuke +#+ +:+ +#+ */ +/* +#+#+#+#+#+ +#+ */ +/* Created: 2024/02/11 12:57:41 by reasuke #+# #+# */ +/* Updated: 2024/02/11 12:58:04 by reasuke ### ########.fr */ +/* */ +/* ************************************************************************** */ + +#ifndef TYPES_H +# define TYPES_H + +typedef t_list t_stack; + +typedef enum e_method +{ + INIT, + FF, + FR, + RF, + RR, +} t_method; + +typedef struct s_content +{ + int index; + int sf_cost; + int sr_cost; + int if_cost; + int ir_cost; + int min_cost; + t_method opt_method; + bool is_opt; +} t_content; +#endif diff --git a/include/utils.h b/include/utils.h new file mode 100644 index 0000000..d424601 --- /dev/null +++ b/include/utils.h @@ -0,0 +1,25 @@ +/* ************************************************************************** */ +/* */ +/* ::: :::::::: */ +/* utils.h :+: :+: :+: */ +/* +:+ +:+ +:+ */ +/* By: reasuke +#+ +:+ +#+ */ +/* +#+#+#+#+#+ +#+ */ +/* Created: 2024/02/11 12:39:00 by reasuke #+# #+# */ +/* Updated: 2024/02/11 12:39:47 by reasuke ### ########.fr */ +/* */ +/* ************************************************************************** */ + +#ifndef UTILS_H +# define UTILS_H + +# include "push_swap.h" + +void clear_stack(t_stack **p_stack, void (*del)(void *)); +t_content *get_content(t_stack *st); +int get_first_index(t_stack **p_stack); +int get_second_index(t_stack **p_stack); +int get_third_index(t_stack **p_stack); +int stack_size(t_stack *stack); + +#endif diff --git a/src/initialization/check_args.c b/src/initialization/check_args.c index 1aca3f6..2b3b051 100644 --- a/src/initialization/check_args.c +++ b/src/initialization/check_args.c @@ -6,11 +6,11 @@ /* By: reasuke +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2024/01/11 14:44:55 by reasuke #+# #+# */ -/* Updated: 2024/02/07 15:06:08 by reasuke ### ########.fr */ +/* Updated: 2024/02/11 12:35:17 by reasuke ### ########.fr */ /* */ /* ************************************************************************** */ -#include "push_swap.h" +#include "initialization.h" static bool _has_not_digit(int argc, char **argv) { diff --git a/src/initialization/exit_with_error.c b/src/initialization/exit_with_error.c index c4deee8..52c84d8 100644 --- a/src/initialization/exit_with_error.c +++ b/src/initialization/exit_with_error.c @@ -6,11 +6,11 @@ /* By: reasuke +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2024/01/11 14:38:17 by reasuke #+# #+# */ -/* Updated: 2024/02/07 15:05:34 by reasuke ### ########.fr */ +/* Updated: 2024/02/11 12:35:14 by reasuke ### ########.fr */ /* */ /* ************************************************************************** */ -#include "push_swap.h" +#include "initialization.h" void exit_with_error(void) { diff --git a/src/initialization/generate_stack.c b/src/initialization/generate_stack.c index 892d165..0ce473c 100644 --- a/src/initialization/generate_stack.c +++ b/src/initialization/generate_stack.c @@ -6,11 +6,11 @@ /* By: reasuke +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2024/01/11 19:04:40 by reasuke #+# #+# */ -/* Updated: 2024/02/07 15:06:20 by reasuke ### ########.fr */ +/* Updated: 2024/02/11 12:35:32 by reasuke ### ########.fr */ /* */ /* ************************************************************************** */ -#include "push_swap.h" +#include "initialization.h" int *_generate_int_array(int array_size) { diff --git a/src/main.c b/src/main.c index d47a94f..1ebb70e 100644 --- a/src/main.c +++ b/src/main.c @@ -6,11 +6,13 @@ /* By: reasuke +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2024/01/10 12:37:36 by reasuke #+# #+# */ -/* Updated: 2024/02/10 21:19:08 by reasuke ### ########.fr */ +/* Updated: 2024/02/11 12:54:10 by reasuke ### ########.fr */ /* */ /* ************************************************************************** */ +#include "initialization.h" #include "push_swap.h" +#include "sort.h" #ifdef LEAK # ifdef __APPLE__ diff --git a/src/sort/is_sorted_stack.c b/src/sort/is_sorted_stack.c index c275d55..1fe7b89 100644 --- a/src/sort/is_sorted_stack.c +++ b/src/sort/is_sorted_stack.c @@ -6,11 +6,12 @@ /* By: reasuke +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2024/02/10 18:47:11 by reasuke #+# #+# */ -/* Updated: 2024/02/10 19:12:48 by reasuke ### ########.fr */ +/* Updated: 2024/02/11 12:54:04 by reasuke ### ########.fr */ /* */ /* ************************************************************************** */ #include "push_swap.h" +#include "sort.h" bool is_sorted_stack(t_stack *st) { diff --git a/src/sort/large_sort/greedy_operation.c b/src/sort/large_sort/greedy_operation.c index 3054a9d..becf669 100644 --- a/src/sort/large_sort/greedy_operation.c +++ b/src/sort/large_sort/greedy_operation.c @@ -6,11 +6,13 @@ /* By: reasuke +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2024/02/10 10:43:16 by reasuke #+# #+# */ -/* Updated: 2024/02/10 20:34:46 by reasuke ### ########.fr */ +/* Updated: 2024/02/11 12:53:46 by reasuke ### ########.fr */ /* */ /* ************************************************************************** */ +#include "large_sort.h" #include "push_swap.h" +#include "stack_operations.h" static t_stack *_find_opt_st_b(t_stack **p_b) { diff --git a/src/sort/large_sort/large_sort.c b/src/sort/large_sort/large_sort.c index 070e5a2..3e77954 100644 --- a/src/sort/large_sort/large_sort.c +++ b/src/sort/large_sort/large_sort.c @@ -6,11 +6,14 @@ /* By: reasuke +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2024/01/22 16:55:10 by reasuke #+# #+# */ -/* Updated: 2024/02/10 21:24:58 by reasuke ### ########.fr */ +/* Updated: 2024/02/11 12:53:49 by reasuke ### ########.fr */ /* */ /* ************************************************************************** */ +#include "large_sort.h" #include "push_swap.h" +#include "sort.h" +#include "stack_operations.h" static void _push_b_n_times(t_stack **p_a, t_stack **p_b, int n) { diff --git a/src/sort/large_sort/set_cost.c b/src/sort/large_sort/set_cost.c index 47ff75f..7c97854 100644 --- a/src/sort/large_sort/set_cost.c +++ b/src/sort/large_sort/set_cost.c @@ -6,10 +6,11 @@ /* By: reasuke +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2024/02/08 12:17:33 by reasuke #+# #+# */ -/* Updated: 2024/02/08 21:47:27 by reasuke ### ########.fr */ +/* Updated: 2024/02/11 12:53:50 by reasuke ### ########.fr */ /* */ /* ************************************************************************** */ +#include "large_sort.h" #include "push_swap.h" static int _calc_insertion_threshold(t_stack **p_a, t_stack *st_b) diff --git a/src/sort/large_sort/set_opt.c b/src/sort/large_sort/set_opt.c index e6e1f43..9bcd391 100644 --- a/src/sort/large_sort/set_opt.c +++ b/src/sort/large_sort/set_opt.c @@ -6,10 +6,11 @@ /* By: reasuke +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2024/02/09 10:23:28 by reasuke #+# #+# */ -/* Updated: 2024/02/10 21:08:19 by reasuke ### ########.fr */ +/* Updated: 2024/02/11 12:53:55 by reasuke ### ########.fr */ /* */ /* ************************************************************************** */ +#include "large_sort.h" #include "push_swap.h" static int _calc_cost(t_stack *st_b, t_method method) diff --git a/src/sort/micro_sort.c b/src/sort/micro_sort.c index cbdce1a..8f70f63 100644 --- a/src/sort/micro_sort.c +++ b/src/sort/micro_sort.c @@ -6,11 +6,13 @@ /* By: reasuke +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2024/01/15 16:32:27 by reasuke #+# #+# */ -/* Updated: 2024/02/10 21:17:40 by reasuke ### ########.fr */ +/* Updated: 2024/02/11 12:54:02 by reasuke ### ########.fr */ /* */ /* ************************************************************************** */ #include "push_swap.h" +#include "sort.h" +#include "stack_operations.h" static void _handle_4(t_stack **p_a, t_stack **p_b) { diff --git a/src/sort/nano_sort.c b/src/sort/nano_sort.c index 6f051a5..14c14ca 100644 --- a/src/sort/nano_sort.c +++ b/src/sort/nano_sort.c @@ -6,11 +6,13 @@ /* By: reasuke +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2024/01/12 15:58:22 by reasuke #+# #+# */ -/* Updated: 2024/02/10 21:14:43 by reasuke ### ########.fr */ +/* Updated: 2024/02/11 12:54:19 by reasuke ### ########.fr */ /* */ /* ************************************************************************** */ #include "push_swap.h" +#include "sort.h" +#include "stack_operations.h" static void _handle_2(t_stack **p_a) { diff --git a/src/sort/sort.c b/src/sort/sort.c index 127bc74..ff7cf8f 100644 --- a/src/sort/sort.c +++ b/src/sort/sort.c @@ -6,11 +6,12 @@ /* By: reasuke +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2024/01/15 15:10:35 by reasuke #+# #+# */ -/* Updated: 2024/02/10 21:36:16 by reasuke ### ########.fr */ +/* Updated: 2024/02/11 12:54:21 by reasuke ### ########.fr */ /* */ /* ************************************************************************** */ #include "push_swap.h" +#include "sort.h" void sort(t_stack **p_a, t_stack **p_b) { diff --git a/test/test_check_args.cpp b/test/test_check_args.cpp index 1c292b1..c1b0050 100644 --- a/test/test_check_args.cpp +++ b/test/test_check_args.cpp @@ -3,6 +3,7 @@ #include "gtest/gtest.h" extern "C" { +#include "initialization.h" #include "push_swap.h" } diff --git a/test/test_greedy_operation.cpp b/test/test_greedy_operation.cpp index 726e9ec..a97b2e0 100644 --- a/test/test_greedy_operation.cpp +++ b/test/test_greedy_operation.cpp @@ -6,6 +6,7 @@ #include "gtest/gtest.h" extern "C" { +#include "large_sort.h" #include "push_swap.h" } diff --git a/test/test_is_sorted_stack.cpp b/test/test_is_sorted_stack.cpp index 828cb87..340caeb 100644 --- a/test/test_is_sorted_stack.cpp +++ b/test/test_is_sorted_stack.cpp @@ -7,6 +7,7 @@ extern "C" { #include "push_swap.h" +#include "sort.h" } // st: sorted diff --git a/test/test_push_stack.cpp b/test/test_push_stack.cpp index 160aba6..557a5a9 100644 --- a/test/test_push_stack.cpp +++ b/test/test_push_stack.cpp @@ -4,6 +4,7 @@ extern "C" { #include "push_swap.h" +#include "stack_operations.h" } static void *convert_const_char_to_void(const char *str) { diff --git a/test/test_reverse_rotate_stack.cpp b/test/test_reverse_rotate_stack.cpp index 9d94962..aef4e33 100644 --- a/test/test_reverse_rotate_stack.cpp +++ b/test/test_reverse_rotate_stack.cpp @@ -4,6 +4,7 @@ extern "C" { #include "push_swap.h" +#include "stack_operations.h" } static void *convert_const_char_to_void(const char *str) { diff --git a/test/test_rotate_stack.cpp b/test/test_rotate_stack.cpp index 4d5506a..002b0f0 100644 --- a/test/test_rotate_stack.cpp +++ b/test/test_rotate_stack.cpp @@ -4,6 +4,7 @@ extern "C" { #include "push_swap.h" +#include "stack_operations.h" } static void *convert_const_char_to_void(const char *str) { diff --git a/test/test_set_cost.cpp b/test/test_set_cost.cpp index 0c5e8ad..dac4d0b 100644 --- a/test/test_set_cost.cpp +++ b/test/test_set_cost.cpp @@ -6,6 +6,7 @@ #include "gtest/gtest.h" extern "C" { +#include "large_sort.h" #include "push_swap.h" } diff --git a/test/test_set_opt_method.cpp b/test/test_set_opt_method.cpp index c1718e4..0cbafce 100644 --- a/test/test_set_opt_method.cpp +++ b/test/test_set_opt_method.cpp @@ -6,6 +6,7 @@ #include "gtest/gtest.h" extern "C" { +#include "large_sort.h" #include "push_swap.h" } diff --git a/test/test_sort.cpp b/test/test_sort.cpp index 7fa33c4..520d6f1 100644 --- a/test/test_sort.cpp +++ b/test/test_sort.cpp @@ -8,6 +8,7 @@ extern "C" { #include "push_swap.h" +#include "sort.h" } static void sort_test_main(int N) { diff --git a/test/test_swap_stack.cpp b/test/test_swap_stack.cpp index 63a1031..c62626c 100644 --- a/test/test_swap_stack.cpp +++ b/test/test_swap_stack.cpp @@ -4,6 +4,7 @@ extern "C" { #include "push_swap.h" +#include "stack_operations.h" } static void *convert_const_char_to_void(const char *str) {