Skip to content

Commit

Permalink
tests for avlnode
Browse files Browse the repository at this point in the history
  • Loading branch information
RidaEn-nasry committed Oct 21, 2022
1 parent 0f3cde9 commit 21d95b0
Show file tree
Hide file tree
Showing 33 changed files with 335 additions and 154 deletions.
4 changes: 2 additions & 2 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,9 @@
"name": "(lldb) Launch",
"type": "lldb",
"request": "launch",
"program": "/Users/wa5ina/42/Reimplementing-STL-Containers./data_structures/avl/a.out",
"program": "/Users/ren-nasr/Reimplementing-STL-Containers./test",
"args": [
"all"
"avlnode"
],
"cwd": "${cwd}",

Expand Down
5 changes: 3 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,8 @@ TESTS=./tests/vector.cpp\
./tests/lexico_compare.cpp\
./tests/is_integral.cpp\
./tests/equal.cpp\
./tests/map.cpp
./tests/avlnode.cpp
# ./tests/map.cpp

DEP=./others/choose_type.hpp\
./containers/vector.hpp\
Expand All @@ -35,8 +36,8 @@ DEP=./others/choose_type.hpp\
./utility/pair.hpp\
./functional/less.hpp\
./containers/map/avlnode.hpp\
./containers/map/map.hpp\
./tests/test.hpp
#./containers/map/map.hpp\
TEST_OBJS=$(TESTS:.cpp=.o)

Expand Down
12 changes: 4 additions & 8 deletions adapters/reverse_iterator.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
/* By: ren-nasr <[email protected]> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2022/10/01 20:12:30 by ren-nasr #+# #+# */
/* Updated: 2022/10/08 22:28:54 by ren-nasr ### ########.fr */
/* Updated: 2022/10/21 09:55:21 by ren-nasr ### ########.fr */
/* */
/* ************************************************************************** */

Expand All @@ -19,15 +19,11 @@
/* iterator as underlying iterator. */
/* &*it = &*(it.base() - 1) */
/* ************************************************************************** */

namespace ft {

#ifndef REVERSE_ITERATOR_HPP
#define REVERSE_ITERATOR_HPP

#include <iterator_traits.hpp>


namespace ft {
template <class Iter>
class reverse_iterator {
/*********************** Member types ***********************/
Expand Down Expand Up @@ -158,7 +154,7 @@ namespace ft {
return lhs.base() >= rhs.base();
}

#endif


} // namespace ft
} // namespace ft
#endif
10 changes: 5 additions & 5 deletions adapters/stack.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
/* By: ren-nasr <[email protected]> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2022/10/02 12:47:18 by ren-nasr #+# #+# */
/* Updated: 2022/10/08 20:14:29 by ren-nasr ### ########.fr */
/* Updated: 2022/10/21 09:55:35 by ren-nasr ### ########.fr */
/* */
/* ************************************************************************** */

Expand All @@ -17,11 +17,11 @@
/* changing their behaviour. */
/*******************************************************************************************/


namespace ft {
#ifndef STACK_HPP
#define STACK_HPP

namespace ft {


template <class T, class Container = vector<T> >
class stack {
Expand Down Expand Up @@ -80,6 +80,6 @@ namespace ft {
container_type _cntr;
};

} // namespace ft

#endif
} // namespace ft
#endif
12 changes: 7 additions & 5 deletions algorithms/equal.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,16 @@
/* By: ren-nasr <[email protected]> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2022/10/08 12:11:13 by ren-nasr #+# #+# */
/* Updated: 2022/10/08 22:23:37 by ren-nasr ### ########.fr */
/* Updated: 2022/10/21 09:54:23 by ren-nasr ### ########.fr */
/* */
/* ************************************************************************** */

namespace ft {

#ifndef EQUAL_HPP
#define EQUAL_HPP


namespace ft {

/************* default *******************/
template <class InputIterator1, class InputIterator2>
bool equal(InputIterator1 first1, InputIterator1 last1, InputIterator2 first2) {
Expand All @@ -40,5 +42,5 @@ namespace ft {
return true;
};

#endif
}
}
#endif
12 changes: 6 additions & 6 deletions algorithms/lexico_compare.hpp
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* lexicographical_compare.hpp :+: :+: :+: */
/* lexico_compare.hpp :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: ren-nasr <[email protected]> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2022/10/08 11:58:26 by ren-nasr #+# #+# */
/* Updated: 2022/10/08 12:08:49 by ren-nasr ### ########.fr */
/* Updated: 2022/10/21 09:55:01 by ren-nasr ### ########.fr */
/* */
/* ************************************************************************** */

namespace ft {

#ifndef LEXICOGRAPHICAL_COMPARE_HPP
#define LEXICOGRAPHICAL_COMPARE_HPP
namespace ft {


/** default (1) */
template <class InputIterator1, class InputIterator2>
Expand Down Expand Up @@ -53,5 +53,5 @@ namespace ft {
return (first1 == last1 && first2 != last2);
};

#endif
} // namespace ft
} // namespace ft
#endif
3 changes: 2 additions & 1 deletion containers/Vector.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
/* By: ren-nasr <[email protected]> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2022/07/30 13:56:03 by ren-nasr #+# #+# */
/* Updated: 2022/10/19 16:14:14 by ren-nasr ### ########.fr */
/* Updated: 2022/10/21 09:53:55 by ren-nasr ### ########.fr */
/* */
/* ************************************************************************** */

Expand All @@ -22,6 +22,7 @@

#ifndef VECTOR_HPP
#define VECTOR_HPP

#include <memory>
#include <reverse_iterator.hpp>
#include <choose_type.hpp>
Expand Down
Loading

0 comments on commit 21d95b0

Please sign in to comment.