From 25dadb7de65deb144133690b093bb0c544338ceb Mon Sep 17 00:00:00 2001 From: Alessandro Ferro <49845537+xfarrow@users.noreply.github.com> Date: Tue, 11 May 2021 06:51:06 +0200 Subject: [PATCH] Library 4 added template --- librerie/exercise4/Exercise4.pdf | Bin 0 -> 39362 bytes librerie/exercise4/binarytree/binarytree.cpp | 12 + librerie/exercise4/binarytree/binarytree.hpp | 440 +++++++++++++++++ .../binarytree/lnk/binarytreelnk.cpp | 10 + .../binarytree/lnk/binarytreelnk.hpp | 101 ++++ .../binarytree/vec/binarytreevec.cpp | 10 + .../binarytree/vec/binarytreevec.hpp | 114 +++++ librerie/exercise4/bst/bst.cpp | 10 + librerie/exercise4/bst/bst.hpp | 125 +++++ librerie/exercise4/build.sh | 10 + librerie/exercise4/container/container.cpp | 10 + librerie/exercise4/container/container.hpp | 402 ++++++++++++++++ librerie/exercise4/iterator/iterator.hpp | 179 +++++++ librerie/exercise4/list/list.cpp | 10 + librerie/exercise4/list/list.hpp | 169 +++++++ librerie/exercise4/main.cpp | 16 + librerie/exercise4/queue/lst/queuelst.cpp | 10 + librerie/exercise4/queue/lst/queuelst.hpp | 90 ++++ librerie/exercise4/queue/queue.hpp | 61 +++ librerie/exercise4/queue/vec/queuevec.cpp | 10 + librerie/exercise4/queue/vec/queuevec.hpp | 102 ++++ librerie/exercise4/stack/lst/stacklst.cpp | 10 + librerie/exercise4/stack/lst/stacklst.hpp | 90 ++++ librerie/exercise4/stack/stack.hpp | 61 +++ librerie/exercise4/stack/vec/stackvec.cpp | 10 + librerie/exercise4/stack/vec/stackvec.hpp | 101 ++++ librerie/exercise4/vector/vector.cpp | 10 + librerie/exercise4/vector/vector.hpp | 113 +++++ .../zlasdtest/binarytree/binarytree.hpp | 130 +++++ librerie/exercise4/zlasdtest/bst/bst.hpp | 282 +++++++++++ .../zlasdtest/container/container.cpp | 49 ++ .../zlasdtest/container/container.hpp | 351 ++++++++++++++ .../zlasdtest/exercise1/fulltest.cpp | 3 + .../zlasdtest/exercise1/simpletest.cpp | 447 ++++++++++++++++++ .../exercise4/zlasdtest/exercise1/test.hpp | 13 + .../zlasdtest/exercise2/fulltest.cpp | 3 + .../zlasdtest/exercise2/simpletest.cpp | 359 ++++++++++++++ .../exercise4/zlasdtest/exercise2/test.hpp | 13 + .../zlasdtest/exercise3/fulltest.cpp | 3 + .../zlasdtest/exercise3/simpletest.cpp | 234 +++++++++ .../exercise4/zlasdtest/exercise3/test.hpp | 13 + .../zlasdtest/exercise4/fulltest.cpp | 3 + .../zlasdtest/exercise4/simpletest.cpp | 323 +++++++++++++ .../exercise4/zlasdtest/exercise4/test.hpp | 13 + .../exercise4/zlasdtest/iterator/iterator.hpp | 58 +++ librerie/exercise4/zlasdtest/list/list.hpp | 98 ++++ librerie/exercise4/zlasdtest/queue/queue.hpp | 116 +++++ librerie/exercise4/zlasdtest/stack/stack.hpp | 116 +++++ librerie/exercise4/zlasdtest/test.cpp | 29 ++ librerie/exercise4/zlasdtest/test.hpp | 11 + .../exercise4/zlasdtest/vector/vector.hpp | 37 ++ librerie/exercise4/zmytest/test.cpp | 2 + librerie/exercise4/zmytest/test.hpp | 11 + 53 files changed, 5003 insertions(+) create mode 100644 librerie/exercise4/Exercise4.pdf create mode 100644 librerie/exercise4/binarytree/binarytree.cpp create mode 100644 librerie/exercise4/binarytree/binarytree.hpp create mode 100644 librerie/exercise4/binarytree/lnk/binarytreelnk.cpp create mode 100644 librerie/exercise4/binarytree/lnk/binarytreelnk.hpp create mode 100644 librerie/exercise4/binarytree/vec/binarytreevec.cpp create mode 100644 librerie/exercise4/binarytree/vec/binarytreevec.hpp create mode 100644 librerie/exercise4/bst/bst.cpp create mode 100644 librerie/exercise4/bst/bst.hpp create mode 100644 librerie/exercise4/build.sh create mode 100644 librerie/exercise4/container/container.cpp create mode 100644 librerie/exercise4/container/container.hpp create mode 100644 librerie/exercise4/iterator/iterator.hpp create mode 100644 librerie/exercise4/list/list.cpp create mode 100644 librerie/exercise4/list/list.hpp create mode 100644 librerie/exercise4/main.cpp create mode 100644 librerie/exercise4/queue/lst/queuelst.cpp create mode 100644 librerie/exercise4/queue/lst/queuelst.hpp create mode 100644 librerie/exercise4/queue/queue.hpp create mode 100644 librerie/exercise4/queue/vec/queuevec.cpp create mode 100644 librerie/exercise4/queue/vec/queuevec.hpp create mode 100644 librerie/exercise4/stack/lst/stacklst.cpp create mode 100644 librerie/exercise4/stack/lst/stacklst.hpp create mode 100644 librerie/exercise4/stack/stack.hpp create mode 100644 librerie/exercise4/stack/vec/stackvec.cpp create mode 100644 librerie/exercise4/stack/vec/stackvec.hpp create mode 100644 librerie/exercise4/vector/vector.cpp create mode 100644 librerie/exercise4/vector/vector.hpp create mode 100644 librerie/exercise4/zlasdtest/binarytree/binarytree.hpp create mode 100644 librerie/exercise4/zlasdtest/bst/bst.hpp create mode 100644 librerie/exercise4/zlasdtest/container/container.cpp create mode 100644 librerie/exercise4/zlasdtest/container/container.hpp create mode 100644 librerie/exercise4/zlasdtest/exercise1/fulltest.cpp create mode 100644 librerie/exercise4/zlasdtest/exercise1/simpletest.cpp create mode 100644 librerie/exercise4/zlasdtest/exercise1/test.hpp create mode 100644 librerie/exercise4/zlasdtest/exercise2/fulltest.cpp create mode 100644 librerie/exercise4/zlasdtest/exercise2/simpletest.cpp create mode 100644 librerie/exercise4/zlasdtest/exercise2/test.hpp create mode 100644 librerie/exercise4/zlasdtest/exercise3/fulltest.cpp create mode 100644 librerie/exercise4/zlasdtest/exercise3/simpletest.cpp create mode 100644 librerie/exercise4/zlasdtest/exercise3/test.hpp create mode 100644 librerie/exercise4/zlasdtest/exercise4/fulltest.cpp create mode 100644 librerie/exercise4/zlasdtest/exercise4/simpletest.cpp create mode 100644 librerie/exercise4/zlasdtest/exercise4/test.hpp create mode 100644 librerie/exercise4/zlasdtest/iterator/iterator.hpp create mode 100644 librerie/exercise4/zlasdtest/list/list.hpp create mode 100644 librerie/exercise4/zlasdtest/queue/queue.hpp create mode 100644 librerie/exercise4/zlasdtest/stack/stack.hpp create mode 100644 librerie/exercise4/zlasdtest/test.cpp create mode 100644 librerie/exercise4/zlasdtest/test.hpp create mode 100644 librerie/exercise4/zlasdtest/vector/vector.hpp create mode 100644 librerie/exercise4/zmytest/test.cpp create mode 100644 librerie/exercise4/zmytest/test.hpp diff --git a/librerie/exercise4/Exercise4.pdf b/librerie/exercise4/Exercise4.pdf new file mode 100644 index 0000000000000000000000000000000000000000..d9e2b152d967295c34cd7939f247089382afa6ab GIT binary patch literal 39362 zcma%>L$EM_4qmVSYumPM+qP}nwr$(CZQHi(+t*ItOlR6fv-+~n;v^>|^1`At474ne zB=gH7>yRw?^!Rp$mXO@skaW@}wr0-e_>AoA%=rJSAn8Octes69@##dZ4V+DcO^ob} zO(1!BA)TBZO$=-x-8W}6q~f+ZQFhPN+|e-HrV%I<q6K8YYEj z4Kr$RTdVrS-26JeJ}-Xl-t<HXdt%pjrsyxd-CjxMAnj9znRj~JpH#T|)PDVtK$*;nG2@7%q{>|VH%d%@5ya&xwl z^cX8B`Q5qbrMbFmZJix8_*8VYwmMy|-k^=gb!@Yu#Q# zUWuS$1u}Ckf88zyc%(9dlAbY7opQCGcq}8(p!obd>1E|BCW#*Ct-UU;>?Vy-Z{$`P zKvh|T?F>PDAvsNCHWevNg@uOAB4kSyY&&K2^wo7jx#(>Isv1zz z%Yv|Yrio3e#kNgN#y3PY>Yop4)hFhAjwunCtO9!zQbQric|14BIf1V&b>LX4|LC|0 zk2%}5J(*!pp`Iw-p?1mgiAs7-CXm<1I3rMtZREvvzGJNsJHyys8zO2@Xw`D^HMve2 z{c`NPdkHA*Md!+S5;==gLZz~BTMY97mO;;)#K6lPTjh-raC!A%B>kq>6`Nz(pkIT;bA`t&*9q(xp5NV?36ec9(d7j0AF zICpdX7qOljs1U349{x$A$}q;)d(Ou}1@bml!^zm95K-1B!I32RF%k8f&ZJQ6JKEYS zO>3Gh=hQ>MZZI9QJ8oXSw`>X3v=A$*_?Wv0|Zab{1gr7)+$&;7=@BjPE+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f>i1Zx)aF|TikSsiJctrJJI`w~P aL_3-~IJ!DK5C`LfaKP{x7$lXY@c#$lpe=;} literal 0 HcmV?d00001 diff --git a/librerie/exercise4/binarytree/binarytree.cpp b/librerie/exercise4/binarytree/binarytree.cpp new file mode 100644 index 0000000..37c673b --- /dev/null +++ b/librerie/exercise4/binarytree/binarytree.cpp @@ -0,0 +1,12 @@ + +// #include "..." + +namespace lasd { + +/* ************************************************************************** */ + +// ... + +/* ************************************************************************** */ + +} diff --git a/librerie/exercise4/binarytree/binarytree.hpp b/librerie/exercise4/binarytree/binarytree.hpp new file mode 100644 index 0000000..f3333a5 --- /dev/null +++ b/librerie/exercise4/binarytree/binarytree.hpp @@ -0,0 +1,440 @@ + +#ifndef BINARYTREE_HPP +#define BINARYTREE_HPP + +/* ************************************************************************** */ + +#include "../container/container.hpp" + +#include "../iterator/iterator.hpp" + +// #include "..." + +/* ************************************************************************** */ + +namespace lasd { + +/* ************************************************************************** */ + +template +class BinaryTree { // Must extend InOrder/BreadthMappableContainer and InOrder/BreadthFoldableContainer + +private: + + // ... + +protected: + + // using InOrder/BreadthMappableContainer::???; + + // ... + +public: + + struct Node { + + private: + + // ... + + protected: + + // ... + + public: + + // friend class BinaryTree; + + /* ********************************************************************** */ + + // Destructor + // ~Node() specifiers + + /* ********************************************************************** */ + + // Copy assignment + // type operator=(argument); // Copy assignment of abstract types should not be possible. + + // Move assignment + // type operator=(argument); // Move assignment of abstract types should not be possible. + + /* ********************************************************************** */ + + // Comparison operators + // type operator==(argument) specifiers; // Comparison of abstract types is possible, but should not be visible. + // type operator!=(argument) specifiers; // Comparison of abstract types is possible, but should not be visible. + + /* ********************************************************************** */ + + // Specific member functions + + // type Element() specifiers; // Mutable access to the element (concrete function should not throw exceptions) + // type Element() specifiers; // Immutable access to the element (concrete function should not throw exceptions) + + // type IsLeaf() specifiers; // (concrete function should not throw exceptions) + // type HasLeftChild() specifiers; // (concrete function should not throw exceptions) + // type HasRightChild() specifiers; // (concrete function should not throw exceptions) + + // type LeftChild() specifiers; // (concrete function must throw std::out_of_range when not existent) + // type RightChild() specifiers; // (concrete function must throw std::out_of_range when not existent) + + }; + + /* ************************************************************************ */ + + // Destructor + // ~BinaryTree() specifiers + + /* ************************************************************************ */ + + // Copy assignment + // type operator=(argument); // Copy assignment of abstract types should not be possible. + + // Move assignment + // type operator=(argument); // Move assignment of abstract types should not be possible. + + /* ************************************************************************ */ + + // Comparison operators + // type operator==(argument) specifiers; // Comparison of abstract binary tree is possible. + // type operator!=(argument) specifiers; // Comparison of abstract binary tree is possible. + + /* ************************************************************************ */ + + // Specific member functions + + // type Root() specifiers; // (concrete function must throw std::length_error when empty) + + /* ************************************************************************ */ + + // Specific member functions (inherited from MappableContainer) + + // using typename MappableContainer::MapFunctor; + + // type MapPreOrder(arguments) specifiers; // Override MappableContainer member + // type MapPostOrder(arguments) specifiers; // Override MappableContainer member + + /* ************************************************************************ */ + + // Specific member functions (inherited from FoldableContainer) + + // using typename FoldableContainer::FoldFunctor; + + // type FoldPreOrder(arguments) specifiers; // Override FoldableContainer member + // type FoldPostOrder(arguments) specifiers; // Override FoldableContainer member + + /* ************************************************************************ */ + + // Specific member functions (inherited from InOrderMappableContainer) + + // type MapInOrder(arguments) specifiers; // Override InOrderMappableContainer member + + /* ************************************************************************ */ + + // Specific member functions (inherited from InOrderFoldableContainer) + + // type FoldInOrder(arguments) specifiers; // Override InOrderFoldableContainer member + + /* ************************************************************************ */ + + // Specific member functions (inherited from BreadthMappableContainer) + + // type MapBreadth(arguments) specifiers; // Override BreadthMappableContainer member + + /* ************************************************************************ */ + + // Specific member functions (inherited from BreadthFoldableContainer) + + // type FoldBreadth(arguments) specifiers; // Override BreadthFoldableContainer member + +protected: + + // Auxiliary member functions (for MappableContainer) + + // type MapPreOrder(arguments) specifiers; // Accessory function executing from one node of the tree + // type MapPostOrder(arguments) specifiers; // Accessory function executing from one node of the tree + + /* ************************************************************************ */ + + // Auxiliary member functions (for FoldableContainer) + + // type FoldPreOrder(arguments) specifiers; // Accessory function executing from one node of the tree + // type FoldPostOrder(arguments) specifiers; // Accessory function executing from one node of the tree + + /* ************************************************************************ */ + + // Auxiliary member functions (for InOrderMappableContainer) + + // type MapInOrder(arguments) specifiers; // Accessory function executing from one node of the tree + + /* ************************************************************************ */ + + // Auxiliary member functions (for InOrderFoldableContainer) + + // type FoldInOrder(arguments) specifiers; // Accessory function executing from one node of the tree + + /* ************************************************************************ */ + + // Auxiliary member functions (for BreadthMappableContainer) + + // type MapBreadth(arguments) specifiers; // Accessory function executing from one node of the tree + + /* ************************************************************************ */ + + // Auxiliary member functions (for BreadthFoldableContainer) + + // type FoldBreadth(arguments) specifiers; // Accessory function executing from one node of the tree + +}; + +/* ************************************************************************** */ + +template +class BTPreOrderIterator { // Must extend ForwardIterator + +private: + + // ... + +protected: + + // ... + +public: + + // Specific constructors + // BTPreOrderIterator(argument) specifiers; // An iterator over a given binary tree + + /* ************************************************************************ */ + + // Copy constructor + // BTPreOrderIterator(argument) specifiers; + + // Move constructor + // BTPreOrderIterator(argument) specifiers; + + /* ************************************************************************ */ + + // Destructor + // ~BTPreOrderIterator() specifiers; + + /* ************************************************************************ */ + + // Copy assignment + // type operator=(argument) specifiers; + + // Move assignment + // type operator=(argument) specifiers; + + /* ************************************************************************ */ + + // Comparison operators + // type operator==(argument) specifiers; + // type operator!=(argument) specifiers; + + /* ************************************************************************ */ + + // Specific member functions (inherited from Iterator) + + // type operator*() specifiers; // (throw std::out_of_range when terminated) + + // type Terminated() specifiers; // (should not throw exceptions) + + /* ************************************************************************ */ + + // Specific member functions (inherited from ForwardIterator) + + // type operator++() specifiers; // (throw std::out_of_range when terminated) + +}; + +/* ************************************************************************** */ + +template +class BTPostOrderIterator { // Must extend ForwardIterator + +private: + + // ... + +protected: + + // ... + +public: + + // Specific constructors + // BTPostOrderIterator(argument) specifiers; // An iterator over a given binary tree + + /* ************************************************************************ */ + + // Copy constructor + // BTPostOrderIterator(argument) specifiers; + + // Move constructor + // BTPostOrderIterator(argument) specifiers; + + /* ************************************************************************ */ + + // Destructor + // ~BTPostOrderIterator() specifiers; + + /* ************************************************************************ */ + + // Copy assignment + // type operator=(argument) specifiers; + + // Move assignment + // type operator=(argument) specifiers; + + /* ************************************************************************ */ + + // Comparison operators + // type operator==(argument) specifiers; + // type operator!=(argument) specifiers; + + /* ************************************************************************ */ + + // Specific member functions (inherited from Iterator) + + // type operator*() specifiers; // (throw std::out_of_range when terminated) + + // type Terminated() specifiers; // (should not throw exceptions) + + /* ************************************************************************ */ + + // Specific member functions (inherited from ForwardIterator) + + // type operator++() specifiers; // (throw std::out_of_range when terminated) + +}; + +/* ************************************************************************** */ + +template +class BTInOrderIterator { // Must extend ForwardIterator + +private: + + // ... + +protected: + + // ... + +public: + + // Specific constructors + // BTInOrderIterator(argument) specifiers; // An iterator over a given binary tree + + /* ************************************************************************ */ + + // Copy constructor + // BTInOrderIterator(argument) specifiers; + + // Move constructor + // BTInOrderIterator(argument) specifiers; + + /* ************************************************************************ */ + + // Destructor + // ~BTInOrderIterator() specifiers; + + /* ************************************************************************ */ + + // Copy assignment + // type operator=(argument) specifiers; + + // Move assignment + // type operator=(argument) specifiers; + + /* ************************************************************************ */ + + // Comparison operators + // type operator==(argument) specifiers; + // type operator!=(argument) specifiers; + + /* ************************************************************************ */ + + // Specific member functions (inherited from Iterator) + + // type operator*() specifiers; // (throw std::out_of_range when terminated) + + // type Terminated() specifiers; // (should not throw exceptions) + + /* ************************************************************************ */ + + // Specific member functions (inherited from ForwardIterator) + + // type operator++() specifiers; // (throw std::out_of_range when terminated) + +}; + +/* ************************************************************************** */ + +template +class BTBreadthIterator { // Must extend ForwardIterator + +private: + + // ... + +protected: + + // ... + +public: + + // Specific constructors + // BTBreadthIterator(argument) specifiers; // An iterator over a given binary tree + + /* ************************************************************************ */ + + // Copy constructor + // BTBreadthIterator(argument) specifiers; + + // Move constructor + // BTBreadthIterator(argument) specifiers; + + /* ************************************************************************ */ + + // Destructor + // ~BTBreadthIterator() specifiers; + + /* ************************************************************************ */ + + // Copy assignment + // type operator=(argument) specifiers; + + // Move assignment + // type operator=(argument) specifiers; + + /* ************************************************************************ */ + + // Comparison operators + // type operator==(argument) specifiers; + // type operator!=(argument) specifiers; + + /* ************************************************************************ */ + + // Specific member functions (inherited from Iterator) + + // type operator*() specifiers; // (throw std::out_of_range when terminated) + + // type Terminated() specifiers; // (should not throw exceptions) + + /* ************************************************************************ */ + + // Specific member functions (inherited from ForwardIterator) + + // type operator++() specifiers; // (throw std::out_of_range when terminated) + +}; + +/* ************************************************************************** */ + +} + +#include "binarytree.cpp" + +#endif diff --git a/librerie/exercise4/binarytree/lnk/binarytreelnk.cpp b/librerie/exercise4/binarytree/lnk/binarytreelnk.cpp new file mode 100644 index 0000000..d374ceb --- /dev/null +++ b/librerie/exercise4/binarytree/lnk/binarytreelnk.cpp @@ -0,0 +1,10 @@ + +namespace lasd { + +/* ************************************************************************** */ + +// ... + +/* ************************************************************************** */ + +} diff --git a/librerie/exercise4/binarytree/lnk/binarytreelnk.hpp b/librerie/exercise4/binarytree/lnk/binarytreelnk.hpp new file mode 100644 index 0000000..4d18351 --- /dev/null +++ b/librerie/exercise4/binarytree/lnk/binarytreelnk.hpp @@ -0,0 +1,101 @@ + +#ifndef BINARYTREELNK_HPP +#define BINARYTREELNK_HPP + +/* ************************************************************************** */ + +#include "../binarytree.hpp" + +/* ************************************************************************** */ + +namespace lasd { + +/* ************************************************************************** */ + +template +class BinaryTreeLnk { // Must extend BinaryTree + +private: + + // ... + +protected: + + // using BinaryTree::???; + + // ... + + struct NodeLnk { // Must extend Node + + private: + + // ... + + protected: + + // ... + + public: + + // ... + + }; + +public: + + // Default constructor + // BinaryTreeLnk() specifiers; + + /* ************************************************************************ */ + + // Specific constructors + // BinaryTreeLnk(argument) specifiers; // A binary tree obtained from a LinearContainer + + /* ************************************************************************ */ + + // Copy constructor + // BinaryTreeLnk(argument) specifiers; + + // Move constructor + // BinaryTreeLnk(argument) specifiers; + + /* ************************************************************************ */ + + // Destructor + // ~BinaryTreeLnk() specifiers; + + /* ************************************************************************ */ + + // Copy assignment + // type operator=(argument) specifiers; + + // Move assignment + // type operator=(argument) specifiers; + + /* ************************************************************************ */ + + // Comparison operators + // type operator==(argument) specifiers; + // type operator!=(argument) specifiers; + + /* ************************************************************************ */ + + // Specific member functions (inherited from BinaryTree) + + // type Root() specifiers; // Override BinaryTree member (throw std::length_error when empty) + + /* ************************************************************************ */ + + // Specific member functions (inherited from Container) + + // type Clear() specifiers; // Override Container member + +}; + +/* ************************************************************************** */ + +} + +#include "binarytreelnk.cpp" + +#endif diff --git a/librerie/exercise4/binarytree/vec/binarytreevec.cpp b/librerie/exercise4/binarytree/vec/binarytreevec.cpp new file mode 100644 index 0000000..d374ceb --- /dev/null +++ b/librerie/exercise4/binarytree/vec/binarytreevec.cpp @@ -0,0 +1,10 @@ + +namespace lasd { + +/* ************************************************************************** */ + +// ... + +/* ************************************************************************** */ + +} diff --git a/librerie/exercise4/binarytree/vec/binarytreevec.hpp b/librerie/exercise4/binarytree/vec/binarytreevec.hpp new file mode 100644 index 0000000..83fcfdf --- /dev/null +++ b/librerie/exercise4/binarytree/vec/binarytreevec.hpp @@ -0,0 +1,114 @@ + +#ifndef BINARYTREEVEC_HPP +#define BINARYTREEVEC_HPP + +/* ************************************************************************** */ + +#include "../binarytree.hpp" +#include "../../vector/vector.hpp" + +/* ************************************************************************** */ + +namespace lasd { + +/* ************************************************************************** */ + +template +class BinaryTreeVec { // Must extend BinaryTree + +private: + + // ... + +protected: + + // using BinaryTree::???; + + // ... + + struct NodeVec { // Must extend Node + + private: + + // ... + + protected: + + // ... + + public: + + // ... + + }; + +public: + + // Default constructor + // BinaryTreeVec() specifiers; + + /* ************************************************************************ */ + + // Specific constructors + // BinaryTreeVec(argument) specifiers; // A binary tree obtained from a LinearContainer + + /* ************************************************************************ */ + + // Copy constructor + // BinaryTreeVec(argument) specifiers; + + // Move constructor + // BinaryTreeVec(argument) specifiers; + + /* ************************************************************************ */ + + // Destructor + // ~BinaryTreeVec() specifiers; + + /* ************************************************************************ */ + + // Copy assignment + // type operator=(argument) specifiers; + + // Move assignment + // type operator=(argument) specifiers; + + /* ************************************************************************ */ + + // Comparison operators + // type operator==(argument) specifiers; + // type operator!=(argument) specifiers; + + /* ************************************************************************ */ + + // Specific member functions (inherited from BinaryTree) + + // type Root() specifiers; // Override BinaryTree member (throw std::length_error when empty) + + /* ************************************************************************ */ + + // Specific member functions (inherited from Container) + + // type Clear() specifiers; // Override Container member + + /* ************************************************************************ */ + + // Specific member functions (inherited from BreadthMappableContainer) + + // type MapBreadth(arguments) specifiers; // Override BreadthMappableContainer member + + /* ************************************************************************ */ + + // Specific member functions (inherited from BreadthFoldableContainer) + + // type FoldBreadth(arguments) specifiers; // Override BreadthFoldableContainer member + +}; + +/* ************************************************************************** */ + +} + +#include "binarytreevec.cpp" + +#endif diff --git a/librerie/exercise4/bst/bst.cpp b/librerie/exercise4/bst/bst.cpp new file mode 100644 index 0000000..d374ceb --- /dev/null +++ b/librerie/exercise4/bst/bst.cpp @@ -0,0 +1,10 @@ + +namespace lasd { + +/* ************************************************************************** */ + +// ... + +/* ************************************************************************** */ + +} diff --git a/librerie/exercise4/bst/bst.hpp b/librerie/exercise4/bst/bst.hpp new file mode 100644 index 0000000..26c3094 --- /dev/null +++ b/librerie/exercise4/bst/bst.hpp @@ -0,0 +1,125 @@ + +#ifndef BST_HPP +#define BST_HPP + +/* ************************************************************************** */ + +#include "../binarytree/lnk/binarytreelnk.hpp" + +/* ************************************************************************** */ + +namespace lasd { + +/* ************************************************************************** */ + +template +class BST { // Must extend BinaryTreeLnk + +private: + + // ... + +protected: + + // using BinaryTreeLnk::???; + + // ... + +public: + + // Default constructor + // BST() specifiers; + + /* ************************************************************************ */ + + // Specific constructors + // BST(argument) specifiers; // A bst obtained from a LinearContainer + + /* ************************************************************************ */ + + // Copy constructor + // BST(argument) specifiers; + + // Move constructor + // BST(argument) specifiers; + + /* ************************************************************************ */ + + // Destructor + // ~BST() specifiers; + + /* ************************************************************************ */ + + // Copy assignment + // type operator=(argument) specifiers; + + // Move assignment + // type operator=(argument) specifiers; + + /* ************************************************************************ */ + + // Comparison operators + // type operator==(argument) specifiers; + // type operator!=(argument) specifiers; + + /* ************************************************************************ */ + + // Specific member functions + + // type Insert(argument) specifiers; // Copy of the value + // type Insert(argument) specifiers; // Move of the value + // type Remove(argument) specifiers; + + // type Min(argument) specifiers; // (concrete function must throw std::length_error when empty) + // type MinNRemove(argument) specifiers; // (concrete function must throw std::length_error when empty) + // type RemoveMin(argument) specifiers; // (concrete function must throw std::length_error when empty) + + // type Max(argument) specifiers; // (concrete function must throw std::length_error when empty) + // type MaxNRemove(argument) specifiers; // (concrete function must throw std::length_error when empty) + // type RemoveMax(argument) specifiers; // (concrete function must throw std::length_error when empty) + + // type Predecessor(argument) specifiers; // (concrete function must throw std::length_error when empty) + // type PredecessorNRemove(argument) specifiers; // (concrete function must throw std::length_error when empty) + // type RemovePredecessor(argument) specifiers; // (concrete function must throw std::length_error when empty) + + // type Successor(argument) specifiers; // (concrete function must throw std::length_error when empty) + // type SuccessorNRemove(argument) specifiers; // (concrete function must throw std::length_error when empty) + // type RemoveSuccessor(argument) specifiers; // (concrete function must throw std::length_error when empty) + + /* ************************************************************************ */ + + // Specific member functions (inherited from TestableContainer) + + // type Exists(argument) specifiers; // Override TestableContainer member + +protected: + + // Auxiliary member functions + + // type DataNDelete(argument) specifiers; + + // type Detach(argument) specifiers; + + // type DetachMin(argument) specifiers; + // type DetachMax(argument) specifiers; + + // type SkipOnLeft(argument) specifiers; + // type SkipOnRight(argument) specifiers; + + // type FindPointerToMin(argument) specifiers; + // type FindPointerToMax(argument) specifiers; + + // type FindPointerTo(argument) specifiers; + + // type FindPointerToPredecessor(argument) specifiers; + // type FindPointerToSuccessor(argument) specifiers; + +}; + +/* ************************************************************************** */ + +} + +#include "bst.cpp" + +#endif diff --git a/librerie/exercise4/build.sh b/librerie/exercise4/build.sh new file mode 100644 index 0000000..cf5567b --- /dev/null +++ b/librerie/exercise4/build.sh @@ -0,0 +1,10 @@ + +#! /bin/bash + +g++ -O3 -o main \ + zlasdtest/exercise1/simpletest.cpp zlasdtest/exercise1/fulltest.cpp \ + zlasdtest/exercise2/simpletest.cpp zlasdtest/exercise2/fulltest.cpp \ + zlasdtest/exercise3/simpletest.cpp zlasdtest/exercise3/fulltest.cpp \ + zlasdtest/exercise4/simpletest.cpp zlasdtest/exercise4/fulltest.cpp \ + zlasdtest/container/container.cpp \ + zlasdtest/test.cpp zmytest/test.cpp main.cpp diff --git a/librerie/exercise4/container/container.cpp b/librerie/exercise4/container/container.cpp new file mode 100644 index 0000000..d374ceb --- /dev/null +++ b/librerie/exercise4/container/container.cpp @@ -0,0 +1,10 @@ + +namespace lasd { + +/* ************************************************************************** */ + +// ... + +/* ************************************************************************** */ + +} diff --git a/librerie/exercise4/container/container.hpp b/librerie/exercise4/container/container.hpp new file mode 100644 index 0000000..f9d5881 --- /dev/null +++ b/librerie/exercise4/container/container.hpp @@ -0,0 +1,402 @@ + +#ifndef CONTAINER_HPP +#define CONTAINER_HPP + +/* ************************************************************************** */ + +#include +#include + +/* ************************************************************************** */ + +namespace lasd { + +/* ************************************************************************** */ + +class Container { + +private: + + // ... + +protected: + + // ... + +public: + + // Destructor + // ~Container() specifiers + + /* ************************************************************************ */ + + // Copy assignment + // type operator=(argument); // Copy assignment of abstract types should not be possible. + + // Move assignment + // type operator=(argument); // Move assignment of abstract types should not be possible. + + /* ************************************************************************ */ + + // Comparison operators + // type operator==(argument) specifiers; // Comparison of abstract types might not be possible. + // type operator!=(argument) specifiers; // Comparison of abstract types might not be possible. + + /* ************************************************************************ */ + + // Specific member functions + + // type Empty() specifiers; // (concrete function should not throw exceptions) + + // type Size() specifiers; // (concrete function should not throw exceptions) + + // type Clear() specifiers; + +}; + +/* ************************************************************************** */ + +template +class LinearContainer { // Must extend Container + +private: + + // ... + +protected: + + // ... + +public: + + // Destructor + // ~LinearContainer() specifiers + + /* ************************************************************************ */ + + // Copy assignment + // type operator=(argument); // Copy assignment of abstract types should not be possible. + + // Move assignment + // type operator=(argument); // Move assignment of abstract types should not be possible. + + /* ************************************************************************ */ + + // Comparison operators + // type operator==(argument) specifiers; // Comparison of abstract types is possible. + // type operator!=(argument) specifiers; // Comparison of abstract types is possible. + + /* ************************************************************************ */ + + // Specific member functions + + // type Front() specifiers; // (concrete function must throw std::length_error when empty) + // type Back() specifiers; // (concrete function must throw std::length_error when empty) + + // type operator[](argument) specifiers; // (concrete function must throw std::out_of_range when out of range) + +}; + +/* ************************************************************************** */ + +template +class TestableContainer { // Must extend Container + +private: + + // ... + +protected: + + // ... + +public: + + // Destructor + // ~TestableContainer() specifiers + + /* ************************************************************************ */ + + // Copy assignment + // type operator=(argument); // Copy assignment of abstract types should not be possible. + + // Move assignment + // type operator=(argument); // Move assignment of abstract types should not be possible. + + /* ************************************************************************ */ + + // Comparison operators + // type operator==(argument) specifiers; // Comparison of abstract types might not be possible. + // type operator!=(argument) specifiers; // Comparison of abstract types might not be possible. + + /* ************************************************************************ */ + + // Specific member functions + + // type Exists(argument) specifiers; // (concrete function should not throw exceptions) + +}; + +/* ************************************************************************** */ + +template +class MappableContainer { // Must extend Container + +private: + + // ... + +protected: + + // ... + +public: + + // Destructor + // ~MappableContainer() specifiers + + /* ************************************************************************ */ + + // Copy assignment + // type operator=(argument); // Copy assignment of abstract types should not be possible. + + // Move assignment + // type operator=(argument); // Move assignment of abstract types should not be possible. + + /* ************************************************************************ */ + + // Comparison operators + // type operator==(argument) specifiers; // Comparison of abstract types might not be possible. + // type operator!=(argument) specifiers; // Comparison of abstract types might not be possible. + + /* ************************************************************************ */ + + // Specific member functions + + // typedef std::function MapFunctor; + + // type MapPreOrder(arguments) specifiers; + // type MapPostOrder(arguments) specifiers; + +}; + +/* ************************************************************************** */ + +template +class FoldableContainer { // Must extend TestableContainer + +private: + + // ... + +protected: + + // ... + +public: + + // Destructor + // ~FoldableContainer() specifiers + + /* ************************************************************************ */ + + // Copy assignment + // type operator=(argument); // Copy assignment of abstract types should not be possible. + + // Move assignment + // type operator=(argument); // Move assignment of abstract types should not be possible. + + /* ************************************************************************ */ + + // Comparison operators + // type operator==(argument) specifiers; // Comparison of abstract types might not be possible. + // type operator!=(argument) specifiers; // Comparison of abstract types might not be possible. + + /* ************************************************************************ */ + + // Specific member functions + + // typedef std::function FoldFunctor; + + // type FoldPreOrder(arguments) specifiers; + // type FoldPostOrder(arguments) specifiers; + + // type Exists(argument) specifiers; // Override TestableContainer member + +}; + +/* ************************************************************************** */ + +template +class InOrderMappableContainer { // Must extend MappableContainer + +private: + + // ... + +protected: + + // ... + +public: + + // Destructor + // ~InOrderMappableContainer() specifiers + + /* ************************************************************************ */ + + // Copy assignment + // type operator=(argument); // Copy assignment of abstract types should not be possible. + + // Move assignment + // type operator=(argument); // Move assignment of abstract types should not be possible. + + /* ************************************************************************ */ + + // Comparison operators + // type operator==(argument) specifiers; // Comparison of abstract types might not be possible. + // type operator!=(argument) specifiers; // Comparison of abstract types might not be possible. + + /* ************************************************************************ */ + + // Specific member functions + + // using typename MappableContainer::MapFunctor; + + // type MapInOrder(arguments) specifiers; + +}; + +/* ************************************************************************** */ + +template +class InOrderFoldableContainer { // Must extend FoldableContainer + +private: + + // ... + +protected: + + // ... + +public: + + // Destructor + // ~InOrderFoldableContainer() specifiers + + /* ************************************************************************ */ + + // Copy assignment + // type operator=(argument); // Copy assignment of abstract types should not be possible. + + // Move assignment + // type operator=(argument); // Move assignment of abstract types should not be possible. + + /* ************************************************************************ */ + + // Comparison operators + // type operator==(argument) specifiers; // Comparison of abstract types might not be possible. + // type operator!=(argument) specifiers; // Comparison of abstract types might not be possible. + + /* ************************************************************************ */ + + // Specific member functions + + // using typename MappableContainer::MapFunctor; + + // type FoldInOrder(arguments) specifiers; + +}; + +/* ************************************************************************** */ + +template +class BreadthMappableContainer { // Must extend MappableContainer + +private: + + // ... + +protected: + + // ... + +public: + + // Destructor + // ~BreadthMappableContainer() specifiers + + /* ************************************************************************ */ + + // Copy assignment + // type operator=(argument); // Copy assignment of abstract types should not be possible. + + // Move assignment + // type operator=(argument); // Move assignment of abstract types should not be possible. + + /* ************************************************************************ */ + + // Comparison operators + // type operator==(argument) specifiers; // Comparison of abstract types might not be possible. + // type operator!=(argument) specifiers; // Comparison of abstract types might not be possible. + + /* ************************************************************************ */ + + // Specific member functions + + // using typename MappableContainer::MapFunctor; + + // type MapBreadth(arguments) specifiers; + +}; + +/* ************************************************************************** */ + +template +class BreadthFoldableContainer { // Must extend FoldableContainer + +private: + + // ... + +protected: + + // ... + +public: + + // Destructor + // ~BreadthFoldableContainer() specifiers + + /* ************************************************************************ */ + + // Copy assignment + // type operator=(argument); // Copy assignment of abstract types should not be possible. + + // Move assignment + // type operator=(argument); // Move assignment of abstract types should not be possible. + + /* ************************************************************************ */ + + // Comparison operators + // type operator==(argument) specifiers; // Comparison of abstract types might not be possible. + // type operator!=(argument) specifiers; // Comparison of abstract types might not be possible. + + /* ************************************************************************ */ + + // Specific member functions + + // using typename FoldableContainer::FoldFunctor; + + // type FoldBreadth(arguments) specifiers; + +}; + +/* ************************************************************************** */ + +} + +#include "container.cpp" + +#endif diff --git a/librerie/exercise4/iterator/iterator.hpp b/librerie/exercise4/iterator/iterator.hpp new file mode 100644 index 0000000..249bf5b --- /dev/null +++ b/librerie/exercise4/iterator/iterator.hpp @@ -0,0 +1,179 @@ + +#ifndef ITERATOR_HPP +#define ITERATOR_HPP + +/* ************************************************************************** */ + +namespace lasd { + +/* ************************************************************************** */ + +template +class Iterator { + +private: + + // ... + +protected: + + // ... + +public: + + // Destructor + // ~Iterator() specifiers + + /* ************************************************************************ */ + + // Copy assignment + // type operator=(argument); // Copy assignment of abstract types should not be possible. + + // Move assignment + // type operator=(argument); // Move assignment of abstract types should not be possible. + + /* ************************************************************************ */ + + // Comparison operators + // type operator==(argument) specifiers; // Comparison of abstract types might not be possible. + // type operator!=(argument) specifiers; // Comparison of abstract types might not be possible. + + /* ************************************************************************ */ + + // Specific member functions + + // type operator*() specifiers; // (concrete function must throw std::out_of_range when terminated) + + // type Terminated() specifiers; // (concrete function should not throw exceptions) + +}; + +/* ************************************************************************** */ + +template +class ForwardIterator { // Must extend Iterator + +private: + + // ... + +protected: + + // ... + +public: + + // Destructor + // ~ForwardIterator() specifiers + + /* ************************************************************************ */ + + // Copy assignment + // type operator=(argument); // Copy assignment of abstract types should not be possible. + + // Move assignment + // type operator=(argument); // Move assignment of abstract types should not be possible. + + /* ************************************************************************ */ + + // Comparison operators + // type operator==(argument) specifiers; // Comparison of abstract types might not be possible. + // type operator!=(argument) specifiers; // Comparison of abstract types might not be possible. + + /* ************************************************************************ */ + + // Specific member functions + + // type operator++() specifiers; // (concrete function must throw std::out_of_range when terminated) + +}; + +/* ************************************************************************** */ + +template +class BackwardIterator { // Must extend Iterator + +private: + + // ... + +protected: + + // ... + +public: + + // Destructor + // ~BackwardIterator() specifiers + + /* ************************************************************************ */ + + // Copy assignment + // type operator=(argument); // Copy assignment of abstract types should not be possible. + + // Move assignment + // type operator=(argument); // Move assignment of abstract types should not be possible. + + /* ************************************************************************ */ + + // Comparison operators + // type operator==(argument) specifiers; // Comparison of abstract types might not be possible. + // type operator!=(argument) specifiers; // Comparison of abstract types might not be possible. + + /* ************************************************************************ */ + + // Specific member functions + + // type operator--() specifiers; // (concrete function must throw std::out_of_range when terminated) + +}; + +/* ************************************************************************** */ + +template +class BidirectionalIterator { // Must extend ForwardIterator and BackwardIterator + +private: + + // ... + +protected: + + // ... + +public: + + // Destructor + // ~BidirectionalIterator() specifiers + + /* ************************************************************************ */ + + // Copy assignment + // type operator=(argument); // Copy assignment of abstract types should not be possible. + + // Move assignment + // type operator=(argument); // Move assignment of abstract types should not be possible. + + /* ************************************************************************ */ + + // Comparison operators + // type operator==(argument) specifiers; // Comparison of abstract types might not be possible. + // type operator!=(argument) specifiers; // Comparison of abstract types might not be possible. + + /* ************************************************************************ */ + + // Specific member functions + + // type Terminated() specifiers; // Override Iterator member + + // type ForwardTerminated() specifiers; // (concrete function should not throw exceptions) + + // type BackwardTerminated() specifiers; // (concrete function should not throw exceptions) + +}; + +/* ************************************************************************** */ + +} + +#endif diff --git a/librerie/exercise4/list/list.cpp b/librerie/exercise4/list/list.cpp new file mode 100644 index 0000000..d374ceb --- /dev/null +++ b/librerie/exercise4/list/list.cpp @@ -0,0 +1,10 @@ + +namespace lasd { + +/* ************************************************************************** */ + +// ... + +/* ************************************************************************** */ + +} diff --git a/librerie/exercise4/list/list.hpp b/librerie/exercise4/list/list.hpp new file mode 100644 index 0000000..c80e4df --- /dev/null +++ b/librerie/exercise4/list/list.hpp @@ -0,0 +1,169 @@ + +#ifndef LIST_HPP +#define LIST_HPP + +/* ************************************************************************** */ + +#include "../container/container.hpp" + +/* ************************************************************************** */ + +namespace lasd { + +/* ************************************************************************** */ + +template +class List { // Must extend LinearContainer, MappableContainer, and FoldableContainer + +private: + + // ... + +protected: + + // using LinearContainer::???; + + struct Node + { + + // Data + // ... + + /* ********************************************************************** */ + + // Specific constructors + // ... + + /* ********************************************************************** */ + + // Copy constructor + // ... + + // Move constructor + // ... + + /* ********************************************************************** */ + + // Destructor + // ... + + /* ********************************************************************** */ + + // Comparison operators + // ... + + /* ********************************************************************** */ + + // Specific member functions + + // ... + + }; + + // ... + +public: + + // Default constructor + // List() specifiers; + + /* ************************************************************************ */ + + // Specific constructor + // List(argument) specifiers; // A list obtained from a LinearContainer + + /* ************************************************************************ */ + + // Copy constructor + // List(argument) specifiers; + + // Move constructor + // List(argument) specifiers; + + /* ************************************************************************ */ + + // Destructor + // ~List() specifiers; + + /* ************************************************************************ */ + + // Copy assignment + // type operator=(argument) specifiers; + + // Move assignment + // type operator=(argument) specifiers; + + /* ************************************************************************ */ + + // Comparison operators + // type operator==(argument) specifiers; + // type operator!=(argument) specifiers; + + /* ************************************************************************ */ + + // Specific member functions + + // type InsertAtFront(argument) specifier; // Copy of the value + // type InsertAtFront(argument) specifier; // Move of the value + // type RemoveFromFront() specifier; // (must throw std::length_error when empty) + // type FrontNRemove() specifier; // (must throw std::length_error when empty) + + // type InsertAtBack(argument) specifier; // Copy of the value + // type InsertAtBack(argument) specifier; // Move of the value + + /* ************************************************************************ */ + + // Specific member functions (inherited from Container) + + // type Clear() specifiers; // Override Container member + + /* ************************************************************************ */ + + // Specific member functions (inherited from LinearContainer) + + // type Front() specifiers; // Override LinearContainer member (must throw std::length_error when empty) + // type Back() specifiers; // Override LinearContainer member (must throw std::length_error when empty) + + // type operator[](argument) specifiers; // Override LinearContainer member (must throw std::out_of_range when out of range) + + /* ************************************************************************ */ + + // Specific member functions (inherited from MappableContainer) + + // using typename MappableContainer::MapFunctor; + + // type MapPreOrder(arguments) specifiers; // Override MappableContainer member + // type MapPostOrder(arguments) specifiers; // Override MappableContainer member + + /* ************************************************************************ */ + + // Specific member functions (inherited from FoldableContainer) + + // using typename FoldableContainer::FoldFunctor; + + // type FoldPreOrder(arguments) specifiers; // Override FoldableContainer member + // type FoldPostOrder(arguments) specifiers; // Override FoldableContainer member + +protected: + + // Auxiliary member functions (for MappableContainer) + + // type MapPreOrder(arguments) specifiers; // Accessory function executing from one point of the list onwards + // type MapPostOrder(arguments) specifiers; // Accessory function executing from one point of the list onwards + + /* ************************************************************************ */ + + // Auxiliary member functions (for FoldableContainer) + + // type FoldPreOrder(arguments) specifiers; // Accessory function executing from one point of the list onwards + // type FoldPostOrder(arguments) specifiers; // Accessory function executing from one point of the list onwards + +}; + +/* ************************************************************************** */ + +} + +#include "list.cpp" + +#endif diff --git a/librerie/exercise4/main.cpp b/librerie/exercise4/main.cpp new file mode 100644 index 0000000..34faa12 --- /dev/null +++ b/librerie/exercise4/main.cpp @@ -0,0 +1,16 @@ + +#include "zlasdtest/test.hpp" + +#include "zmytest/test.hpp" + +/* ************************************************************************** */ + +#include + +/* ************************************************************************** */ + +int main() { + std::cout << "Lasd Libraries 2020" << std::endl; + lasdtest(); // To call in the menu of your library test! + return 0; +} diff --git a/librerie/exercise4/queue/lst/queuelst.cpp b/librerie/exercise4/queue/lst/queuelst.cpp new file mode 100644 index 0000000..d374ceb --- /dev/null +++ b/librerie/exercise4/queue/lst/queuelst.cpp @@ -0,0 +1,10 @@ + +namespace lasd { + +/* ************************************************************************** */ + +// ... + +/* ************************************************************************** */ + +} diff --git a/librerie/exercise4/queue/lst/queuelst.hpp b/librerie/exercise4/queue/lst/queuelst.hpp new file mode 100644 index 0000000..4f1954c --- /dev/null +++ b/librerie/exercise4/queue/lst/queuelst.hpp @@ -0,0 +1,90 @@ + +#ifndef QUEUELST_HPP +#define QUEUELST_HPP + +/* ************************************************************************** */ + +#include "../queue.hpp" +#include "../../list/list.hpp" + +/* ************************************************************************** */ + +namespace lasd { + +/* ************************************************************************** */ + +template +class QueueLst { // Must extend Queue and List + +private: + + // ... + +protected: + + // using List::???; + + // ... + +public: + + // Default constructor + // QueueLst() specifier; + + /* ************************************************************************ */ + + // Specific constructor + // QueueLst(argument) specifiers; // A queue obtained from a LinearContainer + + /* ************************************************************************ */ + + // Copy constructor + // QueueLst(argument); + + // Move constructor + // QueueLst(argument); + + /* ************************************************************************ */ + + // Destructor + // ~QueueLst() specifier; + + /* ************************************************************************ */ + + // Copy assignment + // type operator=(argument); + + // Move assignment + // type operator=(argument); + + /* ************************************************************************ */ + + // Comparison operators + // type operator==(argument) specifiers; + // type operator!=(argument) specifiers; + + /* ************************************************************************ */ + + // Specific member functions (inherited from Queue) + + // type Enqueue(argument) specifiers; // Override Queue member (copy of the value) + // type Enqueue(argument) specifiers; // Override Queue member (move of the value) + // type Head() specifiers; // Override Queue member (must throw std::length_error when empty) + // type Dequeue() specifiers; // Override Queue member (must throw std::length_error when empty) + // type HeadNDequeue() specifiers; // Override Queue member (must throw std::length_error when empty) + + /* ************************************************************************ */ + + // Specific member functions (inherited from Container) + + // type Clear() specifiers; // Override Container member + +}; + +/* ************************************************************************** */ + +} + +#include "queuelst.cpp" + +#endif diff --git a/librerie/exercise4/queue/queue.hpp b/librerie/exercise4/queue/queue.hpp new file mode 100644 index 0000000..6b612e4 --- /dev/null +++ b/librerie/exercise4/queue/queue.hpp @@ -0,0 +1,61 @@ + +#ifndef QUEUE_HPP +#define QUEUE_HPP + +/* ************************************************************************** */ + +#include "../container/container.hpp" + +/* ************************************************************************** */ + +namespace lasd { + +/* ************************************************************************** */ + +template +class Queue { // Must extend Container + +private: + + // ... + +protected: + + // ... + +public: + + // Destructor + // ~Queue() specifiers + + /* ************************************************************************ */ + + // Copy assignment + // type operator=(argument); // Copy assignment of abstract types should not be possible. + + // Move assignment + // type operator=(argument); // Move assignment of abstract types should not be possible. + + /* ************************************************************************ */ + + // Comparison operators + // type operator==(argument) specifiers; // Comparison of abstract types might not be possible. + // type operator!=(argument) specifiers; // Comparison of abstract types might not be possible. + + /* ************************************************************************ */ + + // Specific member functions + + // type Enqueue(argument) specifiers; // Copy of the value + // type Enqueue(argument) specifiers; // Move of the value + // type Head() specifiers; // (concrete function must throw std::length_error when empty) + // type Dequeue() specifiers; // (concrete function must throw std::length_error when empty) + // type HeadNDequeue() specifiers; // (concrete function must throw std::length_error when empty) + +}; + +/* ************************************************************************** */ + +} + +#endif diff --git a/librerie/exercise4/queue/vec/queuevec.cpp b/librerie/exercise4/queue/vec/queuevec.cpp new file mode 100644 index 0000000..d374ceb --- /dev/null +++ b/librerie/exercise4/queue/vec/queuevec.cpp @@ -0,0 +1,10 @@ + +namespace lasd { + +/* ************************************************************************** */ + +// ... + +/* ************************************************************************** */ + +} diff --git a/librerie/exercise4/queue/vec/queuevec.hpp b/librerie/exercise4/queue/vec/queuevec.hpp new file mode 100644 index 0000000..97b7e97 --- /dev/null +++ b/librerie/exercise4/queue/vec/queuevec.hpp @@ -0,0 +1,102 @@ + +#ifndef QUEUEVEC_HPP +#define QUEUEVEC_HPP + +/* ************************************************************************** */ + +#include "../queue.hpp" +#include "../../vector/vector.hpp" + +/* ************************************************************************** */ + +namespace lasd { + +/* ************************************************************************** */ + +template +class QueueVec { // Must extend Queue and Vector + +private: + + // ... + +protected: + + // using Vector::???; + + // ... + +public: + + // Default constructor + // QueueVec() specifier; + + /* ************************************************************************ */ + + // Specific constructor + // QueueVec(argument) specifiers; // A queue obtained from a LinearContainer + + /* ************************************************************************ */ + + // Copy constructor + // QueueVec(argument); + + // Move constructor + // QueueVec(argument); + + /* ************************************************************************ */ + + // Destructor + // ~QueueVec() specifier; + + /* ************************************************************************ */ + + // Copy assignment + // type operator=(argument); + + // Move assignment + // type operator=(argument); + + /* ************************************************************************ */ + + // Comparison operators + // type operator==(argument) specifiers; + // type operator!=(argument) specifiers; + + /* ************************************************************************ */ + + // Specific member functions (inherited from Queue) + + // type Enqueue(argument) specifiers; // Override Queue member (copy of the value) + // type Enqueue(argument) specifiers; // Override Queue member (move of the value) + // type Head() specifiers; // Override Queue member (must throw std::length_error when empty) + // type Dequeue() specifiers; // Override Queue member (must throw std::length_error when empty) + // type HeadNDequeue() specifiers; // Override Queue member (must throw std::length_error when empty) + + /* ************************************************************************ */ + + // Specific member functions (inherited from Container) + + // type Empty() specifiers; // Override Container member + + // type Size() specifiers; // Override Container member + + // type Clear() specifiers; // Override Container member + +protected: + + // Auxiliary member functions + + // type Expand() specifiers; + // type Reduce() specifiers; + // type SwapVectors(arguments) specifiers; + +}; + +/* ************************************************************************** */ + +} + +#include "queuevec.cpp" + +#endif diff --git a/librerie/exercise4/stack/lst/stacklst.cpp b/librerie/exercise4/stack/lst/stacklst.cpp new file mode 100644 index 0000000..d374ceb --- /dev/null +++ b/librerie/exercise4/stack/lst/stacklst.cpp @@ -0,0 +1,10 @@ + +namespace lasd { + +/* ************************************************************************** */ + +// ... + +/* ************************************************************************** */ + +} diff --git a/librerie/exercise4/stack/lst/stacklst.hpp b/librerie/exercise4/stack/lst/stacklst.hpp new file mode 100644 index 0000000..67fbb32 --- /dev/null +++ b/librerie/exercise4/stack/lst/stacklst.hpp @@ -0,0 +1,90 @@ + +#ifndef STACKLST_HPP +#define STACKLST_HPP + +/* ************************************************************************** */ + +#include "../stack.hpp" +#include "../../list/list.hpp" + +/* ************************************************************************** */ + +namespace lasd { + +/* ************************************************************************** */ + +template +class StackLst { // Must extend Stack and List + +private: + + // ... + +protected: + + // using List::???; + + // ... + +public: + + // Default constructor + // StackLst() specifier; + + /* ************************************************************************ */ + + // Specific constructor + // StackLst(argument) specifiers; // A stack obtained from a LinearContainer + + /* ************************************************************************ */ + + // Copy constructor + // StackLst(argument); + + // Move constructor + // StackLst(argument); + + /* ************************************************************************ */ + + // Destructor + // ~StackLst() specifier; + + /* ************************************************************************ */ + + // Copy assignment + // type operator=(argument); + + // Move assignment + // type operator=(argument); + + /* ************************************************************************ */ + + // Comparison operators + // type operator==(argument) specifiers; + // type operator!=(argument) specifiers; + + /* ************************************************************************ */ + + // Specific member functions (inherited from Stack) + + // type Push(argument) specifiers; // Override Stack member (copy of the value) + // type Push(argument) specifiers; // Override Stack member (move of the value) + // type Top() specifiers; // Override Stack member (must throw std::length_error when empty) + // type Pop() specifiers; // Override Stack member (must throw std::length_error when empty) + // type TopNPop() specifiers; // Override Stack member (must throw std::length_error when empty) + + /* ************************************************************************ */ + + // Specific member functions (inherited from Container) + + // type Clear() specifiers; // Override Container member + +}; + +/* ************************************************************************** */ + +} + +#include "stacklst.cpp" + +#endif diff --git a/librerie/exercise4/stack/stack.hpp b/librerie/exercise4/stack/stack.hpp new file mode 100644 index 0000000..73a3a7c --- /dev/null +++ b/librerie/exercise4/stack/stack.hpp @@ -0,0 +1,61 @@ + +#ifndef STACK_HPP +#define STACK_HPP + +/* ************************************************************************** */ + +#include "../container/container.hpp" + +/* ************************************************************************** */ + +namespace lasd { + +/* ************************************************************************** */ + +template +class Stack { // Must extend Container + +private: + + // ... + +protected: + + // ... + +public: + + // Destructor + // ~Stack() specifiers + + /* ************************************************************************ */ + + // Copy assignment + // type operator=(argument); // Copy assignment of abstract types should not be possible. + + // Move assignment + // type operator=(argument); // Move assignment of abstract types should not be possible. + + /* ************************************************************************ */ + + // Comparison operators + // type operator==(argument) specifiers; // Comparison of abstract types might not be possible. + // type operator!=(argument) specifiers; // Comparison of abstract types might not be possible. + + /* ************************************************************************ */ + + // Specific member functions + + // type Push(argument) specifiers; // Copy of the value + // type Push(argument) specifiers; // Move of the value + // type Top() specifiers; // (concrete function must throw std::length_error when empty) + // type Pop() specifiers; // (concrete function must throw std::length_error when empty) + // type TopNPop() specifiers; // (concrete function must throw std::length_error when empty) + +}; + +/* ************************************************************************** */ + +} + +#endif diff --git a/librerie/exercise4/stack/vec/stackvec.cpp b/librerie/exercise4/stack/vec/stackvec.cpp new file mode 100644 index 0000000..d374ceb --- /dev/null +++ b/librerie/exercise4/stack/vec/stackvec.cpp @@ -0,0 +1,10 @@ + +namespace lasd { + +/* ************************************************************************** */ + +// ... + +/* ************************************************************************** */ + +} diff --git a/librerie/exercise4/stack/vec/stackvec.hpp b/librerie/exercise4/stack/vec/stackvec.hpp new file mode 100644 index 0000000..5e65367 --- /dev/null +++ b/librerie/exercise4/stack/vec/stackvec.hpp @@ -0,0 +1,101 @@ + +#ifndef STACKVEC_HPP +#define STACKVEC_HPP + +/* ************************************************************************** */ + +#include "../stack.hpp" +#include "../../vector/vector.hpp" + +/* ************************************************************************** */ + +namespace lasd { + +/* ************************************************************************** */ + +template +class StackVec { // Must extend Stack and Vector + +private: + + // ... + +protected: + + // using Vector::???; + + // ... + +public: + + // Default constructor + // StackVec() specifier; + + /* ************************************************************************ */ + + // Specific constructor + // StackVec(argument) specifiers; // A stack obtained from a LinearContainer + + /* ************************************************************************ */ + + // Copy constructor + // StackVec(argument); + + // Move constructor + // StackVec(argument); + + /* ************************************************************************ */ + + // Destructor + // ~StackVec() specifier; + + /* ************************************************************************ */ + + // Copy assignment + // type operator=(argument); + + // Move assignment + // type operator=(argument); + + /* ************************************************************************ */ + + // Comparison operators + // type operator==(argument) specifiers; + // type operator!=(argument) specifiers; + + /* ************************************************************************ */ + + // Specific member functions (inherited from Stack) + + // type Push(argument) specifiers; // Override Stack member (copy of the value) + // type Push(argument) specifiers; // Override Stack member (move of the value) + // type Top() specifiers; // Override Stack member (must throw std::length_error when empty) + // type Pop() specifiers; // Override Stack member (must throw std::length_error when empty) + // type TopNPop() specifiers; // Override Stack member (must throw std::length_error when empty) + + /* ************************************************************************ */ + + // Specific member functions (inherited from Container) + + // type Empty() specifiers; // Override Container member + + // type Size() specifiers; // Override Container member + + // type Clear() specifiers; // Override Container member + +protected: + + // Auxiliary member functions + + // type Expand() specifiers; + // type Reduce() specifiers; + +}; + +/* ************************************************************************** */ + +} + +#include "stackvec.cpp" + +#endif diff --git a/librerie/exercise4/vector/vector.cpp b/librerie/exercise4/vector/vector.cpp new file mode 100644 index 0000000..d374ceb --- /dev/null +++ b/librerie/exercise4/vector/vector.cpp @@ -0,0 +1,10 @@ + +namespace lasd { + +/* ************************************************************************** */ + +// ... + +/* ************************************************************************** */ + +} diff --git a/librerie/exercise4/vector/vector.hpp b/librerie/exercise4/vector/vector.hpp new file mode 100644 index 0000000..6f127ff --- /dev/null +++ b/librerie/exercise4/vector/vector.hpp @@ -0,0 +1,113 @@ + +#ifndef VECTOR_HPP +#define VECTOR_HPP + +/* ************************************************************************** */ + +#include "../container/container.hpp" + +/* ************************************************************************** */ + +namespace lasd { + +/* ************************************************************************** */ + +template +class Vector { // Must extend LinearContainer, MappableContainer, and FoldableContainer + +private: + + // ... + +protected: + + // using LinearContainer::???; + + // ... + +public: + + // Default constructor + // Vector() specifiers; + + /* ************************************************************************ */ + + // Specific constructors + // Vector(argument) specifiers; // A vector with a given initial dimension + // Vector(argument) specifiers; // A vector obtained from a LinearContainer + + /* ************************************************************************ */ + + // Copy constructor + // Vector(argument) specifiers; + + // Move constructor + // Vector(argument) specifiers; + + /* ************************************************************************ */ + + // Destructor + // ~Vector() specifiers; + + /* ************************************************************************ */ + + // Copy assignment + // type operator=(argument) specifiers; + + // Move assignment + // type operator=(argument) specifiers; + + /* ************************************************************************ */ + + // Comparison operators + // type operator==(argument) specifiers; + // type operator!=(argument) specifiers; + + /* ************************************************************************ */ + + // Specific member functions + + // type Resize(argument) specifiers; // Resize the vector to a given size + + /* ************************************************************************ */ + + // Specific member functions (inherited from Container) + + // type Clear() specifiers; // Override Container member + + /* ************************************************************************ */ + + // Specific member functions (inherited from LinearContainer) + + // type Front() specifiers; // Override LinearContainer member (must throw std::length_error when empty) + // type Back() specifiers; // Override LinearContainer member (must throw std::length_error when empty) + + // type operator[](argument) specifiers; // Override LinearContainer member (must throw std::out_of_range when out of range) + + /* ************************************************************************ */ + + // Specific member functions (inherited from MappableContainer) + + // using typename MappableContainer::MapFunctor; + + // type MapPreOrder(arguments) specifiers; // Override MappableContainer member + // type MapPostOrder(arguments) specifiers; // Override MappableContainer member + + /* ************************************************************************ */ + + // Specific member functions (inherited from FoldableContainer) + + // using typename FoldableContainer::FoldFunctor; + + // type FoldPreOrder(arguments) specifiers; // Override FoldableContainer member + // type FoldPostOrder(arguments) specifiers; // Override FoldableContainer member + +}; + +/* ************************************************************************** */ + +} + +#include "vector.cpp" + +#endif diff --git a/librerie/exercise4/zlasdtest/binarytree/binarytree.hpp b/librerie/exercise4/zlasdtest/binarytree/binarytree.hpp new file mode 100644 index 0000000..3e9c85c --- /dev/null +++ b/librerie/exercise4/zlasdtest/binarytree/binarytree.hpp @@ -0,0 +1,130 @@ + +#ifndef BINARYTREETEST_HPP +#define BINARYTREETEST_HPP + +#include "../../binarytree/binarytree.hpp" + +/* ************************************************************************** */ + +template +void GetElement(uint& testnum, uint& testerr, const typename lasd::BinaryTree::Node& nod, bool chk, const Data& val) { + bool tst; + testnum++; + try { + std::cout << " " << testnum << " (" << testerr << ") The data of the node is \"" << nod.Element() << "\": "; + std::cout << ((tst = ((nod.Element() == val) == chk)) ? "Correct" : "Error") << "!" << std::endl; + } catch(std::exception exc) { + tst = false; + std::cout << "\"" << exc.what() << "\": " << "Error!" << std::endl; + } + testerr += (1 - (uint) tst); +} + +template +void SetElement(uint& testnum, uint& testerr, const typename lasd::BinaryTree::Node& nod, bool chk, const Data& val) { + bool tst; + testnum++; + try { + std::cout << " " << testnum << " (" << testerr << ") Setting the front of the linear container to \"" << val << "\": "; + nod.Element() = val; + std::cout << ((tst = ((nod.Element() == val) == chk)) ? "Correct" : "Error") << "!" << std::endl; + } catch(std::exception exc) { + tst = false; + std::cout << "\"" << exc.what() << "\": " << "Error!" << std::endl; + } + testerr += (1 - (uint) tst); +} + +template +void IsLeaf(uint& testnum, uint& testerr, const typename lasd::BinaryTree::Node& nod, bool chk) { + bool tst; + testnum++; + try { + std::cout << " " << testnum << " (" << testerr << ") The node is " << ((tst = nod.IsLeaf()) ? "" : "not ") << "a leaf: "; + std::cout << ((tst = (tst == chk)) ? "Correct" : "Error") << "!" << std::endl; + } catch(std::exception exc) { + tst = false; + std::cout << "\"" << exc.what() << "\": " << "Error!" << std::endl; + } + testerr += (1 - (uint) tst); +} + +template +void HasLeftChild(uint& testnum, uint& testerr, const typename lasd::BinaryTree::Node& nod, bool chk) { + bool tst; + testnum++; + try { + std::cout << " " << testnum << " (" << testerr << ") The node does " << ((tst = nod.HasLeftChild()) ? "" : "not ") << "have a left child: "; + std::cout << ((tst = (tst == chk)) ? "Correct" : "Error") << "!" << std::endl; + } catch(std::exception exc) { + tst = false; + std::cout << "\"" << exc.what() << "\": " << "Error!" << std::endl; + } + testerr += (1 - (uint) tst); +} + +template +void HasRightChild(uint& testnum, uint& testerr, const typename lasd::BinaryTree::Node& nod, bool chk) { + bool tst; + testnum++; + try { + std::cout << " " << testnum << " (" << testerr << ") The node does " << ((tst = nod.HasRightChild()) ? "" : "not ") << "have a right child: "; + std::cout << ((tst = (tst == chk)) ? "Correct" : "Error") << "!" << std::endl; + } catch(std::exception exc) { + tst = false; + std::cout << "\"" << exc.what() << "\": " << "Error!" << std::endl; + } + testerr += (1 - (uint) tst); +} + +/* ************************************************************************** */ + +template +void EqualBT(uint& testnum, uint& testerr, const lasd::BinaryTree& bt1, const lasd::BinaryTree& bt2) { + bool tst; + testnum++; + try { + std::cout << " " << testnum << " (" << testerr << ") The two binary trees are " << ((tst = (bt1 == bt2)) ? "" : "not ") << "equal: "; + std::cout << (tst ? "Correct" : "Error") << "!" << std::endl; + } catch(std::exception exc) { + tst = false; + std::cout << "\"" << exc.what() << "\": " << "Error!" << std::endl; + } + testerr += (1 - (uint) tst); +} + +template +void NonEqualBT(uint& testnum, uint& testerr, const lasd::BinaryTree& bt1, const lasd::BinaryTree& bt2) { + bool tst; + testnum++; + try { + std::cout << " " << testnum << " (" << testerr << ") The two binary trees are " << ((tst = (bt1 != bt2)) ? "not " : "") << "equal: "; + std::cout << (tst ? "Correct" : "Error") << "!" << std::endl; + } catch(std::exception exc) { + tst = false; + std::cout << "\"" << exc.what() << "\": " << "Error!" << std::endl; + } + testerr += (1 - (uint) tst); +} + +/* ************************************************************************** */ + +template +void Root(uint& testnum, uint& testerr, lasd::BinaryTree& bt, bool chk, const Data& val) { + bool tst; + testnum++; + try { + std::cout << " " << testnum << " (" << testerr << ") Root of the tree with value \"" << bt.Root().Element() << "\": "; + std::cout << ((tst = (((bt.Root().Element() == val) && (bt.Root().Element() == val)) == chk)) ? "Correct" : "Error") << "!" << std::endl; + } catch(std::length_error exc) { + std::cout << "\"" << exc.what() << "\": " << ((tst = !chk) ? "Correct" : "Error") << "!" << std::endl; + } catch(std::exception exc) { + tst = false; + std::cout << std::endl << "Wrong exception: " << exc.what() << "!" << std::endl; + } + testerr += (1 - (uint) tst); +} + +/* ************************************************************************** */ + +#endif diff --git a/librerie/exercise4/zlasdtest/bst/bst.hpp b/librerie/exercise4/zlasdtest/bst/bst.hpp new file mode 100644 index 0000000..8b5b96a --- /dev/null +++ b/librerie/exercise4/zlasdtest/bst/bst.hpp @@ -0,0 +1,282 @@ + +#ifndef BSTTEST_HPP +#define BSTTEST_HPP + +#include "../../bst/bst.hpp" + +/* ************************************************************************** */ + +template +void EqualBST(uint& testnum, uint& testerr, const lasd::BST& bst1, const lasd::BST& bst2) { + bool tst; + testnum++; + try { + std::cout << " " << testnum << " (" << testerr << ") The two bsts are " << ((tst = (bst1 == bst2)) ? "" : "not ") << "equal: "; + std::cout << (tst ? "Correct" : "Error") << "!" << std::endl; + } catch(std::exception exc) { + tst = false; + std::cout << "\"" << exc.what() << "\": " << "Error!" << std::endl; + } + testerr += (1 - (uint) tst); +} + +template +void NonEqualBST(uint& testnum, uint& testerr, const lasd::BST& bst1, const lasd::BST& bst2) { + bool tst; + testnum++; + try { + std::cout << " " << testnum << " (" << testerr << ") The two bsts are " << ((tst = (bst1 != bst2)) ? "not " : "") << "equal: "; + std::cout << (tst ? "Correct" : "Error") << "!" << std::endl; + } catch(std::exception exc) { + tst = false; + std::cout << "\"" << exc.what() << "\": " << "Error!" << std::endl; + } + testerr += (1 - (uint) tst); +} + +/* ************************************************************************** */ + +template +void InsertC(uint& testnum, uint& testerr, lasd::BST& bst, const Data& val) { + testnum++; + bool tst = true; + try { + std::cout << " " << testnum << " (" << testerr << ") Insertion in the bst of the value \"" << val << "\": "; + bst.Insert(val); + std::cout << "Correct!" << std::endl; + } catch(std::exception exc) { + tst = false; + std::cout << "\"" << exc.what() << "\": " << "Error!" << std::endl; + } + testerr += (1 - (uint) tst); +} + +template +void InsertM(uint& testnum, uint& testerr, lasd::BST& bst, const Data& val) { + testnum++; + bool tst = true; + try { + std::cout << " " << testnum << " (" << testerr << ") Insertion in the bst of the value \"" << val << "\": "; + bst.Insert(std::move(val)); + std::cout << "Correct!" << std::endl; + } catch(std::exception exc) { + tst = false; + std::cout << "\"" << exc.what() << "\": " << "Error!" << std::endl; + } + testerr += (1 - (uint) tst); +} + +template +void Remove(uint& testnum, uint& testerr, lasd::BST& bst, const Data& val) { + testnum++; + bool tst = true; + try { + std::cout << " " << testnum << " (" << testerr << ") Removal from the bst of the value \"" << val << "\": "; + bst.Remove(val); + std::cout << "Correct!" << std::endl; + } catch(std::exception exc) { + tst = false; + std::cout << "\"" << exc.what() << "\": " << "Error!" << std::endl; + } + testerr += (1 - (uint) tst); +} + +template +void Min(uint& testnum, uint& testerr, lasd::BST& bst, bool chk, const Data& val) { + bool tst; + testnum++; + try { + std::cout << " " << testnum << " (" << testerr << ") Min of the bst with value \"" << bst.Min() << "\": "; + std::cout << ((tst = ((bst.Min() == val) == chk)) ? "Correct" : "Error") << "!" << std::endl; + } catch(std::length_error exc) { + std::cout << "\"" << exc.what() << "\": " << ((tst = !chk) ? "Correct" : "Error") << "!" << std::endl; + } catch(std::exception exc) { + tst = false; + std::cout << std::endl << "Wrong exception: " << exc.what() << "!" << std::endl; + } + testerr += (1 - (uint) tst); +} + +template +void RemoveMin(uint& testnum, uint& testerr, lasd::BST& bst, bool chk) { + bool tst; + testnum++; + try { + std::cout << " " << testnum << " (" << testerr << ") Remove min from the the bst: "; + bst.RemoveMin(); + std::cout << ((tst = chk) ? "Correct" : "Error") << "!" << std::endl; + } catch(std::length_error exc) { + std::cout << "\"" << exc.what() << "\": " << ((tst = !chk) ? "Correct" : "Error") << "!" << std::endl; + } catch(std::exception exc) { + tst = false; + std::cout << std::endl << "Wrong exception: " << exc.what() << "!" << std::endl; + } + testerr += (1 - (uint) tst); +} + +template +void MinNRemove(uint& testnum, uint& testerr, lasd::BST& bst, bool chk, const Data& val) { + bool tst; + testnum++; + try { + std::cout << " " << testnum << " (" << testerr << ") MinNRemove from the bst with value \"" << bst.Min() << "\": "; + std::cout << ((tst = ((bst.MinNRemove() == val) == chk)) ? "Correct" : "Error") << "!" << std::endl; + } catch(std::length_error exc) { + std::cout << "\"" << exc.what() << "\": " << ((tst = !chk) ? "Correct" : "Error") << "!" << std::endl; + } catch(std::exception exc) { + tst = false; + std::cout << std::endl << "Wrong exception: " << exc.what() << "!" << std::endl; + } + testerr += (1 - (uint) tst); +} + +template +void Max(uint& testnum, uint& testerr, lasd::BST& bst, bool chk, const Data& val) { + bool tst; + testnum++; + try { + std::cout << " " << testnum << " (" << testerr << ") Max of the bst with value \"" << bst.Max() << "\": "; + std::cout << ((tst = ((bst.Max() == val) == chk)) ? "Correct" : "Error") << "!" << std::endl; + } catch(std::length_error exc) { + std::cout << "\"" << exc.what() << "\": " << ((tst = !chk) ? "Correct" : "Error") << "!" << std::endl; + } catch(std::exception exc) { + tst = false; + std::cout << std::endl << "Wrong exception: " << exc.what() << "!" << std::endl; + } + testerr += (1 - (uint) tst); +} + +template +void RemoveMax(uint& testnum, uint& testerr, lasd::BST& bst, bool chk) { + bool tst; + testnum++; + try { + std::cout << " " << testnum << " (" << testerr << ") Remove max from the the bst: "; + bst.RemoveMax(); + std::cout << ((tst = chk) ? "Correct" : "Error") << "!" << std::endl; + } catch(std::length_error exc) { + std::cout << "\"" << exc.what() << "\": " << ((tst = !chk) ? "Correct" : "Error") << "!" << std::endl; + } catch(std::exception exc) { + tst = false; + std::cout << std::endl << "Wrong exception: " << exc.what() << "!" << std::endl; + } + testerr += (1 - (uint) tst); +} + +template +void MaxNRemove(uint& testnum, uint& testerr, lasd::BST& bst, bool chk, const Data& val) { + bool tst; + testnum++; + try { + std::cout << " " << testnum << " (" << testerr << ") MaxNRemove from the bst with value \"" << bst.Max() << "\": "; + std::cout << ((tst = ((bst.MaxNRemove() == val) == chk)) ? "Correct" : "Error") << "!" << std::endl; + } catch(std::length_error exc) { + std::cout << "\"" << exc.what() << "\": " << ((tst = !chk) ? "Correct" : "Error") << "!" << std::endl; + } catch(std::exception exc) { + tst = false; + std::cout << std::endl << "Wrong exception: " << exc.what() << "!" << std::endl; + } + testerr += (1 - (uint) tst); +} + +template +void Predecessor(uint& testnum, uint& testerr, lasd::BST& bst, bool chk, const Data& prd, const Data& val) { + bool tst; + testnum++; + try { + std::cout << " " << testnum << " (" << testerr << ") Predecessor of " << prd << " with value \"" << bst.Predecessor(prd) << "\": "; + std::cout << ((tst = ((bst.Predecessor(prd) == val) == chk)) ? "Correct" : "Error") << "!" << std::endl; + } catch(std::length_error exc) { + std::cout << "\"" << exc.what() << "\": " << ((tst = !chk) ? "Correct" : "Error") << "!" << std::endl; + } catch(std::exception exc) { + tst = false; + std::cout << std::endl << "Wrong exception: " << exc.what() << "!" << std::endl; + } + testerr += (1 - (uint) tst); +} + +template +void RemovePredecessor(uint& testnum, uint& testerr, lasd::BST& bst, bool chk, const Data& prd) { + bool tst; + testnum++; + try { + std::cout << " " << testnum << " (" << testerr << ") Remove predecessor of " << prd << " from the the bst: \"" << bst.Predecessor(prd) << "\": "; + bst.RemovePredecessor(prd); + std::cout << ((tst = chk) ? "Correct" : "Error") << "!" << std::endl; + } catch(std::length_error exc) { + std::cout << "\"" << exc.what() << "\": " << ((tst = !chk) ? "Correct" : "Error") << "!" << std::endl; + } catch(std::exception exc) { + tst = false; + std::cout << std::endl << "Wrong exception: " << exc.what() << "!" << std::endl; + } + testerr += (1 - (uint) tst); +} + +template +void PredecessorNRemove(uint& testnum, uint& testerr, lasd::BST& bst, bool chk, const Data& prd, const Data& val) { + bool tst; + testnum++; + try { + std::cout << " " << testnum << " (" << testerr << ") Remove predecessor of " << prd << " from the the bst: \"" << bst.Predecessor(prd) << "\": "; + std::cout << ((tst = ((bst.PredecessorNRemove(prd) == val) == chk)) ? "Correct" : "Error") << "!" << std::endl; + } catch(std::length_error exc) { + std::cout << "\"" << exc.what() << "\": " << ((tst = !chk) ? "Correct" : "Error") << "!" << std::endl; + } catch(std::exception exc) { + tst = false; + std::cout << std::endl << "Wrong exception: " << exc.what() << "!" << std::endl; + } + testerr += (1 - (uint) tst); +} + +template +void Successor(uint& testnum, uint& testerr, lasd::BST& bst, bool chk, const Data& prd, const Data& val) { + bool tst; + testnum++; + try { + std::cout << " " << testnum << " (" << testerr << ") Successor of " << prd << " with value \"" << bst.Successor(prd) << "\": "; + std::cout << ((tst = ((bst.Successor(prd) == val) == chk)) ? "Correct" : "Error") << "!" << std::endl; + } catch(std::length_error exc) { + std::cout << "\"" << exc.what() << "\": " << ((tst = !chk) ? "Correct" : "Error") << "!" << std::endl; + } catch(std::exception exc) { + tst = false; + std::cout << std::endl << "Wrong exception: " << exc.what() << "!" << std::endl; + } + testerr += (1 - (uint) tst); +} + +template +void RemoveSuccessor(uint& testnum, uint& testerr, lasd::BST& bst, bool chk, const Data& prd) { + bool tst; + testnum++; + try { + std::cout << " " << testnum << " (" << testerr << ") Remove successor of " << prd << " from the the bst: \"" << bst.Successor(prd) << "\": "; + bst.RemoveSuccessor(prd); + std::cout << ((tst = chk) ? "Correct" : "Error") << "!" << std::endl; + } catch(std::length_error exc) { + std::cout << "\"" << exc.what() << "\": " << ((tst = !chk) ? "Correct" : "Error") << "!" << std::endl; + } catch(std::exception exc) { + tst = false; + std::cout << std::endl << "Wrong exception: " << exc.what() << "!" << std::endl; + } + testerr += (1 - (uint) tst); +} + +template +void SuccessorNRemove(uint& testnum, uint& testerr, lasd::BST& bst, bool chk, const Data& prd, const Data& val) { + bool tst; + testnum++; + try { + std::cout << " " << testnum << " (" << testerr << ") Remove successor of " << prd << " from the the bst: \"" << bst.Successor(prd) << "\": "; + std::cout << ((tst = ((bst.SuccessorNRemove(prd) == val) == chk)) ? "Correct" : "Error") << "!" << std::endl; + } catch(std::length_error exc) { + std::cout << "\"" << exc.what() << "\": " << ((tst = !chk) ? "Correct" : "Error") << "!" << std::endl; + } catch(std::exception exc) { + tst = false; + std::cout << std::endl << "Wrong exception: " << exc.what() << "!" << std::endl; + } + testerr += (1 - (uint) tst); +} + +/* ************************************************************************** */ + +#endif diff --git a/librerie/exercise4/zlasdtest/container/container.cpp b/librerie/exercise4/zlasdtest/container/container.cpp new file mode 100644 index 0000000..a7f040e --- /dev/null +++ b/librerie/exercise4/zlasdtest/container/container.cpp @@ -0,0 +1,49 @@ + +#include + +/* ************************************************************************** */ + +#include "../../container/container.hpp" + +/* ************************************************************************** */ + +// Container member functions! + +void Empty(uint& testnum, uint& testerr, const lasd::Container& con, bool chk) { + bool tst; + testnum++; + std::cout << " " << testnum << " (" << testerr << ") The container is " << ((tst = con.Empty()) ? "" : "not ") << "empty: "; + std::cout << ((tst = (tst == chk)) ? "Correct" : "Error") << "!" << std::endl; + testerr += (1 - (uint) tst); +} + +void Size(uint& testnum, uint& testerr, const lasd::Container& con, bool chk, ulong siz) { + bool tst; + testnum++; + std::cout << " " << testnum << " (" << testerr << ") The container has size " << con.Size() << ": "; + std::cout << ((tst = ((con.Size() == siz) == chk)) ? "Correct" : "Error") << "!" << std::endl; + testerr += (1 - (uint) tst); +} + +/* ************************************************************************** */ + +// Auxiliary functions for MappableContainer! + +void MapStringAppend(std::string& dat, void* par) { + dat.append(*((std::string*) par)); +} + +/* ************************************************************************** */ + +// Auxiliary functions for FoldableContainer! + +void FoldParity(const int& dat, const void* _, void* acc) { + *((int*) acc) += dat; + *((int*) acc) %= 2; +} + +void FoldStringConcatenate(const std::string& dat, const void* _, void* acc) { + ((std::string*) acc)->append(dat); +} + +/* ************************************************************************** */ diff --git a/librerie/exercise4/zlasdtest/container/container.hpp b/librerie/exercise4/zlasdtest/container/container.hpp new file mode 100644 index 0000000..b24ce71 --- /dev/null +++ b/librerie/exercise4/zlasdtest/container/container.hpp @@ -0,0 +1,351 @@ + +#ifndef CONTAINERTEST_HPP +#define CONTAINERTEST_HPP + +#include "../../container/container.hpp" + +/* ************************************************************************** */ + +// Container member functions! + +void Empty(uint&, uint&, const lasd::Container&, bool); + +void Size(uint&, uint&, const lasd::Container&, bool, ulong); + +/* ************************************************************************** */ + +// LinearContainer member functions! + +template +void GetFront(uint& testnum, uint& testerr, const lasd::LinearContainer& con, bool chk, const Data& val) { + bool tst; + testnum++; + try { + std::cout << " " << testnum << " (" << testerr << ") The front of the linear container is \"" << con.Front() << "\": "; + std::cout << ((tst = ((con.Front() == val) == chk)) ? "Correct" : "Error") << "!" << std::endl; + } catch(std::length_error exc) { + std::cout << exc.what() << "\": " << ((tst = !chk) ? "Correct" : "Error") << "!" << std::endl; + } catch(std::exception exc) { + tst = false; + std::cout << std::endl << "Wrong exception: " << exc.what() << "!" << std::endl; + } + testerr += (1 - (uint) tst); +} + +template +void SetFront(uint& testnum, uint& testerr, const lasd::LinearContainer& con, bool chk, const Data& val) { + bool tst; + testnum++; + try { + std::cout << " " << testnum << " (" << testerr << ") Setting the front of the linear container to \"" << val << "\": "; + con.Front() = val; + std::cout << ((tst = ((con.Front() == val) == chk)) ? "Correct" : "Error") << "!" << std::endl; + } catch(std::length_error exc) { + std::cout << exc.what() << "\": " << ((tst = !chk) ? "Correct" : "Error") << "!" << std::endl; + } catch(std::exception exc) { + tst = false; + std::cout << std::endl << "Wrong exception: " << exc.what() << "!" << std::endl; + } + testerr += (1 - (uint) tst); +} + +template +void GetBack(uint& testnum, uint& testerr, const lasd::LinearContainer& con, bool chk, const Data& val) { + bool tst; + testnum++; + try { + std::cout << " " << testnum << " (" << testerr << ") The back of the linear container is \"" << con.Back() << "\": "; + std::cout << ((tst = ((con.Back() == val) == chk)) ? "Correct" : "Error") << "!" << std::endl; + } catch(std::length_error exc) { + std::cout << exc.what() << "\": " << ((tst = !chk) ? "Correct" : "Error") << "!" << std::endl; + } catch(std::exception exc) { + tst = false; + std::cout << std::endl << "Wrong exception: " << exc.what() << "!" << std::endl; + } + testerr += (1 - (uint) tst); +} + +template +void SetBack(uint& testnum, uint& testerr, const lasd::LinearContainer& con, bool chk, const Data& val) { + bool tst; + testnum++; + try { + std::cout << " " << testnum << " (" << testerr << ") Setting the back of the linear container to \"" << val << "\": "; + con.Back() = val; + std::cout << ((tst = ((con.Back() == val) == chk)) ? "Correct" : "Error") << "!" << std::endl; + } catch(std::length_error exc) { + std::cout << exc.what() << "\": " << ((tst = !chk) ? "Correct" : "Error") << "!" << std::endl; + } catch(std::exception exc) { + tst = false; + std::cout << std::endl << "Wrong exception: " << exc.what() << "!" << std::endl; + } + testerr += (1 - (uint) tst); +} + +template +void GetAt(uint& testnum, uint& testerr, lasd::LinearContainer& con, bool chk, const ulong& ind, const Data& val) { + bool tst; + testnum++; + try { + std::cout << " " << testnum << " (" << testerr << ") Get of the linear container at index \"" << ind << "\" with value \"" << con[ind] << "\": "; + std::cout << ((tst = ((con[ind] == val) == chk)) ? "Correct" : "Error") << "!" << std::endl; + } catch(std::out_of_range exc) { + std::cout << exc.what() << "\": " << ((tst = !chk) ? "Correct" : "Error") << "!" << std::endl; + } catch(std::exception exc) { + tst = false; + std::cout << std::endl << "Wrong exception: " << exc.what() << "!" << std::endl; + } + testerr += (1 - (uint) tst); +} + +template +void SetAt(uint& testnum, uint& testerr, lasd::LinearContainer& con, bool chk, const ulong& ind, const Data& val) { + bool tst; + testnum++; + try { + std::cout << " " << testnum << " (" << testerr << ") Set of the linear container at index \"" << ind << "\" with value \"" << val << "\": "; + con[ind] = val; + std::cout << ((tst = ((con[ind] == val) == chk)) ? "Correct" : "Error") << "!" << std::endl; + } catch(std::out_of_range exc) { + std::cout << "\"" << exc.what() << "\": " << ((tst = !chk) ? "Correct" : "Error") << "!" << std::endl; + } catch(std::exception exc) { + tst = false; + std::cout << std::endl << "Wrong exception: " << exc.what() << "!" << std::endl; + } + testerr += (1 - (uint) tst); +} + +/* ************************************************************************** */ + +// TestableContainer member functions! + +template +void Exists(uint& testnum, uint& testerr, const lasd::TestableContainer& con, bool chk, const Data& val) { + bool tst; + testnum++; + std::cout << " " << testnum << " (" << testerr << ") Data \"" << val << "\" " << ((tst = con.Exists(val)) ? "does" : "does not") << " exist: "; + std::cout << ((tst = (tst == chk)) ? "Correct" : "Error") << "!" << std::endl; + testerr += (1 - (uint) tst); +} + +/* ************************************************************************** */ + +// MappableContainer member functions! + +template +void MapPreOrder(uint& testnum, uint& testerr, lasd::MappableContainer& con, bool chk, typename lasd::MappableContainer::MapFunctor fun, const Parameter& inipar) { + bool tst = true; + testnum++; + Parameter par = {inipar}; + try { + std::cout << " " << testnum << " (" << testerr << ") Executing map in pre order - "; + con.MapPreOrder(fun, &par); + std::cout << ": " << ((tst = chk) ? "Correct" : "Error") << "!" << std::endl; + } catch(std::exception exc) { + std::cout << "\"" << exc.what() << "\": " << ((tst = !chk) ? "Correct" : "Error") << "!" << std::endl; + } + testerr += (1 - (uint) tst); +} + +template +void MapPostOrder(uint& testnum, uint& testerr, lasd::MappableContainer& con, bool chk, typename lasd::MappableContainer::MapFunctor fun, const Parameter& inipar) { + bool tst = true; + testnum++; + Parameter par = {inipar}; + try { + std::cout << " " << testnum << " (" << testerr << ") Executing map in post order - "; + con.MapPostOrder(fun, &par); + std::cout << ": " << ((tst = chk) ? "Correct" : "Error") << "!" << std::endl; + } catch(std::exception exc) { + std::cout << "\"" << exc.what() << "\": " << ((tst = !chk) ? "Correct" : "Error") << "!" << std::endl; + } + testerr += (1 - (uint) tst); +} + +template +void MapPrint(const Data& dat, void* _) { + std::cout << dat << " "; +} + +template +void MapIncrement(Data& dat, void* _) { + dat++; +} + +template +void MapDecrement(Data& dat, void* _) { + dat--; +} + +template +void MapIncrementNPrint(Data& dat, void* _) { + std::cout << dat++ << "->" << dat << "; "; +} + +template +void MapDouble(Data& dat, void* _) { + dat *= 2; +} + +template +void MapHalf(Data& dat, void* _) { + dat /= 2; +} + +template +void MapDoubleNPrint(Data& dat, void* _) { + std::cout << dat << "->" << (dat *= 2) << "; "; +} + +template +void MapInvert(Data& dat, void* _) { + dat = -dat; +} + +template +void MapInvertNPrint(Data& dat, void* _) { + std::cout << dat << "->" << (dat = -dat) << "; "; +} + +template +void MapParityInvert(Data& dat, void* _) { + if (dat % 2 != 0) { dat = -dat; } +} + +void MapStringAppend(std::string&, void*); + +/* ************************************************************************** */ + +// FoldableContainer member functions! + +template +void FoldPreOrder(uint& testnum, uint& testerr, const lasd::FoldableContainer& con, bool chk, typename lasd::FoldableContainer::FoldFunctor fun, const Parameter& inipar, const Value& inival, const Value& finval) { + bool tst; + testnum++; + Parameter par = {inipar}; + Value val = inival; + try { + std::cout << " " << testnum << " (" << testerr << ") Executing fold in pre order - "; + con.FoldPreOrder(fun, &par, &val); + std::cout << "obtained value is \"" << val << "\": "; + std::cout << ((tst = ((val == finval) == chk)) ? "Correct" : "Error") << "!" << std::endl; + } catch(std::exception exc) { + std::cout << "\"" << exc.what() << "\": " << ((tst = !chk) ? "Correct" : "Error") << "!" << std::endl; + } + testerr += (1 - (uint) tst); +} + +template +void FoldPostOrder(uint& testnum, uint& testerr, const lasd::FoldableContainer& con, bool chk, typename lasd::FoldableContainer::FoldFunctor fun, const Parameter& inipar, const Value& inival, const Value& finval) { + bool tst; + testnum++; + Parameter par = {inipar}; + Value val = inival; + try { + std::cout << " " << testnum << " (" << testerr << ") Executing fold in post order - "; + con.FoldPostOrder(fun, &par, &val); + std::cout << "obtained value is \"" << val << "\": "; + std::cout << ((tst = ((val == finval) == chk)) ? "Correct" : "Error") << "!" << std::endl; + } catch(std::exception exc) { + std::cout << "\"" << exc.what() << "\": " << ((tst = !chk) ? "Correct" : "Error") << "!" << std::endl; + } + testerr += (1 - (uint) tst); +} + +template +void FoldAdd(const Data& dat, const void* _, void* acc) { + *((Data*) acc) += dat; +} + +template +void FoldMultiply(const Data& dat, const void* _, void* acc) { + *((Data*) acc) *= dat; +} + +void FoldParity(const int&, const void*, void*); + +void FoldStringConcatenate(const std::string&, const void*, void*); + +/* ************************************************************************** */ + +// InOrderMappableContainer member functions! + +template +void MapInOrder(uint& testnum, uint& testerr, lasd::InOrderMappableContainer& con, bool chk, typename lasd::InOrderMappableContainer::MapFunctor fun, const Parameter& inipar) { + bool tst = true; + testnum++; + Parameter par = {inipar}; + try { + std::cout << " " << testnum << " (" << testerr << ") Executing map in order - "; + con.MapInOrder(fun, &par); + std::cout << ": " << ((tst = chk) ? "Correct" : "Error") << "!" << std::endl; + } catch(std::exception exc) { + std::cout << "\"" << exc.what() << "\": " << ((tst = !chk) ? "Correct" : "Error") << "!" << std::endl; + } + testerr += (1 - (uint) tst); +} + +/* ************************************************************************** */ + +// InOrderFoldableContainer member functions! + +template +void FoldInOrder(uint& testnum, uint& testerr, const lasd::InOrderFoldableContainer& con, bool chk, typename lasd::InOrderFoldableContainer::FoldFunctor fun, const Parameter& inipar, const Value& inival, const Value& finval) { + bool tst; + testnum++; + Parameter par = {inipar}; + Value val = inival; + try { + std::cout << " " << testnum << " (" << testerr << ") Executing fold in order - "; + con.FoldInOrder(fun, &par, &val); + std::cout << "obtained value is \"" << val << "\": "; + std::cout << ((tst = ((val == finval) == chk)) ? "Correct" : "Error") << "!" << std::endl; + } catch(std::exception exc) { + std::cout << "\"" << exc.what() << "\": " << ((tst = !chk) ? "Correct" : "Error") << "!" << std::endl; + } + testerr += (1 - (uint) tst); +} + +/* ************************************************************************** */ + +// BreadthMappableContainer member functions! + +template +void MapBreadth(uint& testnum, uint& testerr, lasd::BreadthMappableContainer& con, bool chk, typename lasd::BreadthMappableContainer::MapFunctor fun, const Parameter& inipar) { + bool tst = true; + testnum++; + Parameter par = {inipar}; + try { + std::cout << " " << testnum << " (" << testerr << ") Executing map in breadth - "; + con.MapBreadth(fun, &par); + std::cout << ": " << ((tst = chk) ? "Correct" : "Error") << "!" << std::endl; + } catch(std::exception exc) { + std::cout << "\"" << exc.what() << "\": " << ((tst = !chk) ? "Correct" : "Error") << "!" << std::endl; + } + testerr += (1 - (uint) tst); +} + +/* ************************************************************************** */ + +// BreadthFoldableContainer member functions! + +template +void FoldBreadth(uint& testnum, uint& testerr, const lasd::BreadthFoldableContainer& con, bool chk, typename lasd::BreadthFoldableContainer::FoldFunctor fun, const Parameter& inipar, const Value& inival, const Value& finval) { + bool tst; + testnum++; + Parameter par = {inipar}; + Value val = inival; + try { + std::cout << " " << testnum << " (" << testerr << ") Executing fold in breadth - "; + con.FoldBreadth(fun, &par, &val); + std::cout << "obtained value is \"" << val << "\": "; + std::cout << ((tst = ((val == finval) == chk)) ? "Correct" : "Error") << "!" << std::endl; + } catch(std::exception exc) { + std::cout << "\"" << exc.what() << "\": " << ((tst = !chk) ? "Correct" : "Error") << "!" << std::endl; + } + testerr += (1 - (uint) tst); +} + +/* ************************************************************************** */ + +#endif diff --git a/librerie/exercise4/zlasdtest/exercise1/fulltest.cpp b/librerie/exercise4/zlasdtest/exercise1/fulltest.cpp new file mode 100644 index 0000000..27f84be --- /dev/null +++ b/librerie/exercise4/zlasdtest/exercise1/fulltest.cpp @@ -0,0 +1,3 @@ + +void testFullExercise1() { +} diff --git a/librerie/exercise4/zlasdtest/exercise1/simpletest.cpp b/librerie/exercise4/zlasdtest/exercise1/simpletest.cpp new file mode 100644 index 0000000..d1caed3 --- /dev/null +++ b/librerie/exercise4/zlasdtest/exercise1/simpletest.cpp @@ -0,0 +1,447 @@ + +#include + +/* ************************************************************************** */ + +#include "../container/container.hpp" + +#include "../vector/vector.hpp" + +#include "../list/list.hpp" + +/* ************************************************************************** */ + +using namespace std; + +/* ************************************************************************** */ + +void stestVectorInt(uint& testnum, uint& testerr) { + uint loctestnum = 0, loctesterr = 0; + cout << endl << "Begin of Vector Test:" << endl; + try { + { + lasd::Vector vec; + Empty(loctestnum, loctesterr, vec, true); + + GetFront(loctestnum, loctesterr, vec, false, 0); + GetBack(loctestnum, loctesterr, vec, false, 0); + SetAt(loctestnum, loctesterr, vec, false, 1, 0); + GetAt(loctestnum, loctesterr, vec, false, 2, 0); + + Exists(loctestnum, loctesterr, vec, false, 0); + + MapPreOrder(loctestnum, loctesterr, vec, true, &MapPrint, 0); + MapPostOrder(loctestnum, loctesterr, vec, true, &MapPrint, 0); + + FoldPreOrder(loctestnum, loctesterr, vec, true, &FoldAdd, 0, 0, 0); + FoldPostOrder(loctestnum, loctesterr, vec, true, &FoldAdd, 0, 0, 0); + } + { + lasd::Vector vec(3); + Empty(loctestnum, loctesterr, vec, false); + Size(loctestnum, loctesterr, vec, true, 3); + + SetAt(loctestnum, loctesterr, vec, true, 0, 4); + SetAt(loctestnum, loctesterr, vec, true, 1, 3); + SetAt(loctestnum, loctesterr, vec, true, 2, 1); + + GetFront(loctestnum, loctesterr, vec, true, 4); + GetBack(loctestnum, loctesterr, vec, true, 1); + + SetFront(loctestnum, loctesterr, vec, true, 5); + SetBack(loctestnum, loctesterr, vec, true, 4); + + Exists(loctestnum, loctesterr, vec, true, 4); + + MapPreOrder(loctestnum, loctesterr, vec, true, &MapPrint, 0); + MapPostOrder(loctestnum, loctesterr, vec, true, &MapPrint, 0); + FoldPreOrder(loctestnum, loctesterr, vec, true, &FoldAdd, 0, 0, 12); + FoldPostOrder(loctestnum, loctesterr, vec, true, &FoldMultiply, 0, 1, 60); + + vec.Resize(2); + FoldPostOrder(loctestnum, loctesterr, vec, true, &FoldMultiply, 0, 1, 15); + } + } catch(...) { + loctestnum++; loctesterr++; + cout << endl << "Unmanaged error! " << endl; + } + cout << "End of Vector Test! (Errors/Tests: " << loctesterr << "/" << loctestnum << ")" << endl; + testnum += loctestnum; + testerr += loctesterr; +} + +void stestVectorDouble(uint& testnum, uint& testerr) { + uint loctestnum = 0, loctesterr = 0; + cout << endl << "Begin of Vector Test:" << endl; + try { + lasd::Vector vec(3); + Empty(loctestnum, loctesterr, vec, false); + Size(loctestnum, loctesterr, vec, true, 3); + + SetAt(loctestnum, loctesterr, vec, true, 0, 5.5); + SetAt(loctestnum, loctesterr, vec, true, 1, 3.3); + SetAt(loctestnum, loctesterr, vec, true, 2, 1.1); + + GetFront(loctestnum, loctesterr, vec, true, 5.5); + GetBack(loctestnum, loctesterr, vec, true, 1.1); + + Exists(loctestnum, loctesterr, vec, true, 3.3); + + FoldPreOrder(loctestnum, loctesterr, vec, true, &FoldAdd, 0.0, 0.0, 9.9); + FoldPostOrder(loctestnum, loctesterr, vec, true, &FoldMultiply, 0.0, 1.0, 19.965); + } catch(...) { + loctestnum++; loctesterr++; + cout << endl << "Unmanaged error! " << endl; + } + cout << "End of Vector Test! (Errors/Tests: " << loctesterr << "/" << loctestnum << ")" << endl; + testnum += loctestnum; + testerr += loctesterr; +} + +void stestVectorString(uint& testnum, uint& testerr) { + uint loctestnum = 0, loctesterr = 0; + cout << endl << "Begin of Vector Test:" << endl; + try { + lasd::Vector vec(2); + Empty(loctestnum, loctesterr, vec, false); + Size(loctestnum, loctesterr, vec, true, 2); + + SetAt(loctestnum, loctesterr, vec, true, 0, string("A")); + SetAt(loctestnum, loctesterr, vec, true, 1, string("B")); + + GetFront(loctestnum, loctesterr, vec, true, string("A")); + GetBack(loctestnum, loctesterr, vec, true, string("B")); + + Exists(loctestnum, loctesterr, vec, true, string("A")); + + MapPreOrder(loctestnum, loctesterr, vec, true, &MapStringAppend, string(" ")); + MapPreOrder(loctestnum, loctesterr, vec, true, &MapPrint, 0); + FoldPreOrder(loctestnum, loctesterr, vec, true, &FoldStringConcatenate, string(""), string("X"), string("XA B ")); + FoldPostOrder(loctestnum, loctesterr, vec, true, &FoldStringConcatenate, string(""), string("X"), string("XB A ")); + + Exists(loctestnum, loctesterr, vec, false, string("A")); + + lasd::Vector copvec(vec); + EqualVector(loctestnum, loctesterr, vec, copvec, true); + MapPreOrder(loctestnum, loctesterr, vec, true, &MapStringAppend, string("!")); + NonEqualVector(loctestnum, loctesterr, vec, copvec, true); + + copvec = move(vec); + FoldPreOrder(loctestnum, loctesterr, copvec, true, &FoldStringConcatenate, string(""), string("?"), string("?A !B !")); + + lasd::Vector movvec(move(vec)); + FoldPreOrder(loctestnum, loctesterr, movvec, true, &FoldStringConcatenate, string(""), string("?"), string("?A B ")); + SetAt(loctestnum, loctesterr, vec, false, 1, string("")); + vec.Resize(1); + SetAt(loctestnum, loctesterr, vec, true, 0, string("X")); + + movvec.Clear(); + Empty(loctestnum, loctesterr, movvec, true); + } catch(...) { + loctestnum++; loctesterr++; + cout << endl << "Unmanaged error! " << endl; + } + cout << "End of Vector Test! (Errors/Tests: " << loctesterr << "/" << loctestnum << ")" << endl; + testnum += loctestnum; + testerr += loctesterr; +} + +void stestVector(uint& testnum, uint& testerr) { + uint loctestnum = 0, loctesterr = 0; + stestVectorInt(loctestnum, loctesterr); + stestVectorDouble(loctestnum, loctesterr); + stestVectorString(loctestnum, loctesterr); + testnum += loctestnum; + testerr += loctesterr; + cout << endl << "Exercise 1 - Vector (Errors/Tests: " << loctesterr << "/" << loctestnum << ")" << endl; +} + +/* ************************************************************************** */ + +void stestListInt(uint& testnum, uint& testerr) { + uint loctestnum = 0, loctesterr = 0; + cout << endl << "Begin of List Test:" << endl; + try { + lasd::List lst; + Empty(loctestnum, loctesterr, lst, true); + Size(loctestnum, loctesterr, lst, true, 0); + + GetFront(loctestnum, loctesterr, lst, false, 0); + GetBack(loctestnum, loctesterr, lst, false, 0); + + Exists(loctestnum, loctesterr, lst, false, 0); + + MapPreOrder(loctestnum, loctesterr, lst, true, &MapPrint, 0); + MapPostOrder(loctestnum, loctesterr, lst, true, &MapPrint, 0); + FoldPreOrder(loctestnum, loctesterr, lst, true, &FoldAdd, 0, 0, 0); + FoldPostOrder(loctestnum, loctesterr, lst, true, &FoldAdd, 0, 0, 0); + + RemoveFromFront(loctestnum, loctesterr, lst, false); + FrontNRemove(loctestnum, loctesterr, lst, false, 0); + + InsertAtBack(loctestnum, loctesterr, lst, true, 4); + InsertAtFront(loctestnum, loctesterr, lst, true, 5); + InsertAtFront(loctestnum, loctesterr, lst, true, 9); + InsertAtBack(loctestnum, loctesterr, lst, true, 2); + InsertAtFront(loctestnum, loctesterr, lst, true, 1); + + GetFront(loctestnum, loctesterr, lst, true, 1); + GetBack(loctestnum, loctesterr, lst, true, 2); + SetFront(loctestnum, loctesterr, lst, true, 2); + SetBack(loctestnum, loctesterr, lst, true, 6); + + GetAt(loctestnum, loctesterr, lst, true, 3, 4); + SetAt(loctestnum, loctesterr, lst, true, 3, 3); + + Exists(loctestnum, loctesterr, lst, false, 4); + + MapPreOrder(loctestnum, loctesterr, lst, true, &MapPrint, 0); + MapPostOrder(loctestnum, loctesterr, lst, true, &MapPrint, 0); + FoldPreOrder(loctestnum, loctesterr, lst, true, &FoldAdd, 0, 0, 25); + FoldPostOrder(loctestnum, loctesterr, lst, true, &FoldMultiply, 0, 1, 1620); + + RemoveFromFront(loctestnum, loctesterr, lst, true); + FrontNRemove(loctestnum, loctesterr, lst, true, 9); + FoldPostOrder(loctestnum, loctesterr, lst, true, &FoldMultiply, 0, 1, 90); + + lasd::List coplst(lst); + EqualList(loctestnum, loctesterr, lst, coplst, true); + MapPreOrder(loctestnum, loctesterr, lst, true, &MapIncrement, 0); + NonEqualList(loctestnum, loctesterr, lst, coplst, true); + + InsertAtFront(loctestnum, loctesterr, lst, true, 0); + InsertAtBack(loctestnum, loctesterr, lst, true, 0); + NonEqualList(loctestnum, loctesterr, lst, coplst, true); + coplst = lst; + EqualList(loctestnum, loctesterr, lst, coplst, true); + + RemoveFromFront(loctestnum, loctesterr, coplst, true); + FrontNRemove(loctestnum, loctesterr, coplst, true, 6); + coplst = move(lst); + FoldPreOrder(loctestnum, loctesterr, lst, true, &FoldAdd, 0, 0, 11); + FoldPreOrder(loctestnum, loctesterr, coplst, true, &FoldAdd, 0, 0, 17); + + lasd::List movlst(move(lst)); + MapPreOrder(loctestnum, loctesterr, movlst, true, &MapIncrement, 0); + FoldPreOrder(loctestnum, loctesterr, movlst, true, &FoldAdd, 0, 0, 14); + + movlst.Clear(); + Empty(loctestnum, loctesterr, movlst, true); + Size(loctestnum, loctesterr, movlst, true, 0); + } catch(...) { + loctestnum++; loctesterr++; + cout << endl << "Unmanaged error! " << endl; + } + cout << "End of List Test! (Errors/Tests: " << loctesterr << "/" << loctestnum << ")" << endl; + testnum += loctestnum; + testerr += loctesterr; +} + +void stestListDouble(uint& testnum, uint& testerr) { + uint loctestnum = 0, loctesterr = 0; + cout << endl << "Begin of List Test:" << endl; + try { + lasd::List lst; + Empty(loctestnum, loctesterr, lst, true); + Size(loctestnum, loctesterr, lst, true, 0); + + InsertAtBack(loctestnum, loctesterr, lst, true, -2.5); + InsertAtBack(loctestnum, loctesterr, lst, true, 2.5); + + lst.Clear(); + + InsertAtBack(loctestnum, loctesterr, lst, true, 0.5); + InsertAtFront(loctestnum, loctesterr, lst, true, 3.3); + InsertAtFront(loctestnum, loctesterr, lst, true, 5.5); + InsertAtBack(loctestnum, loctesterr, lst, true, 1.1); + + GetFront(loctestnum, loctesterr, lst, true, 5.5); + GetBack(loctestnum, loctesterr, lst, true, 1.1); + + Exists(loctestnum, loctesterr, lst, false, 0.0); + + MapPreOrder(loctestnum, loctesterr, lst, true, &MapPrint, 0); + MapPostOrder(loctestnum, loctesterr, lst, true, &MapPrint, 0); + FoldPreOrder(loctestnum, loctesterr, lst, true, &FoldAdd, 0.0, 0.0, 10.4); + FoldPostOrder(loctestnum, loctesterr, lst, true, &FoldMultiply, 0.0, 1.0, 9.9825); + } catch(...) { + loctestnum++; loctesterr++; + cout << endl << "Unmanaged error! " << endl; + } + cout << "End of List Test! (Errors/Tests: " << loctesterr << "/" << loctestnum << ")" << endl; + testnum += loctestnum; + testerr += loctesterr; +} + +void stestListString(uint& testnum, uint& testerr) { + uint loctestnum = 0, loctesterr = 0; + cout << endl << "Begin of List Test:" << endl; + try { + lasd::List lst; + Empty(loctestnum, loctesterr, lst, true); + Size(loctestnum, loctesterr, lst, true, 0); + + InsertAtFront(loctestnum, loctesterr, lst, true, string("A")); + InsertAtBack(loctestnum, loctesterr, lst, true, string("B")); + + GetFront(loctestnum, loctesterr, lst, true, string("A")); + GetBack(loctestnum, loctesterr, lst, true, string("B")); + + Exists(loctestnum, loctesterr, lst, true, string("B")); + + MapPreOrder(loctestnum, loctesterr, lst, true, &MapStringAppend, string(" ")); + MapPreOrder(loctestnum, loctesterr, lst, true, &MapPrint, 0); + FoldPreOrder(loctestnum, loctesterr, lst, true, &FoldStringConcatenate, string(""), string("X"), string("XA B ")); + FoldPostOrder(loctestnum, loctesterr, lst, true, &FoldStringConcatenate, string(""), string("X"), string("XB A ")); + + Exists(loctestnum, loctesterr, lst, false, string("B")); + + lasd::List coplst(lst); + EqualList(loctestnum, loctesterr, lst, coplst, true); + RemoveFromFront(loctestnum, loctesterr, coplst, true); + NonEqualList(loctestnum, loctesterr, lst, coplst, true); + + lst = coplst; + EqualList(loctestnum, loctesterr, lst, coplst, true); + InsertAtBack(loctestnum, loctesterr, lst, true, string("A")); + InsertAtFront(loctestnum, loctesterr, lst, true, string("C")); + NonEqualList(loctestnum, loctesterr, lst, coplst, true); + + coplst = move(lst); + FoldPreOrder(loctestnum, loctesterr, coplst, true, &FoldStringConcatenate, string(""), string("?"), string("?CB A")); + } catch(...) { + loctestnum++; loctesterr++; + cout << endl << "Unmanaged error! " << endl; + } + cout << "End of List Test! (Errors/Tests: " << loctesterr << "/" << loctestnum << ")" << endl; + testnum += loctestnum; + testerr += loctesterr; +} + +void stestList(uint& testnum, uint& testerr) { + uint loctestnum = 0, loctesterr = 0; + stestListInt(loctestnum, loctesterr); + stestListDouble(loctestnum, loctesterr); + stestListString(loctestnum, loctesterr); + testnum += loctestnum; + testerr += loctesterr; + cout << endl << "Exercise 1 - List (Errors/Tests: " << loctesterr << "/" << loctestnum << ")" << endl; +} + +/* ************************************************************************** */ + +void stestVectorListInt(uint& testnum, uint& testerr) { + uint loctestnum = 0, loctesterr = 0; + cout << endl << "Begin of Vector/List Test:" << endl; + try { + lasd::Vector vec(3); + SetAt(loctestnum, loctesterr, vec, true, 0, -1); + SetAt(loctestnum, loctesterr, vec, true, 1, 0); + SetAt(loctestnum, loctesterr, vec, true, 2, 1); + + lasd::List lst; + InsertAtFront(loctestnum, loctesterr, lst, true, 1); + InsertAtFront(loctestnum, loctesterr, lst, true, 0); + InsertAtFront(loctestnum, loctesterr, lst, true, -1); + + lasd::Vector copvec(lst); + EqualVector(loctestnum, loctesterr, vec, copvec, true); + lasd::Vector copvecx(vec); + EqualVector(loctestnum, loctesterr, copvecx, copvec, true); + + lasd::List coplst(vec); + EqualList(loctestnum, loctesterr, lst, coplst, true); + lasd::List coplstx(lst); + EqualList(loctestnum, loctesterr, coplstx, coplst, true); + } catch(...) { + loctestnum++; loctesterr++; + cout << endl << "Unmanaged error! " << endl; + } + cout << "End of Vector/List Test! (Errors/Tests: " << loctesterr << "/" << loctestnum << ")" << endl; + testnum += loctestnum; + testerr += loctesterr; +} + +void stestVectorListDouble(uint& testnum, uint& testerr) { + uint loctestnum = 0, loctesterr = 0; + cout << endl << "Begin of Vector/List Test:" << endl; + try { + lasd::Vector vec(3); + SetAt(loctestnum, loctesterr, vec, true, 0, -0.5); + SetAt(loctestnum, loctesterr, vec, true, 1, 0.0); + SetAt(loctestnum, loctesterr, vec, true, 2, 0.5); + + lasd::List lst; + InsertAtBack(loctestnum, loctesterr, lst, true, -0.5); + InsertAtBack(loctestnum, loctesterr, lst, true, 0.0); + InsertAtBack(loctestnum, loctesterr, lst, true, 0.5); + + lasd::Vector copvec(lst); + EqualVector(loctestnum, loctesterr, vec, copvec, true); + lasd::Vector copvecx(vec); + EqualVector(loctestnum, loctesterr, copvecx, copvec, true); + + lasd::List coplst(vec); + EqualList(loctestnum, loctesterr, lst, coplst, true); + lasd::List coplstx(lst); + EqualList(loctestnum, loctesterr, coplstx, coplst, true); + } catch(...) { + loctestnum++; loctesterr++; + cout << endl << "Unmanaged error! " << endl; + } + cout << "End of Vector/List Test! (Errors/Tests: " << loctesterr << "/" << loctestnum << ")" << endl; + testnum += loctestnum; + testerr += loctesterr; +} + +void stestVectorListString(uint& testnum, uint& testerr) { + uint loctestnum = 0, loctesterr = 0; + cout << endl << "Begin of Vector/List Test:" << endl; + try { + lasd::Vector vec(3); + SetAt(loctestnum, loctesterr, vec, true, 0, string("A")); + SetAt(loctestnum, loctesterr, vec, true, 1, string("B")); + SetAt(loctestnum, loctesterr, vec, true, 2, string("C")); + + lasd::List lst; + InsertAtFront(loctestnum, loctesterr, lst, true, string("B")); + InsertAtBack(loctestnum, loctesterr, lst, true, string("C")); + InsertAtFront(loctestnum, loctesterr, lst, true, string("A")); + + lasd::Vector copvec(lst); + EqualVector(loctestnum, loctesterr, vec, copvec, true); + lasd::Vector copvecx(vec); + EqualVector(loctestnum, loctesterr, copvecx, copvec, true); + + lasd::List coplst(vec); + EqualList(loctestnum, loctesterr, lst, coplst, true); + lasd::List coplstx(lst); + EqualList(loctestnum, loctesterr, coplstx, coplst, true); + } catch(...) { + loctestnum++; loctesterr++; + cout << endl << "Unmanaged error! " << endl; + } + cout << "End of Vector/List Test! (Errors/Tests: " << loctesterr << "/" << loctestnum << ")" << endl; + testnum += loctestnum; + testerr += loctesterr; +} + +void stestVectorList(uint& testnum, uint& testerr) { + uint loctestnum = 0, loctesterr = 0; + stestVectorListInt(loctestnum, loctesterr); + stestVectorListDouble(loctestnum, loctesterr); + stestVectorListString(loctestnum, loctesterr); + testnum += loctestnum; + testerr += loctesterr; + cout << endl << "Exercise 1 - Vector/List (Errors/Tests: " << loctesterr << "/" << loctestnum << ")" << endl; +} + +/* ************************************************************************** */ + +void testSimpleExercise1() { + uint testnum = 0, testerr = 0; + stestVector(testnum, testerr); + stestList(testnum, testerr); + stestVectorList(testnum, testerr); + cout << endl << "Exercise 1 (Simple Test) (Errors/Tests: " << testerr << "/" << testnum << ")" << endl; +} diff --git a/librerie/exercise4/zlasdtest/exercise1/test.hpp b/librerie/exercise4/zlasdtest/exercise1/test.hpp new file mode 100644 index 0000000..c151dcf --- /dev/null +++ b/librerie/exercise4/zlasdtest/exercise1/test.hpp @@ -0,0 +1,13 @@ + +#ifndef EX1TEST_HPP +#define EX1TEST_HPP + +/* ************************************************************************** */ + +void testSimpleExercise1(); + +void testFullExercise1(); + +/* ************************************************************************** */ + +#endif diff --git a/librerie/exercise4/zlasdtest/exercise2/fulltest.cpp b/librerie/exercise4/zlasdtest/exercise2/fulltest.cpp new file mode 100644 index 0000000..5d00543 --- /dev/null +++ b/librerie/exercise4/zlasdtest/exercise2/fulltest.cpp @@ -0,0 +1,3 @@ + +void testFullExercise2() { +} diff --git a/librerie/exercise4/zlasdtest/exercise2/simpletest.cpp b/librerie/exercise4/zlasdtest/exercise2/simpletest.cpp new file mode 100644 index 0000000..beaa23f --- /dev/null +++ b/librerie/exercise4/zlasdtest/exercise2/simpletest.cpp @@ -0,0 +1,359 @@ + +#include + +/* ************************************************************************** */ + +#include "../container/container.hpp" + +#include "../stack/stack.hpp" +#include "../../stack/vec/stackvec.hpp" +#include "../../stack/lst/stacklst.hpp" + +#include "../queue/queue.hpp" +#include "../../queue/vec/queuevec.hpp" +#include "../../queue/lst/queuelst.hpp" + +/* ************************************************************************** */ + +using namespace std; + +/* ************************************************************************** */ + +template +void stestStackInt(Stk& stk, uint& testnum, uint& testerr) { + uint loctestnum = 0, loctesterr = 0; + try { + Empty(loctestnum, loctesterr, stk, true); + Size(loctestnum, loctesterr, stk, true, 0); + + Top(loctestnum, loctesterr, stk, false, 0); + TopNPop(loctestnum, loctesterr, stk, false, 0); + + PushC(loctestnum, loctesterr, stk, 4); + PushC(loctestnum, loctesterr, stk, 0); + PushC(loctestnum, loctesterr, stk, 3); + PushC(loctestnum, loctesterr, stk, 1); + PushC(loctestnum, loctesterr, stk, 2); + + Empty(loctestnum, loctesterr, stk, false); + Size(loctestnum, loctesterr, stk, true, 5); + + TopNPop(loctestnum, loctesterr, stk, true, 2); + Top(loctestnum, loctesterr, stk, true, 1); + + Stk copstk(stk); + EqualStack(loctestnum, loctesterr, stk, copstk, true); + PushC(loctestnum, loctesterr, stk, 5); + NonEqualStack(loctestnum, loctesterr, stk, copstk, true); + + copstk = stk; + EqualStack(loctestnum, loctesterr, stk, copstk, true); + PushC(loctestnum, loctesterr, copstk, 6); + NonEqualStack(loctestnum, loctesterr, stk, copstk, true); + + Top(loctestnum, loctesterr, copstk, true, 6); + copstk = move(stk); + TopNPop(loctestnum, loctesterr, copstk, true, 5); + Pop(loctestnum, loctesterr, copstk, true); + Top(loctestnum, loctesterr, copstk, true, 3); + + Stk movstk(move(stk)); + Top(loctestnum, loctesterr, stk, false, 0); + + movstk.Clear(); + Pop(loctestnum, loctesterr, movstk, false); + Empty(loctestnum, loctesterr, movstk, true); + Size(loctestnum, loctesterr, movstk, true, 0); + } catch(...) { + loctestnum++; loctesterr++; + cout << endl << "Unmanaged error! " << endl; + } + testnum += loctestnum; + testerr += loctesterr; + cout << "End of Stack Test! (Errors/Tests: " << loctesterr << "/" << loctestnum << ")" << endl; +} +void stestStackInt(uint& testnum, uint& testerr) { + uint loctestnum = 0, loctesterr = 0; + lasd::StackVec stkvec; + cout << endl << "Begin of StackVec Test:" << endl; + stestStackInt(stkvec, loctestnum, loctesterr); + lasd::StackLst stklst; + cout << endl << "Begin of StackLst Test:" << endl; + stestStackInt(stklst, loctestnum, loctesterr); + testnum += loctestnum; + testerr += loctesterr; +} + +template +void stestStackFloat(Stk& stk, uint& testnum, uint& testerr) { + uint loctestnum = 0, loctesterr = 0; + try { + PushC(loctestnum, loctesterr, stk, 5.9); + PushC(loctestnum, loctesterr, stk, 4.4); + PushC(loctestnum, loctesterr, stk, 9.5); + + Empty(loctestnum, loctesterr, stk, false); + Size(loctestnum, loctesterr, stk, true, 3); + + TopNPop(loctestnum, loctesterr, stk, true, 9.5); + Top(loctestnum, loctesterr, stk, true, 4.4); + Pop(loctestnum, loctesterr, stk, true); + TopNPop(loctestnum, loctesterr, stk, true, 5.9); + Pop(loctestnum, loctesterr, stk, false); + } catch(...) { + loctestnum++; loctesterr++; + cout << endl << "Unmanaged error! " << endl; + } + testnum += loctestnum; + testerr += loctesterr; + cout << "End of Stack Test! (Errors/Tests: " << loctesterr << "/" << loctestnum << ")" << endl; +} +void stestStackFloat(uint& testnum, uint& testerr) { + uint loctestnum = 0, loctesterr = 0; + lasd::StackVec stkvec; + cout << endl << "Begin of StackVec Test:" << endl; + stestStackFloat(stkvec, loctestnum, loctesterr); + lasd::StackLst stklst; + cout << endl << "Begin of StackLst Test:" << endl; + stestStackFloat(stklst, loctestnum, loctesterr); + testnum += loctestnum; + testerr += loctesterr; +} + +template +void stestStackString(Stk& stk, uint& testnum, uint& testerr) { + uint loctestnum = 0, loctesterr = 0; + try { + PushM(loctestnum, loctesterr, stk, string("A")); + PushM(loctestnum, loctesterr, stk, string("B")); + + Empty(loctestnum, loctesterr, stk, false); + Size(loctestnum, loctesterr, stk, true, 2); + + TopNPop(loctestnum, loctesterr, stk, true, string("B")); + Top(loctestnum, loctesterr, stk, true, string("A")); + Pop(loctestnum, loctesterr, stk, true); + Pop(loctestnum, loctesterr, stk, false); + } catch(...) { + loctestnum++; loctesterr++; + cout << endl << "Unmanaged error! " << endl; + } + testnum += loctestnum; + testerr += loctesterr; + cout << "End of Stack Test! (Errors/Tests: " << loctesterr << "/" << loctestnum << ")" << endl; +} +void stestStackString(uint& testnum, uint& testerr) { + uint loctestnum = 0, loctesterr = 0; + lasd::StackVec stkvec; + cout << endl << "Begin of StackVec Test:" << endl; + stestStackString(stkvec, loctestnum, loctesterr); + lasd::StackLst stklst; + cout << endl << "Begin of StackLst Test:" << endl; + stestStackString(stklst, loctestnum, loctesterr); + cout << endl; + try { + lasd::Vector vec(2); + SetAt(loctestnum, loctesterr, vec, true, 0, string("A")); + SetAt(loctestnum, loctesterr, vec, true, 1, string("B")); + + PushM(loctestnum, loctesterr, stkvec, string("A")); + PushM(loctestnum, loctesterr, stkvec, string("B")); + lasd::StackVec newstkvec(vec); + EqualStack(loctestnum, loctesterr, stkvec, newstkvec, true); + + PushM(loctestnum, loctesterr, stklst, string("B")); + PushM(loctestnum, loctesterr, stklst, string("A")); + lasd::StackLst newstklst(vec); + EqualStack(loctestnum, loctesterr, stklst, newstklst, true); + } catch(...) { + loctestnum++; loctesterr++; + cout << endl << "Unmanaged error! " << endl; + } + testnum += loctestnum; + testerr += loctesterr; +} + +void stestStack(uint& testnum, uint& testerr) { + uint loctestnum = 0, loctesterr = 0; + stestStackInt(loctestnum, loctesterr); + stestStackFloat(loctestnum, loctesterr); + stestStackString(loctestnum, loctesterr); + testnum += loctestnum; + testerr += loctesterr; + cout << endl << "Exercise 2 - Stack (Errors/Tests: " << loctesterr << "/" << loctestnum << ")" << endl; +} + +/* ************************************************************************** */ + +template +void stestQueueInt(Que& que, uint& testnum, uint& testerr) { + uint loctestnum = 0, loctesterr = 0; + try { + Empty(loctestnum, loctesterr, que, true); + Size(loctestnum, loctesterr, que, true, 0); + + Head(loctestnum, loctesterr, que, false, 0); + HeadNDequeue(loctestnum, loctesterr, que, false, 0); + + EnqueueC(loctestnum, loctesterr, que, 4); + EnqueueC(loctestnum, loctesterr, que, 0); + EnqueueC(loctestnum, loctesterr, que, 3); + EnqueueC(loctestnum, loctesterr, que, 1); + EnqueueC(loctestnum, loctesterr, que, 2); + + Empty(loctestnum, loctesterr, que, false); + Size(loctestnum, loctesterr, que, true, 5); + + HeadNDequeue(loctestnum, loctesterr, que, true, 4); + Head(loctestnum, loctesterr, que, true, 0); + + Que copque(que); + EqualQueue(loctestnum, loctesterr, que, copque, true); + EnqueueC(loctestnum, loctesterr, que, 5); + NonEqualQueue(loctestnum, loctesterr, que, copque, true); + + copque = que; + EqualQueue(loctestnum, loctesterr, que, copque, true); + EnqueueC(loctestnum, loctesterr, copque, 6); + NonEqualQueue(loctestnum, loctesterr, que, copque, true); + + Head(loctestnum, loctesterr, copque, true, 0); + copque = move(que); + HeadNDequeue(loctestnum, loctesterr, copque, true, 0); + Dequeue(loctestnum, loctesterr, copque, true); + Head(loctestnum, loctesterr, copque, true, 1); + + Que movque(move(que)); + Head(loctestnum, loctesterr, que, false, 0); + + movque.Clear(); + Dequeue(loctestnum, loctesterr, movque, false); + Empty(loctestnum, loctesterr, movque, true); + Size(loctestnum, loctesterr, movque, true, 0); + } catch(...) { + loctestnum++; loctesterr++; + cout << endl << "Unmanaged error! " << endl; + } + testnum += loctestnum; + testerr += loctesterr; + cout << "End of Queue Test! (Errors/Tests: " << loctesterr << "/" << loctestnum << ")" << endl; +} +void stestQueueInt(uint& testnum, uint& testerr) { + uint loctestnum = 0, loctesterr = 0; + lasd::QueueVec quevec; + cout << endl << "Begin of QueueVec Test:" << endl; + stestQueueInt(quevec, loctestnum, loctesterr); + lasd::QueueLst quelst; + cout << endl << "Begin of QueueLst Test:" << endl; + stestQueueInt(quelst, loctestnum, loctesterr); + testnum += loctestnum; + testerr += loctesterr; +} + +template +void stestQueueFloat(Que& que, uint& testnum, uint& testerr) { + uint loctestnum = 0, loctesterr = 0; + try { + EnqueueC(loctestnum, loctesterr, que, 5.9); + EnqueueC(loctestnum, loctesterr, que, 4.4); + EnqueueC(loctestnum, loctesterr, que, 9.5); + + Empty(loctestnum, loctesterr, que, false); + Size(loctestnum, loctesterr, que, true, 3); + + HeadNDequeue(loctestnum, loctesterr, que, true, 5.9); + Head(loctestnum, loctesterr, que, true, 4.4); + Dequeue(loctestnum, loctesterr, que, true); + HeadNDequeue(loctestnum, loctesterr, que, true, 9.5); + Dequeue(loctestnum, loctesterr, que, false); + } catch(...) { + loctestnum++; loctesterr++; + cout << endl << "Unmanaged error! " << endl; + } + testnum += loctestnum; + testerr += loctesterr; + cout << "End of Queue Test! (Errors/Tests: " << loctesterr << "/" << loctestnum << ")" << endl; +} +void stestQueueFloat(uint& testnum, uint& testerr) { + uint loctestnum = 0, loctesterr = 0; + lasd::QueueVec quevec; + cout << endl << "Begin of QueueVec Test:" << endl; + stestQueueFloat(quevec, loctestnum, loctesterr); + lasd::QueueLst quelst; + cout << endl << "Begin of QueueLst Test:" << endl; + stestQueueFloat(quelst, loctestnum, loctesterr); + testnum += loctestnum; + testerr += loctesterr; +} + +template +void stestQueueString(Que& que, uint& testnum, uint& testerr) { + uint loctestnum = 0, loctesterr = 0; + try { + EnqueueM(loctestnum, loctesterr, que, string("A")); + EnqueueM(loctestnum, loctesterr, que, string("B")); + + Empty(loctestnum, loctesterr, que, false); + Size(loctestnum, loctesterr, que, true, 2); + + HeadNDequeue(loctestnum, loctesterr, que, true, string("A")); + Head(loctestnum, loctesterr, que, true, string("B")); + Dequeue(loctestnum, loctesterr, que, true); + Dequeue(loctestnum, loctesterr, que, false); + } catch(...) { + loctestnum++; loctesterr++; + cout << endl << "Unmanaged error! " << endl; + } + testnum += loctestnum; + testerr += loctesterr; + cout << "End of Queue Test! (Errors/Tests: " << loctesterr << "/" << loctestnum << ")" << endl; +} +void stestQueueString(uint& testnum, uint& testerr) { + uint loctestnum = 0, loctesterr = 0; + lasd::QueueVec quevec; + cout << endl << "Begin of QueueVec Test:" << endl; + stestQueueString(quevec, loctestnum, loctesterr); + lasd::QueueLst quelst; + cout << endl << "Begin of QueueLst Test:" << endl; + stestQueueString(quelst, loctestnum, loctesterr); + cout << endl; + try { + lasd::Vector vec(2); + SetAt(loctestnum, loctesterr, vec, true, 0, string("A")); + SetAt(loctestnum, loctesterr, vec, true, 1, string("B")); + + EnqueueM(loctestnum, loctesterr, quevec, string("A")); + EnqueueM(loctestnum, loctesterr, quevec, string("B")); + lasd::QueueVec newquevec(vec); + EqualQueue(loctestnum, loctesterr, quevec, newquevec, true); + + EnqueueM(loctestnum, loctesterr, quelst, string("A")); + EnqueueM(loctestnum, loctesterr, quelst, string("B")); + lasd::QueueLst newquelst(vec); + EqualQueue(loctestnum, loctesterr, quelst, newquelst, true); + } catch(...) { + loctestnum++; loctesterr++; + cout << endl << "Unmanaged error! " << endl; + } + testnum += loctestnum; + testerr += loctesterr; +} + +void stestQueue(uint& testnum, uint& testerr) { + uint loctestnum = 0, loctesterr = 0; + stestQueueInt(loctestnum, loctesterr); + stestQueueFloat(loctestnum, loctesterr); + stestQueueString(loctestnum, loctesterr); + testnum += loctestnum; + testerr += loctesterr; + cout << endl << "Exercise 2 - Queue (Errors/Tests: " << loctesterr << "/" << loctestnum << ")" << endl; +} + +/* ************************************************************************** */ + +void testSimpleExercise2() { + uint testnum = 0, testerr = 0; + stestStack(testnum, testerr); + stestQueue(testnum, testerr); + cout << endl << "Exercise 2 (Simple Test) (Errors/Tests: " << testerr << "/" << testnum << ")" << endl; +} diff --git a/librerie/exercise4/zlasdtest/exercise2/test.hpp b/librerie/exercise4/zlasdtest/exercise2/test.hpp new file mode 100644 index 0000000..eb1a7f1 --- /dev/null +++ b/librerie/exercise4/zlasdtest/exercise2/test.hpp @@ -0,0 +1,13 @@ + +#ifndef EX2TEST_HPP +#define EX2TEST_HPP + +/* ************************************************************************** */ + +void testSimpleExercise2(); + +void testFullExercise2(); + +/* ************************************************************************** */ + +#endif diff --git a/librerie/exercise4/zlasdtest/exercise3/fulltest.cpp b/librerie/exercise4/zlasdtest/exercise3/fulltest.cpp new file mode 100644 index 0000000..e6a8813 --- /dev/null +++ b/librerie/exercise4/zlasdtest/exercise3/fulltest.cpp @@ -0,0 +1,3 @@ + +void testFullExercise3() { +} diff --git a/librerie/exercise4/zlasdtest/exercise3/simpletest.cpp b/librerie/exercise4/zlasdtest/exercise3/simpletest.cpp new file mode 100644 index 0000000..19aba76 --- /dev/null +++ b/librerie/exercise4/zlasdtest/exercise3/simpletest.cpp @@ -0,0 +1,234 @@ + +#include + +/* ************************************************************************** */ + +#include "../container/container.hpp" + +#include "../iterator/iterator.hpp" + +#include "../vector/vector.hpp" + +#include "../list/list.hpp" + +#include "../binarytree/binarytree.hpp" +#include "../../binarytree/lnk/binarytreelnk.hpp" +#include "../../binarytree/vec/binarytreevec.hpp" + +/* ************************************************************************** */ + +using namespace std; + +/* ************************************************************************** */ + +void stestBinaryTreeInt(lasd::BinaryTree& bt, uint& testnum, uint& testerr) { + uint loctestnum = 0, loctesterr = 0; + try { + MapPreOrder(loctestnum, loctesterr, bt, true, &MapPrint, 0); + FoldPreOrder(loctestnum, loctesterr, bt, true, &FoldAdd, 0, 0, 6); + FoldPostOrder(loctestnum, loctesterr, bt, true, &FoldAdd, 0, 0, 6); + FoldInOrder(loctestnum, loctesterr, bt, true, &FoldAdd, 0, 0, 6); + FoldBreadth(loctestnum, loctesterr, bt, true, &FoldAdd, 0, 0, 6); + } catch(...) { + loctestnum++; loctesterr++; + cout << endl << "Unmanaged error! " << endl; + } + cout << "End of BinaryTree Test! (Errors/Tests: " << loctesterr << "/" << loctestnum << ")" << endl; + testnum += loctestnum; + testerr += loctesterr; +} + +void stestBinaryTreeInt(uint& testnum, uint& testerr) { + uint loctestnum = 0, loctesterr = 0; + cout << endl << "Begin of BinaryTree Test" << endl; + try { + lasd::Vector vec(4); + SetAt(loctestnum, loctesterr, vec, true, 0, 0); + SetAt(loctestnum, loctesterr, vec, true, 1, 1); + SetAt(loctestnum, loctesterr, vec, true, 2, 2); + SetAt(loctestnum, loctesterr, vec, true, 3, 3); + + lasd::BinaryTreeVec btvec(vec); + cout << endl << "Begin of BinaryTreeVec Test:" << endl; + stestBinaryTreeInt(btvec, loctestnum, loctesterr); + lasd::BinaryTreeLnk btlnk(vec); + cout << endl << "Begin of BinaryTreeLnk Test:" << endl; + stestBinaryTreeInt(btlnk, loctestnum, loctesterr); + cout << "\n"; + + lasd::BinaryTreeVec copbtvec(btvec); + EqualBT(loctestnum, loctesterr, copbtvec, btvec); + btvec.Clear(); + btvec = move(copbtvec); + NonEqualBT(loctestnum, loctesterr, copbtvec, btvec); + Empty(loctestnum, loctesterr, copbtvec, true); + + lasd::BinaryTreeLnk copbtlnk(btlnk); + EqualBT(loctestnum, loctesterr, copbtlnk, btlnk); + btlnk.Clear(); + btlnk = move(copbtlnk); + NonEqualBT(loctestnum, loctesterr, copbtlnk, btlnk); + Empty(loctestnum, loctesterr, copbtlnk, true); + } catch(...) { + loctestnum++; loctesterr++; + cout << endl << "Unmanaged error! " << endl; + } + cout << "End of BinaryTree Test! (Errors/Tests: " << loctesterr << "/" << loctestnum << ")" << endl; + testnum += loctestnum; + testerr += loctesterr; +} + +void stestBinaryTreeFloat(lasd::BinaryTree& bt, uint& testnum, uint& testerr) { + uint loctestnum = 0, loctesterr = 0; + try { + lasd::BTPreOrderIterator itr1(bt); + GetItrValue(loctestnum, loctesterr, itr1, true, 1.2); + ++itr1; + GetItrValue(loctestnum, loctesterr, itr1, true, 0.3); + ++itr1; + GetItrValue(loctestnum, loctesterr, itr1, true, 2.1); + ++itr1; + GetItrValue(loctestnum, loctesterr, itr1, true, 3.0); + ++itr1; + Terminated(loctestnum, loctesterr, itr1, true); + + lasd::BTBreadthIterator itr2(bt); + GetItrValue(loctestnum, loctesterr, itr2, true, 1.2); + ++itr2; + GetItrValue(loctestnum, loctesterr, itr2, true, 0.3); + ++itr2; + GetItrValue(loctestnum, loctesterr, itr2, true, 3.0); + ++itr2; + GetItrValue(loctestnum, loctesterr, itr2, true, 2.1); + ++itr2; + Terminated(loctestnum, loctesterr, itr2, true); + + lasd::BTInOrderIterator itr3(bt); + GetItrValue(loctestnum, loctesterr, itr3, true, 2.1); + ++itr3; + GetItrValue(loctestnum, loctesterr, itr3, true, 0.3); + ++itr3; + GetItrValue(loctestnum, loctesterr, itr3, true, 1.2); + ++itr3; + GetItrValue(loctestnum, loctesterr, itr3, true, 3.0); + ++itr3; + Terminated(loctestnum, loctesterr, itr3, true); + + lasd::BTPostOrderIterator itr4(bt); + GetItrValue(loctestnum, loctesterr, itr4, true, 2.1); + ++itr4; + GetItrValue(loctestnum, loctesterr, itr4, true, 0.3); + ++itr4; + GetItrValue(loctestnum, loctesterr, itr4, true, 3.0); + ++itr4; + GetItrValue(loctestnum, loctesterr, itr4, true, 1.2); + ++itr4; + Terminated(loctestnum, loctesterr, itr4, true); + } catch(...) { + loctestnum++; loctesterr++; + cout << endl << "Unmanaged error! " << endl; + } + cout << "End of BinaryTree Test! (Errors/Tests: " << loctesterr << "/" << loctestnum << ")" << endl; + testnum += loctestnum; + testerr += loctesterr; +} + +void stestBinaryTreeFloat(uint& testnum, uint& testerr) { + uint loctestnum = 0, loctesterr = 0; + cout << endl << "Begin of BinaryTree Test" << endl; + try { + lasd::List lst; + InsertAtFront(loctestnum, loctesterr, lst, true, 0.3); + InsertAtBack(loctestnum, loctesterr, lst, true, 3.0); + InsertAtFront(loctestnum, loctesterr, lst, true, 1.2); + InsertAtBack(loctestnum, loctesterr, lst, true, 2.1); + + lasd::BinaryTreeVec btvec(lst); + cout << endl << "Begin of BinaryTreeVec Test:" << endl; + stestBinaryTreeFloat(btvec, loctestnum, loctesterr); + lasd::BinaryTreeLnk btlnk(lst); + cout << endl << "Begin of BinaryTreeLnk Test:" << endl; + stestBinaryTreeFloat(btlnk, loctestnum, loctesterr); + cout << "\n"; + + lasd::BinaryTreeVec copbtvec(move(btvec)); + Empty(loctestnum, loctesterr, btvec, true); + NonEqualBT(loctestnum, loctesterr, copbtvec, btvec); + btvec = copbtvec; + EqualBT(loctestnum, loctesterr, copbtvec, btvec); + + lasd::BinaryTreeLnk copbtlnk(move(btlnk)); + Empty(loctestnum, loctesterr, btlnk, true); + NonEqualBT(loctestnum, loctesterr, copbtlnk, btlnk); + btlnk = copbtlnk; + EqualBT(loctestnum, loctesterr, copbtlnk, btlnk); + } catch(...) { + loctestnum++; loctesterr++; + cout << endl << "Unmanaged error! " << endl; + } + cout << "End of BinaryTree Test! (Errors/Tests: " << loctesterr << "/" << loctestnum << ")" << endl; + testnum += loctestnum; + testerr += loctesterr; +} + +void stestBinaryTreeString(lasd::BinaryTree& bt, uint& testnum, uint& testerr) { + uint loctestnum = 0, loctesterr = 0; + try { + MapPreOrder(loctestnum, loctesterr, bt, true, &MapPrint, 0); + FoldPreOrder(loctestnum, loctesterr, bt, true, &FoldStringConcatenate, string(""), string("?"), string("?ABDC")); + FoldPostOrder(loctestnum, loctesterr, bt, true, &FoldStringConcatenate, string(""), string("?"), string("?DBCA")); + FoldInOrder(loctestnum, loctesterr, bt, true, &FoldStringConcatenate, string(""), string("?"), string("?DBAC")); + FoldBreadth(loctestnum, loctesterr, bt, true, &FoldStringConcatenate, string(""), string("?"), string("?ABCD")); + } catch(...) { + loctestnum++; loctesterr++; + cout << endl << "Unmanaged error! " << endl; + } + cout << "End of BinaryTree Test! (Errors/Tests: " << loctesterr << "/" << loctestnum << ")" << endl; + testnum += loctestnum; + testerr += loctesterr; +} + +void stestBinaryTreeString(uint& testnum, uint& testerr) { + uint loctestnum = 0, loctesterr = 0; + cout << endl << "Begin of BinaryTree Test" << endl; + try { + lasd::Vector vec(4); + SetAt(loctestnum, loctesterr, vec, true, 0, string("A")); + SetAt(loctestnum, loctesterr, vec, true, 1, string("B")); + SetAt(loctestnum, loctesterr, vec, true, 2, string("C")); + SetAt(loctestnum, loctesterr, vec, true, 3, string("D")); + + cout << endl << "Begin of BinaryTreeVec Test:" << endl; + lasd::BinaryTreeVec btvec(vec); + stestBinaryTreeString(btvec, loctestnum, loctesterr); + cout << endl << "Begin of BinaryTreeVec Test:" << endl; + lasd::BinaryTreeLnk btlnk(vec); + stestBinaryTreeString(btlnk, loctestnum, loctesterr); + cout << "\n"; + + EqualBT(loctestnum, loctesterr, btvec, btlnk); + btvec.Root().LeftChild().LeftChild().Element() = string("S"); + NonEqualBT(loctestnum, loctesterr, btlnk, btvec); + btlnk.Root().RightChild().Element() = string("X"); + NonEqualBT(loctestnum, loctesterr, btvec, btlnk); + btvec.Root().RightChild().Element() = string("X"); + btlnk.Root().LeftChild().LeftChild().Element() = string("S"); + EqualBT(loctestnum, loctesterr, btlnk, btvec); + } catch(...) { + loctestnum++; loctesterr++; + cout << endl << "Unmanaged error! " << endl; + } + cout << "End of BinaryTree Test! (Errors/Tests: " << loctesterr << "/" << loctestnum << ")" << endl; + testnum += loctestnum; + testerr += loctesterr; +} + +/* ************************************************************************** */ + +void testSimpleExercise3() { + uint testnum = 0, testerr = 0; + stestBinaryTreeInt(testnum, testerr); + stestBinaryTreeFloat(testnum, testerr); + stestBinaryTreeString(testnum, testerr); + cout << endl << "Exercise 3 (Simple Test) (Errors/Tests: " << testerr << "/" << testnum << ")" << endl; +} diff --git a/librerie/exercise4/zlasdtest/exercise3/test.hpp b/librerie/exercise4/zlasdtest/exercise3/test.hpp new file mode 100644 index 0000000..a7ad555 --- /dev/null +++ b/librerie/exercise4/zlasdtest/exercise3/test.hpp @@ -0,0 +1,13 @@ + +#ifndef EX3TEST_HPP +#define EX3TEST_HPP + +/* ************************************************************************** */ + +void testSimpleExercise3(); + +void testFullExercise3(); + +/* ************************************************************************** */ + +#endif diff --git a/librerie/exercise4/zlasdtest/exercise4/fulltest.cpp b/librerie/exercise4/zlasdtest/exercise4/fulltest.cpp new file mode 100644 index 0000000..4f7a730 --- /dev/null +++ b/librerie/exercise4/zlasdtest/exercise4/fulltest.cpp @@ -0,0 +1,3 @@ + +void testFullExercise4() { +} diff --git a/librerie/exercise4/zlasdtest/exercise4/simpletest.cpp b/librerie/exercise4/zlasdtest/exercise4/simpletest.cpp new file mode 100644 index 0000000..ca03850 --- /dev/null +++ b/librerie/exercise4/zlasdtest/exercise4/simpletest.cpp @@ -0,0 +1,323 @@ + +#include + +/* ************************************************************************** */ + +#include "../container/container.hpp" + +#include "../iterator/iterator.hpp" + +#include "../vector/vector.hpp" + +#include "../list/list.hpp" + +#include "../binarytree/binarytree.hpp" + +#include "../bst/bst.hpp" + +/* ************************************************************************** */ + +using namespace std; + +/* ************************************************************************** */ + +void stestBSTInt(uint& testnum, uint& testerr) { + uint loctestnum = 0, loctesterr = 0; + cout << endl << "Begin of BST Test" << endl; + try { + lasd::BST bst; + + Empty(loctestnum, loctesterr, bst, true); + Size(loctestnum, loctesterr, bst, true, 0); + + Min(loctestnum, loctesterr, bst, false, 0); + Max(loctestnum, loctesterr, bst, false, 0); + + InsertC(loctestnum, loctesterr, bst, 3); + InsertC(loctestnum, loctesterr, bst, 1); + InsertC(loctestnum, loctesterr, bst, 4); + InsertC(loctestnum, loctesterr, bst, 5); + InsertC(loctestnum, loctesterr, bst, 0); + InsertC(loctestnum, loctesterr, bst, 2); + + Empty(loctestnum, loctesterr, bst, false); + Size(loctestnum, loctesterr, bst, true, 6); + + MapInOrder(loctestnum, loctesterr, bst, true, &MapPrint, 0); + + Min(loctestnum, loctesterr, bst, true, 0); + Max(loctestnum, loctesterr, bst, true, 5); + + Root(loctestnum, loctesterr, bst, true, 3); + + RemoveMin(loctestnum, loctesterr, bst, true); + MinNRemove(loctestnum, loctesterr, bst, true, 1); + + InsertC(loctestnum, loctesterr, bst, -1); + InsertC(loctestnum, loctesterr, bst, 1); + + Min(loctestnum, loctesterr, bst, true, -1); + MaxNRemove(loctestnum, loctesterr, bst, true, 5); + Size(loctestnum, loctesterr, bst, true, 5); + + InsertC(loctestnum, loctesterr, bst, 6); + + Size(loctestnum, loctesterr, bst, true, 6); + + Max(loctestnum, loctesterr, bst, true, 6); + + InsertC(loctestnum, loctesterr, bst, 7); + + Size(loctestnum, loctesterr, bst, true, 7); + + Exists(loctestnum, loctesterr, bst, true, 6); + Exists(loctestnum, loctesterr, bst, false, 8); + Exists(loctestnum, loctesterr, bst, false, 0); + Exists(loctestnum, loctesterr, bst, true, -1); + Exists(loctestnum, loctesterr, bst, true, 2); + + Remove(loctestnum, loctesterr, bst, 5); + Remove(loctestnum, loctesterr, bst, 2); + + Exists(loctestnum, loctesterr, bst, false, 5); + Exists(loctestnum, loctesterr, bst, false, 2); + + RemoveMax(loctestnum, loctesterr, bst, true); + Max(loctestnum, loctesterr, bst, true, 6); + + MapInOrder(loctestnum, loctesterr, bst, true, &MapPrint, 0); + + Predecessor(loctestnum, loctesterr, bst, true, 4, 3); + Predecessor(loctestnum, loctesterr, bst, true, 5, 4); + + Successor(loctestnum, loctesterr, bst, true, 2, 3); + Successor(loctestnum, loctesterr, bst, true, 4, 6); + + PredecessorNRemove(loctestnum, loctesterr, bst, true, 7, 6); + SuccessorNRemove(loctestnum, loctesterr, bst, true, 0, 1); + + FoldPreOrder(loctestnum, loctesterr, bst, true, &FoldAdd, 0, 0, 6); + FoldInOrder(loctestnum, loctesterr, bst, true, &FoldAdd, 0, 0, 6); + FoldPostOrder(loctestnum, loctesterr, bst, true, &FoldAdd, 0, 0, 6); + FoldBreadth(loctestnum, loctesterr, bst, true, &FoldAdd, 0, 0, 6); + + lasd::BST bst1(bst); + + EqualBST(loctestnum, loctesterr, bst, bst1); + + Remove(loctestnum, loctesterr, bst1, 4); + + NonEqualBST(loctestnum, loctesterr, bst, bst1); + + InsertC(loctestnum, loctesterr, bst1, 4); + + EqualBST(loctestnum, loctesterr, bst, bst1); + + lasd::BST bst2 = bst1; + + EqualBST(loctestnum, loctesterr, bst1, bst2); + + RemovePredecessor(loctestnum, loctesterr, bst1, true, 9); + + NonEqualBST(loctestnum, loctesterr, bst1, bst2); + + lasd::BST bst3(std::move(bst2)); + + Empty(loctestnum, loctesterr, bst2, true); + Size(loctestnum, loctesterr, bst2, true, 0); + + Empty(loctestnum, loctesterr, bst3, false); + Size(loctestnum, loctesterr, bst3, true, 3); + + bst2 = std::move(bst1); + + Empty(loctestnum, loctesterr, bst1, true); + Size(loctestnum, loctesterr, bst1, true, 0); + + Empty(loctestnum, loctesterr, bst2, false); + Size(loctestnum, loctesterr, bst2, true, 2); + + NonEqualBST(loctestnum, loctesterr, bst3, bst2); + + MapInOrder(loctestnum, loctesterr, bst2, true, &MapPrint, 0); + MapInOrder(loctestnum, loctesterr, bst3, true, &MapPrint, 0); + + InsertC(loctestnum, loctesterr, bst2, 4); + + EqualBST(loctestnum, loctesterr, bst3, bst2); + + bst.Clear(); + + Empty(loctestnum, loctesterr, bst, true); + Size(loctestnum, loctesterr, bst, true, 0); + } catch(...) { + loctestnum++; loctesterr++; + cout << endl << "Unmanaged error! " << endl; + } + cout << "End of BST Test! (Errors/Tests: " << loctesterr << "/" << loctestnum << ")" << endl; + testnum += loctestnum; + testerr += loctesterr; +} + +void stestBSTFloat(uint& testnum, uint& testerr) { + uint loctestnum = 0, loctesterr = 0; + cout << endl << "Begin of BST Test" << endl; + try { + lasd::List lst; + InsertAtFront(loctestnum, loctesterr, lst, true, 4.0); + InsertAtBack(loctestnum, loctesterr, lst, true, 0.4); + InsertAtFront(loctestnum, loctesterr, lst, true, 1.2); + InsertAtBack(loctestnum, loctesterr, lst, true, 2.1); + InsertAtFront(loctestnum, loctesterr, lst, true, 3.5); + InsertAtBack(loctestnum, loctesterr, lst, true, 5.3); + + MapPreOrder(loctestnum, loctesterr, lst, true, &MapPrint, 0); + + lasd::BST bst1(lst); + + Empty(loctestnum, loctesterr, bst1, false); + Size(loctestnum, loctesterr, bst1, true, 6); + + MapPreOrder(loctestnum, loctesterr, bst1, true, &MapPrint, 0); + MapInOrder(loctestnum, loctesterr, bst1, true, &MapPrint, 0); + MapPostOrder(loctestnum, loctesterr, bst1, true, &MapPrint, 0); + MapBreadth(loctestnum, loctesterr, bst1, true, &MapPrint, 0); + + Root(loctestnum, loctesterr, bst1, true, 3.5); + + lasd::BST bst2; + + InsertC(loctestnum, loctesterr, bst2, 2.1); + InsertC(loctestnum, loctesterr, bst2, 0.4); + InsertC(loctestnum, loctesterr, bst2, 1.2); + InsertC(loctestnum, loctesterr, bst2, 3.5); + InsertC(loctestnum, loctesterr, bst2, 5.3); + InsertC(loctestnum, loctesterr, bst2, 4.0); + + Root(loctestnum, loctesterr, bst2, true, 2.1); + + EqualBST(loctestnum, loctesterr, bst1, bst2); + NonEqualBT(loctestnum, loctesterr, bst1, bst2); + + bst1.Clear(); + bst2.Clear(); + + InsertC(loctestnum, loctesterr, bst1, 0.2); + InsertC(loctestnum, loctesterr, bst1, 1.1); + InsertC(loctestnum, loctesterr, bst1, 2.1); + + InsertC(loctestnum, loctesterr, bst2, 2.1); + InsertC(loctestnum, loctesterr, bst2, 1.1); + InsertC(loctestnum, loctesterr, bst2, 0.2); + + EqualBST(loctestnum, loctesterr, bst1, bst2); + NonEqualBT(loctestnum, loctesterr, bst1, bst2); + } catch(...) { + loctestnum++; loctesterr++; + cout << endl << "Unmanaged error! " << endl; + } + cout << "End of BST Test! (Errors/Tests: " << loctesterr << "/" << loctestnum << ")" << endl; + testnum += loctestnum; + testerr += loctesterr; +} + +void stestBSTString(uint& testnum, uint& testerr) { + uint loctestnum = 0, loctesterr = 0; + cout << endl << "Begin of BST Test" << endl; + try { + lasd::Vector vec(5); + SetAt(loctestnum, loctesterr, vec, true, 0, string("B")); + SetAt(loctestnum, loctesterr, vec, true, 1, string("A")); + SetAt(loctestnum, loctesterr, vec, true, 2, string("C")); + SetAt(loctestnum, loctesterr, vec, true, 3, string("D")); + SetAt(loctestnum, loctesterr, vec, true, 4, string("E")); + + lasd::BST bst(vec); + Size(loctestnum, loctesterr, bst, true, 5); + + MapPreOrder(loctestnum, loctesterr, bst, true, &MapPrint, 0); + + lasd::BTPreOrderIterator itr1(bst); + GetItrValue(loctestnum, loctesterr, itr1, true, string("B")); + ++itr1; + GetItrValue(loctestnum, loctesterr, itr1, true, string("A")); + ++itr1; + GetItrValue(loctestnum, loctesterr, itr1, true, string("C")); + ++itr1; + GetItrValue(loctestnum, loctesterr, itr1, true, string("D")); + ++itr1; + GetItrValue(loctestnum, loctesterr, itr1, true, string("E")); + Terminated(loctestnum, loctesterr, itr1, false); + ++itr1; + Terminated(loctestnum, loctesterr, itr1, true); + + MapPostOrder(loctestnum, loctesterr, bst, true, &MapPrint, 0); + + lasd::BTPostOrderIterator itr2(bst); + GetItrValue(loctestnum, loctesterr, itr2, true, string("A")); + ++itr2; + GetItrValue(loctestnum, loctesterr, itr2, true, string("E")); + ++itr2; + GetItrValue(loctestnum, loctesterr, itr2, true, string("D")); + ++itr2; + GetItrValue(loctestnum, loctesterr, itr2, true, string("C")); + ++itr2; + GetItrValue(loctestnum, loctesterr, itr2, true, string("B")); + Terminated(loctestnum, loctesterr, itr2, false); + ++itr2; + Terminated(loctestnum, loctesterr, itr2, true); + + MapBreadth(loctestnum, loctesterr, bst, true, &MapPrint, 0); + + lasd::BTBreadthIterator itr3(bst); + GetItrValue(loctestnum, loctesterr, itr3, true, string("B")); + ++itr3; + GetItrValue(loctestnum, loctesterr, itr3, true, string("A")); + ++itr3; + GetItrValue(loctestnum, loctesterr, itr3, true, string("C")); + ++itr3; + GetItrValue(loctestnum, loctesterr, itr3, true, string("D")); + ++itr3; + GetItrValue(loctestnum, loctesterr, itr3, true, string("E")); + Terminated(loctestnum, loctesterr, itr3, false); + ++itr3; + Terminated(loctestnum, loctesterr, itr3, true); + + MapInOrder(loctestnum, loctesterr, bst, true, &MapPrint, 0); + + lasd::BTInOrderIterator itr4(bst); + GetItrValue(loctestnum, loctesterr, itr4, true, string("A")); + ++itr4; + GetItrValue(loctestnum, loctesterr, itr4, true, string("B")); + ++itr4; + GetItrValue(loctestnum, loctesterr, itr4, true, string("C")); + ++itr4; + GetItrValue(loctestnum, loctesterr, itr4, true, string("D")); + ++itr4; + GetItrValue(loctestnum, loctesterr, itr4, true, string("E")); + Terminated(loctestnum, loctesterr, itr4, false); + ++itr4; + Terminated(loctestnum, loctesterr, itr4, true); + + FoldPreOrder(loctestnum, loctesterr, bst, true, &FoldStringConcatenate, string(""), string("?"), string("?BACDE")); + FoldPostOrder(loctestnum, loctesterr, bst, true, &FoldStringConcatenate, string(""), string("?"), string("?AEDCB")); + FoldBreadth(loctestnum, loctesterr, bst, true, &FoldStringConcatenate, string(""), string("?"), string("?BACDE")); + FoldInOrder(loctestnum, loctesterr, bst, true, &FoldStringConcatenate, string(""), string("?"), string("?ABCDE")); + } catch(...) { + loctestnum++; loctesterr++; + cout << endl << "Unmanaged error! " << endl; + } + cout << "End of BST Test! (Errors/Tests: " << loctesterr << "/" << loctestnum << ")" << endl; + testnum += loctestnum; + testerr += loctesterr; +} + +/* ************************************************************************** */ + +void testSimpleExercise4() { + uint testnum = 0, testerr = 0; + stestBSTInt(testnum, testerr); + stestBSTFloat(testnum, testerr); + stestBSTString(testnum, testerr); + cout << endl << "Exercise 4 (Simple Test) (Errors/Tests: " << testerr << "/" << testnum << ")" << endl; +} diff --git a/librerie/exercise4/zlasdtest/exercise4/test.hpp b/librerie/exercise4/zlasdtest/exercise4/test.hpp new file mode 100644 index 0000000..59bcf58 --- /dev/null +++ b/librerie/exercise4/zlasdtest/exercise4/test.hpp @@ -0,0 +1,13 @@ + +#ifndef EX4TEST_HPP +#define EX4TEST_HPP + +/* ************************************************************************** */ + +void testSimpleExercise4(); + +void testFullExercise4(); + +/* ************************************************************************** */ + +#endif diff --git a/librerie/exercise4/zlasdtest/iterator/iterator.hpp b/librerie/exercise4/zlasdtest/iterator/iterator.hpp new file mode 100644 index 0000000..7992f7c --- /dev/null +++ b/librerie/exercise4/zlasdtest/iterator/iterator.hpp @@ -0,0 +1,58 @@ + +#ifndef ITERATORTEST_HPP +#define ITERATORTEST_HPP + +#include "../../iterator/iterator.hpp" + +/* ************************************************************************** */ + +template +void GetItrValue(uint& testnum, uint& testerr, const lasd::Iterator& itr, bool chk, const Data& val) { + bool tst; + testnum++; + try { + std::cout << " " << testnum << " (" << testerr << ") The value pointed by the iterator is \"" << *itr << "\": "; + std::cout << ((tst = ((*itr == val) == chk)) ? "Correct" : "Error") << "!" << std::endl; + } catch(std::out_of_range exc) { + std::cout << exc.what() << "\": " << ((tst = !chk) ? "Correct" : "Error") << "!" << std::endl; + } catch(std::exception exc) { + tst = false; + std::cout << std::endl << "Wrong exception: " << exc.what() << "!" << std::endl; + } + testerr += (1 - (uint) tst); +} + +template +void SetItrValue(uint& testnum, uint& testerr, const lasd::Iterator& itr, bool chk, const Data& val) { + bool tst; + testnum++; + try { + std::cout << " " << testnum << " (" << testerr << ") Setting the value pointed by the iterator to \"" << val << "\": "; + *itr = val; + std::cout << ((tst = ((*itr == val) == chk)) ? "Correct" : "Error") << "!" << std::endl; + } catch(std::out_of_range exc) { + std::cout << exc.what() << "\": " << ((tst = !chk) ? "Correct" : "Error") << "!" << std::endl; + } catch(std::exception exc) { + tst = false; + std::cout << std::endl << "Wrong exception: " << exc.what() << "!" << std::endl; + } + testerr += (1 - (uint) tst); +} + +template +void Terminated(uint& testnum, uint& testerr, const lasd::Iterator& itr, bool chk) { + bool tst; + testnum++; + try { + std::cout << " " << testnum << " (" << testerr << ") The iterator is " << ((tst = itr.Terminated()) ? "" : "not ") << "terminated: "; + std::cout << ((tst = (tst == chk)) ? "Correct" : "Error") << "!" << std::endl; + } catch(std::exception exc) { + tst = false; + std::cout << "\"" << exc.what() << "\": " << "Error!" << std::endl; + } + testerr += (1 - (uint) tst); +} + +/* ************************************************************************** */ + +#endif diff --git a/librerie/exercise4/zlasdtest/list/list.hpp b/librerie/exercise4/zlasdtest/list/list.hpp new file mode 100644 index 0000000..90d7ac1 --- /dev/null +++ b/librerie/exercise4/zlasdtest/list/list.hpp @@ -0,0 +1,98 @@ + +#ifndef LISTTEST_HPP +#define LISTTEST_HPP + +#include "../../list/list.hpp" + +/* ************************************************************************** */ + +template +void InsertAtFront(uint& testnum, uint& testerr, lasd::List& lst, bool chk, const Data& val) { + bool tst; + testnum++; + try { + std::cout << " " << testnum << " (" << testerr << ") Insert at the front of the list the value \"" << val << "\": "; + lst.InsertAtFront(val); + std::cout << ((tst = chk) ? "Correct" : "Error") << "!" << std::endl; + } catch(std::exception exc) { + std::cout << "\"" << exc.what() << "\": " << ((tst = !chk) ? "Correct" : "Error") << "!" << std::endl; + } + testerr += (1 - (uint) tst); +} + +template +void RemoveFromFront(uint& testnum, uint& testerr, lasd::List& lst, bool chk) { + bool tst; + testnum++; + try { + std::cout << " " << testnum << " (" << testerr << ") Remove from the list of \"" << lst.Front() << "\": "; + lst.RemoveFromFront(); + std::cout << ((tst = chk) ? "Correct" : "Error") << "!" << std::endl; + } catch(std::length_error exc) { + std::cout << exc.what() << "\": " << ((tst = !chk) ? "Correct" : "Error") << "!" << std::endl; + } catch(std::exception exc) { + tst = false; + std::cout << std::endl << "Wrong exception: " << exc.what() << "!" << std::endl; + } + testerr += (1 - (uint) tst); +} + +template +void FrontNRemove(uint& testnum, uint& testerr, lasd::List& lst, bool chk, const Data& val) { + bool tst; + testnum++; + try { + std::cout << " " << testnum << " (" << testerr << ") FrontNRemove from the list of \"" << lst.Front() << "\": "; + std::cout << ((tst = ((lst.FrontNRemove() == val) == chk)) ? "Correct" : "Error") << "!" << std::endl; + } catch(std::length_error exc) { + std::cout << exc.what() << "\": " << ((tst = !chk) ? "Correct" : "Error") << "!" << std::endl; + } catch(std::exception exc) { + tst = false; + std::cout << std::endl << "Wrong exception: " << exc.what() << "!" << std::endl; + } + testerr += (1 - (uint) tst); +} + +template +void InsertAtBack(uint& testnum, uint& testerr, lasd::List& lst, bool chk, const Data& val) { + bool tst; + testnum++; + try { + std::cout << " " << testnum << " (" << testerr << ") Insert at the back of the list the value \"" << val << "\": "; + lst.InsertAtBack(val); + std::cout << ((tst = chk) ? "Correct" : "Error") << "!" << std::endl; + } catch(std::exception exc) { + std::cout << "\"" << exc.what() << "\": " << ((tst = !chk) ? "Correct" : "Error") << "!" << std::endl; + } + testerr += (1 - (uint) tst); +} + +template +void EqualList(uint& testnum, uint& testerr, const lasd::List& lst1, const lasd::List& lst2, bool chk) { + bool tst; + testnum++; + try { + std::cout << " " << testnum << " (" << testerr << ") The two lists are " << ((tst = (lst1 == lst2)) ? "" : "not ") << "equal: "; + std::cout << ((tst = (tst == chk)) ? "Correct" : "Error") << "!" << std::endl; + } catch(std::exception exc) { + std::cout << "\"" << exc.what() << "\": " << ((tst = !chk) ? "Correct" : "Error") << "!" << std::endl; + } + testerr += (1 - (uint) tst); +} + +template +void NonEqualList(uint& testnum, uint& testerr, const lasd::List& lst1, const lasd::List& lst2, bool chk) { + bool tst; + testnum++; + try { + std::cout << " " << testnum << " (" << testerr << ") The two lists are " << ((tst = (lst1 != lst2)) ? "not " : "") << "equal: "; + std::cout << ((tst = (tst == chk)) ? "Correct" : "Error") << "!" << std::endl; + } catch(std::exception exc) { + std::cout << "\"" << exc.what() << "\": " << ((tst = !chk) ? "Correct" : "Error") << "!" << std::endl; + } + testerr += (1 - (uint) tst); +} + +/* ************************************************************************** */ + +#endif diff --git a/librerie/exercise4/zlasdtest/queue/queue.hpp b/librerie/exercise4/zlasdtest/queue/queue.hpp new file mode 100644 index 0000000..7090004 --- /dev/null +++ b/librerie/exercise4/zlasdtest/queue/queue.hpp @@ -0,0 +1,116 @@ + +#ifndef QUEUETEST_HPP +#define QUEUETEST_HPP + +#include "../../queue/queue.hpp" + +/* ************************************************************************** */ + +template +void EnqueueC(uint& testnum, uint& testerr, lasd::Queue& que, const Data& val) { + testnum++; + bool tst = true; + try { + std::cout << " " << testnum << " (" << testerr << ") Enqueue on the queue of the value \"" << val << "\": "; + que.Enqueue(val); + std::cout << "Correct!" << std::endl; + } catch(std::exception exc) { + std::cout << "\"" << exc.what() << "\": " << "Error!" << std::endl; + tst = false; + } + testerr += (1 - (uint) tst); +} + +template +void EnqueueM(uint& testnum, uint& testerr, lasd::Queue& que, Data val) { + testnum++; + bool tst = true; + try { + std::cout << " " << testnum << " (" << testerr << ") Enqueue on the queue of the value \"" << val << "\": "; + que.Enqueue(std::move(val)); + std::cout << "Correct!" << std::endl; + } catch(std::exception exc) { + std::cout << "\"" << exc.what() << "\": " << "Error!" << std::endl; + tst = false; + } + testerr += (1 - (uint) tst); +} + +template +void Head(uint& testnum, uint& testerr, lasd::Queue& que, bool chk, const Data& val) { + testnum++; + bool tst; + try { + std::cout << " " << testnum << " (" << testerr << ") Head of the queue with value \"" << que.Head() << "\": "; + std::cout << ((tst = ((que.Head() == val) == chk)) ? "Correct" : "Error") << "!" << std::endl; + } catch(std::length_error exc) { + std::cout << exc.what() << "\": " << ((tst = !chk) ? "Correct" : "Error") << "!" << std::endl; + } catch(std::exception exc) { + tst = false; + std::cout << std::endl << "Wrong exception: " << exc.what() << "!" << std::endl; + } + testerr += (1 - (uint) tst); +} + +template +void Dequeue(uint& testnum, uint& testerr, lasd::Queue& que, bool chk) { + testnum++; + bool tst = true; + try { + std::cout << " " << testnum << " (" << testerr << ") Dequeue from the queue: "; + que.Dequeue(); + std::cout << ((tst = chk) ? "Correct" : "Error") << "!" << std::endl; + } catch(std::length_error exc) { + std::cout << "\"" << exc.what() << "\": " << ((tst = !chk) ? "Correct" : "Error") << "!" << std::endl; + } catch(std::exception exc) { + tst = false; + std::cout << std::endl << "Wrong exception: " << exc.what() << "!" << std::endl; + } + testerr += (1 - (uint) tst); +} + +template +void HeadNDequeue(uint& testnum, uint& testerr, lasd::Queue& que, bool chk, const Data& val) { + testnum++; + bool tst; + try { + std::cout << " " << testnum << " (" << testerr << ") HeadNDequeue from the queue with value \"" << que.Head() << "\": "; + std::cout << ((tst = ((que.HeadNDequeue() == val) == chk)) ? "Correct" : "Error") << "!" << std::endl; + } catch(std::length_error exc) { + std::cout << exc.what() << "\": " << ((tst = !chk) ? "Correct" : "Error") << "!" << std::endl; + } catch(std::exception exc) { + tst = false; + std::cout << std::endl << "Wrong exception: " << exc.what() << "!" << std::endl; + } + testerr += (1 - (uint) tst); +} + +template +void EqualQueue(uint& testnum, uint& testerr, const Que& que1, const Que& que2, bool chk) { + testnum++; + bool tst; + try { + std::cout << " " << testnum << " (" << testerr << ") The two queues are " << ((tst = (que1 == que2)) ? "" : "not ") << "equal: "; + std::cout << ((tst = (tst == chk)) ? "Correct" : "Error") << "!" << std::endl; + } catch(std::exception exc) { + std::cout << "\"" << exc.what() << "\": " << ((tst = !chk) ? "Correct" : "Error") << "!" << std::endl; + } + testerr += (1 - (uint) tst); +} + +template +void NonEqualQueue(uint& testnum, uint& testerr, const Que& que1, const Que& que2, bool chk) { + testnum++; + bool tst; + try { + std::cout << " " << testnum << " (" << testerr << ") The two queues are " << ((tst = (que1 != que2)) ? "not " : "") << "equal: "; + std::cout << ((tst = (tst == chk)) ? "Correct" : "Error") << "!" << std::endl; + } catch(std::exception exc) { + std::cout << "\"" << exc.what() << "\": " << ((tst = !chk) ? "Correct" : "Error") << "!" << std::endl; + } + testerr += (1 - (uint) tst); +} + +/* ************************************************************************** */ + +#endif diff --git a/librerie/exercise4/zlasdtest/stack/stack.hpp b/librerie/exercise4/zlasdtest/stack/stack.hpp new file mode 100644 index 0000000..7463045 --- /dev/null +++ b/librerie/exercise4/zlasdtest/stack/stack.hpp @@ -0,0 +1,116 @@ + +#ifndef STACKTEST_HPP +#define STACKTEST_HPP + +#include "../../stack/stack.hpp" + +/* ************************************************************************** */ + +template +void PushC(uint& testnum, uint& testerr, lasd::Stack& stk, const Data& val) { + testnum++; + bool tst = true; + try { + std::cout << " " << testnum << " (" << testerr << ") Push on the stack of the value \"" << val << "\": "; + stk.Push(val); + std::cout << "Correct!" << std::endl; + } catch(std::exception exc) { + std::cout << "\"" << exc.what() << "\": " << "Error!" << std::endl; + tst = false; + } + testerr += (1 - (uint) tst); +} + +template +void PushM(uint& testnum, uint& testerr, lasd::Stack& stk, Data val) { + testnum++; + bool tst = true; + try { + std::cout << " " << testnum << " (" << testerr << ") Push on the stack of the value \"" << val << "\": "; + stk.Push(std::move(val)); + std::cout << "Correct!" << std::endl; + } catch(std::exception exc) { + std::cout << "\"" << exc.what() << "\": " << "Error!" << std::endl; + tst = false; + } + testerr += (1 - (uint) tst); +} + +template +void Top(uint& testnum, uint& testerr, lasd::Stack& stk, bool chk, const Data& val) { + testnum++; + bool tst; + try { + std::cout << " " << testnum << " (" << testerr << ") Top of the stack with value \"" << stk.Top() << "\": "; + std::cout << ((tst = ((stk.Top() == val) == chk)) ? "Correct" : "Error") << "!" << std::endl; + } catch(std::length_error exc) { + std::cout << exc.what() << "\": " << ((tst = !chk) ? "Correct" : "Error") << "!" << std::endl; + } catch(std::exception exc) { + tst = false; + std::cout << std::endl << "Wrong exception: " << exc.what() << "!" << std::endl; + } + testerr += (1 - (uint) tst); +} + +template +void Pop(uint& testnum, uint& testerr, lasd::Stack& stk, bool chk) { + testnum++; + bool tst = true; + try { + std::cout << " " << testnum << " (" << testerr << ") Pop from the stack: "; + stk.Pop(); + std::cout << ((tst = chk) ? "Correct" : "Error") << "!" << std::endl; + } catch(std::length_error exc) { + std::cout << "\"" << exc.what() << "\": " << ((tst = !chk) ? "Correct" : "Error") << "!" << std::endl; + } catch(std::exception exc) { + tst = false; + std::cout << std::endl << "Wrong exception: " << exc.what() << "!" << std::endl; + } + testerr += (1 - (uint) tst); +} + +template +void TopNPop(uint& testnum, uint& testerr, lasd::Stack& stk, bool chk, const Data& val) { + testnum++; + bool tst; + try { + std::cout << " " << testnum << " (" << testerr << ") TopNPop from the stack with value \"" << stk.Top() << "\": "; + std::cout << ((tst = ((stk.TopNPop() == val) == chk)) ? "Correct" : "Error") << "!" << std::endl; + } catch(std::length_error exc) { + std::cout << exc.what() << "\": " << ((tst = !chk) ? "Correct" : "Error") << "!" << std::endl; + } catch(std::exception exc) { + tst = false; + std::cout << std::endl << "Wrong exception: " << exc.what() << "!" << std::endl; + } + testerr += (1 - (uint) tst); +} + +template +void EqualStack(uint& testnum, uint& testerr, const Stk& stk1, const Stk& stk2, bool chk) { + testnum++; + bool tst; + try { + std::cout << " " << testnum << " (" << testerr << ") The two stacks are " << ((tst = (stk1 == stk2)) ? "" : "not ") << "equal: "; + std::cout << ((tst = (tst == chk)) ? "Correct" : "Error") << "!" << std::endl; + } catch(std::exception exc) { + std::cout << "\"" << exc.what() << "\": " << ((tst = !chk) ? "Correct" : "Error") << "!" << std::endl; + } + testerr += (1 - (uint) tst); +} + +template +void NonEqualStack(uint& testnum, uint& testerr, const Stk& stk1, const Stk& stk2, bool chk) { + testnum++; + bool tst; + try { + std::cout << " " << testnum << " (" << testerr << ") The two stacks are " << ((tst = (stk1 != stk2)) ? "not " : "") << "equal: "; + std::cout << ((tst = (tst == chk)) ? "Correct" : "Error") << "!" << std::endl; + } catch(std::exception exc) { + std::cout << "\"" << exc.what() << "\": " << ((tst = !chk) ? "Correct" : "Error") << "!" << std::endl; + } + testerr += (1 - (uint) tst); +} + +/* ************************************************************************** */ + +#endif diff --git a/librerie/exercise4/zlasdtest/test.cpp b/librerie/exercise4/zlasdtest/test.cpp new file mode 100644 index 0000000..c1e6409 --- /dev/null +++ b/librerie/exercise4/zlasdtest/test.cpp @@ -0,0 +1,29 @@ + +#include "./exercise1/test.hpp" + +#include "./exercise2/test.hpp" + +#include "./exercise3/test.hpp" + +#include "./exercise4/test.hpp" + +/* ************************************************************************** */ + +#include + +using namespace std; + +/* ************************************************************************** */ + +void lasdtest() { + cout << endl << "~*~#~*~ Welcome to the LASD Test Suite ~*~#~*~ " << endl; + testSimpleExercise1(); + testFullExercise1(); + testSimpleExercise2(); + testFullExercise2(); + testSimpleExercise3(); + testFullExercise3(); + testSimpleExercise4(); + testFullExercise4(); + cout << endl << "Goodbye!" << endl; +} diff --git a/librerie/exercise4/zlasdtest/test.hpp b/librerie/exercise4/zlasdtest/test.hpp new file mode 100644 index 0000000..a2fca61 --- /dev/null +++ b/librerie/exercise4/zlasdtest/test.hpp @@ -0,0 +1,11 @@ + +#ifndef LASDTEST_HPP +#define LASDTEST_HPP + +/* ************************************************************************** */ + +void lasdtest(); + +/* ************************************************************************** */ + +#endif diff --git a/librerie/exercise4/zlasdtest/vector/vector.hpp b/librerie/exercise4/zlasdtest/vector/vector.hpp new file mode 100644 index 0000000..c0059d4 --- /dev/null +++ b/librerie/exercise4/zlasdtest/vector/vector.hpp @@ -0,0 +1,37 @@ + +#ifndef VECTORTEST_HPP +#define VECTORTEST_HPP + +#include "../../vector/vector.hpp" + +/* ************************************************************************** */ + +template +void EqualVector(uint& testnum, uint& testerr, const lasd::Vector& vec1, const lasd::Vector& vec2, bool chk) { + bool tst; + testnum++; + try { + std::cout << " " << testnum << " (" << testerr << ") The two vectors are " << ((tst = (vec1 == vec2)) ? "" : "not ") << "equal: "; + std::cout << ((tst = (tst == chk)) ? "Correct" : "Error") << "!" << std::endl; + } catch(std::exception exc) { + std::cout << "\"" << exc.what() << "\": " << ((tst = !chk) ? "Correct" : "Error") << "!" << std::endl; + } + testerr += (1 - (uint) tst); +} + +template +void NonEqualVector(uint& testnum, uint& testerr, const lasd::Vector& vec1, const lasd::Vector& vec2, bool chk) { + bool tst; + testnum++; + try { + std::cout << " " << testnum << " (" << testerr << ") The two vectors are " << ((tst = (vec1 != vec2)) ? "not " : "") << "equal: "; + std::cout << ((tst = (tst == chk)) ? "Correct" : "Error") << "!" << std::endl; + } catch(std::exception exc) { + std::cout << "\"" << exc.what() << "\": " << ((tst = !chk) ? "Correct" : "Error") << "!" << std::endl; + } + testerr += (1 - (uint) tst); +} + +/* ************************************************************************** */ + +#endif diff --git a/librerie/exercise4/zmytest/test.cpp b/librerie/exercise4/zmytest/test.cpp new file mode 100644 index 0000000..07a921d --- /dev/null +++ b/librerie/exercise4/zmytest/test.cpp @@ -0,0 +1,2 @@ + +// ... diff --git a/librerie/exercise4/zmytest/test.hpp b/librerie/exercise4/zmytest/test.hpp new file mode 100644 index 0000000..99b9987 --- /dev/null +++ b/librerie/exercise4/zmytest/test.hpp @@ -0,0 +1,11 @@ + +#ifndef MYTEST_HPP +#define MYTEST_HPP + +/* ************************************************************************** */ + +// ... + +/* ************************************************************************** */ + +#endif