feladat2 fix 1 + feladat7 start
This commit is contained in:
parent
6ca06962d9
commit
3bd4b31b23
18 changed files with 407 additions and 35 deletions
|
|
@ -1,4 +1,4 @@
|
|||
//Tóth Dániel Mátyás | IFPQYY | v2
|
||||
//Tóth Dániel Mátyás | IFPQYY | v3
|
||||
#include "pch.h"
|
||||
#include "CppUnitTest.h"
|
||||
#include "feladat2.h"
|
||||
|
|
@ -151,6 +151,50 @@ namespace UnitTest1
|
|||
Assert::AreEqual(4, capacity());
|
||||
|
||||
}
|
||||
TEST_METHOD(RegularOperationTest) {
|
||||
destroyfifo();
|
||||
createfifo(6);
|
||||
|
||||
push('a');
|
||||
push('b');
|
||||
push('c');
|
||||
push('d');
|
||||
push('e');
|
||||
push('f');
|
||||
|
||||
Assert::AreEqual(6, capacity());
|
||||
Assert::AreEqual(0, freespace());
|
||||
|
||||
Assert::AreEqual('a', (char)pop());
|
||||
Assert::AreEqual('b', (char)pop());
|
||||
Assert::AreEqual('c', (char)pop());
|
||||
|
||||
Assert::AreEqual(6, capacity());
|
||||
Assert::AreEqual(3, freespace());
|
||||
|
||||
destroyfifo();
|
||||
|
||||
}
|
||||
|
||||
TEST_METHOD(SpecialCase1) {//stolen straight from the email
|
||||
destroyfifo();
|
||||
createfifo(3);
|
||||
|
||||
push(0);
|
||||
push(1);
|
||||
push(2);
|
||||
|
||||
Assert::AreEqual(3, capacity());
|
||||
Assert::AreEqual(0, freespace());
|
||||
|
||||
Assert::AreEqual(0, pop());
|
||||
|
||||
Assert::AreEqual(OK, push((char)255));
|
||||
|
||||
Assert::AreEqual(3, capacity());
|
||||
Assert::AreEqual(0, freespace());
|
||||
|
||||
Assert::AreEqual(1, pop());
|
||||
}
|
||||
};
|
||||
}
|
||||
|
|
|
|||
|
|
@ -77,7 +77,8 @@
|
|||
<PropertyGroup Label="UserMacros" />
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
|
||||
<LinkIncremental>true</LinkIncremental>
|
||||
<IncludePath>C:\Users\danit\Desktop\cpp\feladat2\feladat2\feladat2;C:\Users\danit\Desktop\cpp\feladat2\feladat2;$(IncludePath)</IncludePath>
|
||||
<ReferencePath>C:\Users\danit\Desktop\2026-27-cpp-homework\feladat2\feladat2;$(ReferencePath)</ReferencePath>
|
||||
<IncludePath>C:\Users\danit\Desktop\2026-27-cpp-homework\feladat2\feladat2;$(IncludePath)</IncludePath>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||
<LinkIncremental>true</LinkIncremental>
|
||||
|
|
@ -143,7 +144,7 @@
|
|||
</ClCompile>
|
||||
<Link>
|
||||
<SubSystem>Windows</SubSystem>
|
||||
<AdditionalLibraryDirectories>C:\Users\danit\Desktop\cpp\feladat2\feladat2\feladat2\x64\Debug;$(VCInstallDir)UnitTest\lib;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
|
||||
<AdditionalLibraryDirectories>C:\Users\danit\Desktop\2026-27-cpp-homework\feladat2\feladat2\x64\Debug;$(VCInstallDir)UnitTest\lib;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
|
||||
<AdditionalDependencies>feladat2;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
|
|
@ -182,8 +183,8 @@
|
|||
<ClInclude Include="pch.h" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\feladat2\feladat2\feladat2.vcxproj">
|
||||
<Project>{c0af2585-3697-4ad9-bd3a-67823343a675}</Project>
|
||||
<ProjectReference Include="..\feladat2\feladat2.vcxproj">
|
||||
<Project>{6c528726-81ac-44ca-9c09-f9fde7941386}</Project>
|
||||
</ProjectReference>
|
||||
</ItemGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue