diff --git a/librerie/exercise2/build.sh b/librerie/exercise2/build.sh index ca827e6..66c5cd2 100755 --- a/librerie/exercise2/build.sh +++ b/librerie/exercise2/build.sh @@ -5,4 +5,4 @@ g++ -g -O3 -o main \ zlasdtest/exercise1/simpletest.cpp zlasdtest/exercise1/fulltest.cpp \ zlasdtest/exercise2/simpletest.cpp zlasdtest/exercise2/fulltest.cpp \ zlasdtest/container/container.cpp \ - zlasdtest/test.cpp main.cpp + zlasdtest/test.cpp zmytest/test.cpp main.cpp diff --git a/librerie/exercise2/main b/librerie/exercise2/main index c49082d..a7e7e6c 100755 Binary files a/librerie/exercise2/main and b/librerie/exercise2/main differ diff --git a/librerie/exercise2/queue/vec/queuevec.cpp b/librerie/exercise2/queue/vec/queuevec.cpp index 1b96485..cac631c 100755 --- a/librerie/exercise2/queue/vec/queuevec.cpp +++ b/librerie/exercise2/queue/vec/queuevec.cpp @@ -180,7 +180,7 @@ void QueueVec::Reduce(){ ulong newsize = (ulong)size/2; Data* tmp = new Data[newsize]; ulong current_index = front , i=0; - while(i < newsize){ + while(current_index != rear){ tmp[i] = Elements[current_index]; current_index = (current_index+1)%size; ++i; @@ -189,7 +189,7 @@ void QueueVec::Reduce(){ Elements = tmp; front = 0; rear = i; - size *= 2; + size = newsize; } } diff --git a/librerie/exercise2/zmytest/test.cpp b/librerie/exercise2/zmytest/test.cpp index c8cc2df..c6caf7d 100755 --- a/librerie/exercise2/zmytest/test.cpp +++ b/librerie/exercise2/zmytest/test.cpp @@ -213,7 +213,7 @@ void QueueFunctions(T& queue){ std::cout<<"4. Lettura non distruttiva (Head)"<>std::ws; diff --git a/librerie/exercise2/zmytest/test.hpp b/librerie/exercise2/zmytest/test.hpp index d491784..77e6795 100755 --- a/librerie/exercise2/zmytest/test.hpp +++ b/librerie/exercise2/zmytest/test.hpp @@ -68,5 +68,4 @@ std::string generateRandomString(ulong); ulong getDimension(); /* ************************************************************************** */ -#include"test.cpp" #endif