diff --git a/HW1/.vs/HW1/v14/.suo b/HW1/.vs/HW1/v14/.suo
new file mode 100644
index 0000000..302f917
Binary files /dev/null and b/HW1/.vs/HW1/v14/.suo differ
diff --git a/HW1/Debug/HW1.ilk b/HW1/Debug/HW1.ilk
new file mode 100644
index 0000000..7d4fbb6
Binary files /dev/null and b/HW1/Debug/HW1.ilk differ
diff --git a/HW1/Debug/HW1.pdb b/HW1/Debug/HW1.pdb
new file mode 100644
index 0000000..acbf574
Binary files /dev/null and b/HW1/Debug/HW1.pdb differ
diff --git a/HW1/HW1.VC.db b/HW1/HW1.VC.db
new file mode 100644
index 0000000..e81cad0
Binary files /dev/null and b/HW1/HW1.VC.db differ
diff --git a/HW1/HW1.sln b/HW1/HW1.sln
new file mode 100644
index 0000000..e2f2873
--- /dev/null
+++ b/HW1/HW1.sln
@@ -0,0 +1,28 @@
+
+Microsoft Visual Studio Solution File, Format Version 12.00
+# Visual Studio 14
+VisualStudioVersion = 14.0.25420.1
+MinimumVisualStudioVersion = 10.0.40219.1
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "HW1", "HW1\HW1.vcxproj", "{2EC8A642-DD0D-49B8-9F1B-465FD3ECE8D4}"
+EndProject
+Global
+ GlobalSection(SolutionConfigurationPlatforms) = preSolution
+ Debug|x64 = Debug|x64
+ Debug|x86 = Debug|x86
+ Release|x64 = Release|x64
+ Release|x86 = Release|x86
+ EndGlobalSection
+ GlobalSection(ProjectConfigurationPlatforms) = postSolution
+ {2EC8A642-DD0D-49B8-9F1B-465FD3ECE8D4}.Debug|x64.ActiveCfg = Debug|x64
+ {2EC8A642-DD0D-49B8-9F1B-465FD3ECE8D4}.Debug|x64.Build.0 = Debug|x64
+ {2EC8A642-DD0D-49B8-9F1B-465FD3ECE8D4}.Debug|x86.ActiveCfg = Debug|Win32
+ {2EC8A642-DD0D-49B8-9F1B-465FD3ECE8D4}.Debug|x86.Build.0 = Debug|Win32
+ {2EC8A642-DD0D-49B8-9F1B-465FD3ECE8D4}.Release|x64.ActiveCfg = Release|x64
+ {2EC8A642-DD0D-49B8-9F1B-465FD3ECE8D4}.Release|x64.Build.0 = Release|x64
+ {2EC8A642-DD0D-49B8-9F1B-465FD3ECE8D4}.Release|x86.ActiveCfg = Release|Win32
+ {2EC8A642-DD0D-49B8-9F1B-465FD3ECE8D4}.Release|x86.Build.0 = Release|Win32
+ EndGlobalSection
+ GlobalSection(SolutionProperties) = preSolution
+ HideSolutionNode = FALSE
+ EndGlobalSection
+EndGlobal
diff --git a/HW1/HW1/Debug/HW1.log b/HW1/HW1/Debug/HW1.log
new file mode 100644
index 0000000..576a1d4
--- /dev/null
+++ b/HW1/HW1/Debug/HW1.log
@@ -0,0 +1,3 @@
+ Main.cpp
+ HW1.vcxproj -> D:\git\CPP\HW1\Debug\HW1.exe
+ HW1.vcxproj -> D:\git\CPP\HW1\Debug\HW1.pdb (Full PDB)
diff --git a/HW1/HW1/Debug/HW1.tlog/CL.command.1.tlog b/HW1/HW1/Debug/HW1.tlog/CL.command.1.tlog
new file mode 100644
index 0000000..a24b983
Binary files /dev/null and b/HW1/HW1/Debug/HW1.tlog/CL.command.1.tlog differ
diff --git a/HW1/HW1/Debug/HW1.tlog/CL.read.1.tlog b/HW1/HW1/Debug/HW1.tlog/CL.read.1.tlog
new file mode 100644
index 0000000..89ffd76
Binary files /dev/null and b/HW1/HW1/Debug/HW1.tlog/CL.read.1.tlog differ
diff --git a/HW1/HW1/Debug/HW1.tlog/CL.write.1.tlog b/HW1/HW1/Debug/HW1.tlog/CL.write.1.tlog
new file mode 100644
index 0000000..dc3ef19
Binary files /dev/null and b/HW1/HW1/Debug/HW1.tlog/CL.write.1.tlog differ
diff --git a/HW1/HW1/Debug/HW1.tlog/HW1.lastbuildstate b/HW1/HW1/Debug/HW1.tlog/HW1.lastbuildstate
new file mode 100644
index 0000000..d04ab54
--- /dev/null
+++ b/HW1/HW1/Debug/HW1.tlog/HW1.lastbuildstate
@@ -0,0 +1,2 @@
+#TargetFrameworkVersion=v4.0:PlatformToolSet=v140:EnableManagedIncrementalBuild=false:VCToolArchitecture=Native32Bit:WindowsTargetPlatformVersion=8.1
+Debug|Win32|D:\git\CPP\HW1\|
diff --git a/HW1/HW1/Debug/HW1.tlog/link.command.1.tlog b/HW1/HW1/Debug/HW1.tlog/link.command.1.tlog
new file mode 100644
index 0000000..b6dfe77
Binary files /dev/null and b/HW1/HW1/Debug/HW1.tlog/link.command.1.tlog differ
diff --git a/HW1/HW1/Debug/HW1.tlog/link.read.1.tlog b/HW1/HW1/Debug/HW1.tlog/link.read.1.tlog
new file mode 100644
index 0000000..580e04f
Binary files /dev/null and b/HW1/HW1/Debug/HW1.tlog/link.read.1.tlog differ
diff --git a/HW1/HW1/Debug/HW1.tlog/link.write.1.tlog b/HW1/HW1/Debug/HW1.tlog/link.write.1.tlog
new file mode 100644
index 0000000..d33d362
Binary files /dev/null and b/HW1/HW1/Debug/HW1.tlog/link.write.1.tlog differ
diff --git a/HW1/HW1/Debug/vc140.idb b/HW1/HW1/Debug/vc140.idb
new file mode 100644
index 0000000..5cb717d
Binary files /dev/null and b/HW1/HW1/Debug/vc140.idb differ
diff --git a/HW1/HW1/Debug/vc140.pdb b/HW1/HW1/Debug/vc140.pdb
new file mode 100644
index 0000000..7ad9a32
Binary files /dev/null and b/HW1/HW1/Debug/vc140.pdb differ
diff --git a/HW1/HW1/HW1.vcxproj b/HW1/HW1/HW1.vcxproj
new file mode 100644
index 0000000..8afc8ab
--- /dev/null
+++ b/HW1/HW1/HW1.vcxproj
@@ -0,0 +1,154 @@
+
+
+
+
+ Debug
+ Win32
+
+
+ Release
+ Win32
+
+
+ Debug
+ x64
+
+
+ Release
+ x64
+
+
+
+ {2EC8A642-DD0D-49B8-9F1B-465FD3ECE8D4}
+ Win32Proj
+ HW1
+ 8.1
+
+
+
+ Application
+ true
+ v140
+ Unicode
+
+
+ Application
+ false
+ v140
+ true
+ Unicode
+
+
+ Application
+ true
+ v140
+ Unicode
+
+
+ Application
+ false
+ v140
+ true
+ Unicode
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ true
+
+
+ true
+
+
+ false
+
+
+ false
+
+
+
+
+
+ Level3
+ Disabled
+ WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)
+
+
+ Console
+ true
+
+
+
+
+
+
+ Level3
+ Disabled
+ _DEBUG;_CONSOLE;%(PreprocessorDefinitions)
+
+
+ Console
+ true
+
+
+
+
+ Level3
+
+
+ MaxSpeed
+ true
+ true
+ WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)
+
+
+ Console
+ true
+ true
+ true
+
+
+
+
+ Level3
+
+
+ MaxSpeed
+ true
+ true
+ NDEBUG;_CONSOLE;%(PreprocessorDefinitions)
+
+
+ Console
+ true
+ true
+ true
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/HW1/HW1/HW1.vcxproj.filters b/HW1/HW1/HW1.vcxproj.filters
new file mode 100644
index 0000000..c6762ad
--- /dev/null
+++ b/HW1/HW1/HW1.vcxproj.filters
@@ -0,0 +1,30 @@
+
+
+
+
+ {4FC737F1-C7A5-4376-A066-2A32D752A2FF}
+ cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx
+
+
+ {93995380-89BD-4b04-88EB-625FBE52EBFB}
+ h;hh;hpp;hxx;hm;inl;inc;xsd
+
+
+ {67DA6AB6-F800-4c08-8B7A-83BB121AAD01}
+ rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms
+
+
+
+
+ Заголовочные файлы
+
+
+ Заголовочные файлы
+
+
+
+
+ Файлы исходного кода
+
+
+
\ No newline at end of file
diff --git a/HW1/HW1/HW1.vcxproj.user b/HW1/HW1/HW1.vcxproj.user
new file mode 100644
index 0000000..abe8dd8
--- /dev/null
+++ b/HW1/HW1/HW1.vcxproj.user
@@ -0,0 +1,4 @@
+
+
+
+
\ No newline at end of file
diff --git a/HW1/HW1/Main.cpp b/HW1/HW1/Main.cpp
new file mode 100644
index 0000000..15159ad
--- /dev/null
+++ b/HW1/HW1/Main.cpp
@@ -0,0 +1,30 @@
+#include
+#include
+
+#include "Stack.h"
+#include "StackImpl.h"
+int main()
+{
+ StackImpl *s = new StackImpl();
+ s->push(1);
+ s->push(2);
+ s->push(3);
+ s->push(4);
+
+ Stack *s2 = new StackImpl(*s);
+ s2->push(45);
+ s->push(34);
+ std::cout<pop()<<"\n";
+ std::cout << s->pop() << "\n";
+ std::cout << s->pop() << "\n";
+ std::cout << s->pop() << "\n";
+
+ std::cout << s2->pop() << "\n";
+ std::cout << s2->pop() << "\n";
+ std::cout << s2->pop() << "\n";
+ std::cout << s2->pop() << "\n";
+
+ system("pause");
+ delete s;
+ return 0;
+}
diff --git a/HW1/HW1/Stack.h b/HW1/HW1/Stack.h
new file mode 100644
index 0000000..fb68e2a
--- /dev/null
+++ b/HW1/HW1/Stack.h
@@ -0,0 +1,16 @@
+#ifndef STACK
+#define STACK
+
+class Stack
+{
+public:
+ virtual ~Stack() {}
+ typedef int value_type;
+ virtual void push(value_type const) = 0;
+ virtual value_type pop() = 0;
+ virtual value_type top() const = 0;
+ virtual size_t size() const = 0;
+ virtual bool empty() const = 0;
+};
+
+#endif
\ No newline at end of file
diff --git a/HW1/HW1/StackImpl.h b/HW1/HW1/StackImpl.h
new file mode 100644
index 0000000..08abf3c
--- /dev/null
+++ b/HW1/HW1/StackImpl.h
@@ -0,0 +1,145 @@
+#ifndef STIMP
+#define STIMP
+
+#include
+#include
+#include "Stack.h"
+
+#define ASSERT_OK() if (!ok()){ dump(); throw "stack is corrupted";}
+
+const size_t POISON = INT32_MAX;
+const uint8_t LIMIT_DUMP = 10;
+
+class StackImpl : public Stack
+{
+public:
+
+ StackImpl(): root(nullptr), size_(0) {}
+
+ StackImpl(StackImpl &s1): root(nullptr), size_(s1.size_)
+ {
+ if (!s1.ok())
+ throw "Object not created";
+ if (s1.root == nullptr)
+ return;
+ Node * cur_root = s1.root;
+ Node * first = Node::new_Node(cur_root->data, nullptr);
+ Node * prev = first;
+ while ( (cur_root=cur_root->next) != nullptr)
+ {
+ Node * n = Node::new_Node(cur_root->data, nullptr);
+ prev->next = n;
+ prev = n;
+ }
+ root = first;
+ }
+
+ ~StackImpl()
+ {
+ while (root != nullptr)
+ {
+ Node * v = root;
+ root = root->next;
+ delete v;
+ }
+ size_ = POISON;
+ }
+
+ void push(value_type const elem) override
+ {
+ ASSERT_OK();
+ size_++;
+ if (root == nullptr)
+ {
+ root = Node::new_Node(elem, nullptr);
+ }
+ else
+ {
+ Node * ne = Node::new_Node(elem, root);
+ root = ne;
+ }
+ ASSERT_OK();
+ }
+
+ value_type pop() override
+ {
+ ASSERT_OK();
+ if (size_ <= 0)
+ {
+ throw "stack is empty";
+ }
+ size_--;
+ value_type val = root->data;
+ Node * n = root;
+ root = root->next;
+ delete n;
+ ASSERT_OK();
+ return val;
+ }
+
+ value_type top() const override
+ {
+ ASSERT_OK();
+ if (size_ <= 0)
+ {
+ throw "stack is empty";
+ }
+ ASSERT_OK();
+ return root->data;
+ }
+
+ size_t size() const override
+ {
+ return size_;
+ }
+
+ bool empty() const override
+ {
+ return (size_) ? false : true;
+ }
+
+private:
+ bool ok() const
+ {
+ return (size_ != POISON) ? true : false;
+ }
+
+ void dump() const
+ {
+ std::ofstream out("dump.txt");
+ out << "Dump of stackimpl "<data<next;
+ }
+ out.close();
+ }
+
+
+private:
+ struct Node
+ {
+ value_type data;
+ Node * next;
+
+ static Node * new_Node(value_type val, Node * next)
+ {
+ Node * node = new Node;
+ node->data = val;
+ node->next = next;
+ return node;
+ }
+ };
+
+ Node * root;
+ size_t size_;
+};
+
+#endif
+
+
diff --git a/HW1_Test/.vs/HW1_Test/v14/.suo b/HW1_Test/.vs/HW1_Test/v14/.suo
new file mode 100644
index 0000000..1231fea
Binary files /dev/null and b/HW1_Test/.vs/HW1_Test/v14/.suo differ
diff --git a/HW1_Test/Debug/HW1_Test.exp b/HW1_Test/Debug/HW1_Test.exp
new file mode 100644
index 0000000..2f56505
Binary files /dev/null and b/HW1_Test/Debug/HW1_Test.exp differ
diff --git a/HW1_Test/Debug/HW1_Test.ilk b/HW1_Test/Debug/HW1_Test.ilk
new file mode 100644
index 0000000..f05dff4
Binary files /dev/null and b/HW1_Test/Debug/HW1_Test.ilk differ
diff --git a/HW1_Test/Debug/HW1_Test.pdb b/HW1_Test/Debug/HW1_Test.pdb
new file mode 100644
index 0000000..4471d1e
Binary files /dev/null and b/HW1_Test/Debug/HW1_Test.pdb differ
diff --git a/HW1_Test/HW1_Test.VC.db b/HW1_Test/HW1_Test.VC.db
new file mode 100644
index 0000000..fc79299
Binary files /dev/null and b/HW1_Test/HW1_Test.VC.db differ
diff --git a/HW1_Test/HW1_Test.sln b/HW1_Test/HW1_Test.sln
new file mode 100644
index 0000000..16e91a2
--- /dev/null
+++ b/HW1_Test/HW1_Test.sln
@@ -0,0 +1,28 @@
+
+Microsoft Visual Studio Solution File, Format Version 12.00
+# Visual Studio 14
+VisualStudioVersion = 14.0.25420.1
+MinimumVisualStudioVersion = 10.0.40219.1
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "HW1_Test", "HW1_Test\HW1_Test.vcxproj", "{B85D94F9-2EE5-4775-9390-7F3B5981C3C7}"
+EndProject
+Global
+ GlobalSection(SolutionConfigurationPlatforms) = preSolution
+ Debug|x64 = Debug|x64
+ Debug|x86 = Debug|x86
+ Release|x64 = Release|x64
+ Release|x86 = Release|x86
+ EndGlobalSection
+ GlobalSection(ProjectConfigurationPlatforms) = postSolution
+ {B85D94F9-2EE5-4775-9390-7F3B5981C3C7}.Debug|x64.ActiveCfg = Debug|x64
+ {B85D94F9-2EE5-4775-9390-7F3B5981C3C7}.Debug|x64.Build.0 = Debug|x64
+ {B85D94F9-2EE5-4775-9390-7F3B5981C3C7}.Debug|x86.ActiveCfg = Debug|Win32
+ {B85D94F9-2EE5-4775-9390-7F3B5981C3C7}.Debug|x86.Build.0 = Debug|Win32
+ {B85D94F9-2EE5-4775-9390-7F3B5981C3C7}.Release|x64.ActiveCfg = Release|x64
+ {B85D94F9-2EE5-4775-9390-7F3B5981C3C7}.Release|x64.Build.0 = Release|x64
+ {B85D94F9-2EE5-4775-9390-7F3B5981C3C7}.Release|x86.ActiveCfg = Release|Win32
+ {B85D94F9-2EE5-4775-9390-7F3B5981C3C7}.Release|x86.Build.0 = Release|Win32
+ EndGlobalSection
+ GlobalSection(SolutionProperties) = preSolution
+ HideSolutionNode = FALSE
+ EndGlobalSection
+EndGlobal
diff --git a/HW1_Test/HW1_Test/Debug/HW1_Test.log b/HW1_Test/HW1_Test/Debug/HW1_Test.log
new file mode 100644
index 0000000..5a0ee8d
--- /dev/null
+++ b/HW1_Test/HW1_Test/Debug/HW1_Test.log
@@ -0,0 +1,4 @@
+ unittest1.cpp
+ ╤ючфрхЄё сшсышюЄхър D:\git\CPP\HW1_Test\Debug\HW1_Test.lib ш юс·хъЄ D:\git\CPP\HW1_Test\Debug\HW1_Test.exp
+ HW1_Test.vcxproj -> D:\git\CPP\HW1_Test\Debug\HW1_Test.dll
+ HW1_Test.vcxproj -> D:\git\CPP\HW1_Test\Debug\HW1_Test.pdb (Partial PDB)
diff --git a/HW1_Test/HW1_Test/Debug/HW1_Test.tlog/CL.command.1.tlog b/HW1_Test/HW1_Test/Debug/HW1_Test.tlog/CL.command.1.tlog
new file mode 100644
index 0000000..332cbcb
Binary files /dev/null and b/HW1_Test/HW1_Test/Debug/HW1_Test.tlog/CL.command.1.tlog differ
diff --git a/HW1_Test/HW1_Test/Debug/HW1_Test.tlog/CL.read.1.tlog b/HW1_Test/HW1_Test/Debug/HW1_Test.tlog/CL.read.1.tlog
new file mode 100644
index 0000000..5a6dc38
Binary files /dev/null and b/HW1_Test/HW1_Test/Debug/HW1_Test.tlog/CL.read.1.tlog differ
diff --git a/HW1_Test/HW1_Test/Debug/HW1_Test.tlog/CL.write.1.tlog b/HW1_Test/HW1_Test/Debug/HW1_Test.tlog/CL.write.1.tlog
new file mode 100644
index 0000000..3eb5510
Binary files /dev/null and b/HW1_Test/HW1_Test/Debug/HW1_Test.tlog/CL.write.1.tlog differ
diff --git a/HW1_Test/HW1_Test/Debug/HW1_Test.tlog/HW1_Test.lastbuildstate b/HW1_Test/HW1_Test/Debug/HW1_Test.tlog/HW1_Test.lastbuildstate
new file mode 100644
index 0000000..cdf4f55
--- /dev/null
+++ b/HW1_Test/HW1_Test/Debug/HW1_Test.tlog/HW1_Test.lastbuildstate
@@ -0,0 +1,2 @@
+#TargetFrameworkVersion=v4.0:PlatformToolSet=v140:EnableManagedIncrementalBuild=false:VCToolArchitecture=Native32Bit:WindowsTargetPlatformVersion=8.1
+Debug|Win32|D:\git\CPP\HW1_Test\|
diff --git a/HW1_Test/HW1_Test/Debug/HW1_Test.tlog/HW1_Test.write.1u.tlog b/HW1_Test/HW1_Test/Debug/HW1_Test.tlog/HW1_Test.write.1u.tlog
new file mode 100644
index 0000000..ba1d069
Binary files /dev/null and b/HW1_Test/HW1_Test/Debug/HW1_Test.tlog/HW1_Test.write.1u.tlog differ
diff --git a/HW1_Test/HW1_Test/Debug/HW1_Test.tlog/link.command.1.tlog b/HW1_Test/HW1_Test/Debug/HW1_Test.tlog/link.command.1.tlog
new file mode 100644
index 0000000..445a286
Binary files /dev/null and b/HW1_Test/HW1_Test/Debug/HW1_Test.tlog/link.command.1.tlog differ
diff --git a/HW1_Test/HW1_Test/Debug/HW1_Test.tlog/link.read.1.tlog b/HW1_Test/HW1_Test/Debug/HW1_Test.tlog/link.read.1.tlog
new file mode 100644
index 0000000..0a74ead
Binary files /dev/null and b/HW1_Test/HW1_Test/Debug/HW1_Test.tlog/link.read.1.tlog differ
diff --git a/HW1_Test/HW1_Test/Debug/HW1_Test.tlog/link.write.1.tlog b/HW1_Test/HW1_Test/Debug/HW1_Test.tlog/link.write.1.tlog
new file mode 100644
index 0000000..be5040e
Binary files /dev/null and b/HW1_Test/HW1_Test/Debug/HW1_Test.tlog/link.write.1.tlog differ
diff --git a/HW1_Test/HW1_Test/Debug/vc140.idb b/HW1_Test/HW1_Test/Debug/vc140.idb
new file mode 100644
index 0000000..bec0ef3
Binary files /dev/null and b/HW1_Test/HW1_Test/Debug/vc140.idb differ
diff --git a/HW1_Test/HW1_Test/Debug/vc140.pdb b/HW1_Test/HW1_Test/Debug/vc140.pdb
new file mode 100644
index 0000000..88bfa1a
Binary files /dev/null and b/HW1_Test/HW1_Test/Debug/vc140.pdb differ
diff --git a/HW1_Test/HW1_Test/HW1_Test.vcxproj b/HW1_Test/HW1_Test/HW1_Test.vcxproj
new file mode 100644
index 0000000..00c906b
--- /dev/null
+++ b/HW1_Test/HW1_Test/HW1_Test.vcxproj
@@ -0,0 +1,168 @@
+
+
+
+
+ Debug
+ Win32
+
+
+ Release
+ Win32
+
+
+ Debug
+ x64
+
+
+ Release
+ x64
+
+
+
+ {B85D94F9-2EE5-4775-9390-7F3B5981C3C7}
+ Win32Proj
+ HW1_Test
+ 8.1
+
+
+
+ DynamicLibrary
+ true
+ v140
+ Unicode
+ false
+
+
+ DynamicLibrary
+ false
+ v140
+ true
+ Unicode
+ false
+
+
+ DynamicLibrary
+ true
+ v140
+ Unicode
+ false
+
+
+ DynamicLibrary
+ false
+ v140
+ true
+ Unicode
+ false
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ true
+
+
+ true
+
+
+ true
+
+
+ true
+
+
+
+ Use
+ Level3
+ Disabled
+ $(VCInstallDir)UnitTest\include;%(AdditionalIncludeDirectories)
+ WIN32;_DEBUG;%(PreprocessorDefinitions)
+ true
+
+
+ Windows
+ $(VCInstallDir)UnitTest\lib;%(AdditionalLibraryDirectories)
+
+
+
+
+ Use
+ Level3
+ Disabled
+ $(VCInstallDir)UnitTest\include;%(AdditionalIncludeDirectories)
+ _DEBUG;%(PreprocessorDefinitions)
+ true
+
+
+ Windows
+ $(VCInstallDir)UnitTest\lib;%(AdditionalLibraryDirectories)
+
+
+
+
+ Level3
+ Use
+ MaxSpeed
+ true
+ true
+ $(VCInstallDir)UnitTest\include;%(AdditionalIncludeDirectories)
+ WIN32;NDEBUG;%(PreprocessorDefinitions)
+ true
+
+
+ Windows
+ true
+ true
+ $(VCInstallDir)UnitTest\lib;%(AdditionalLibraryDirectories)
+
+
+
+
+ Level3
+ Use
+ MaxSpeed
+ true
+ true
+ $(VCInstallDir)UnitTest\include;%(AdditionalIncludeDirectories)
+ NDEBUG;%(PreprocessorDefinitions)
+ true
+
+
+ Windows
+ true
+ true
+ $(VCInstallDir)UnitTest\lib;%(AdditionalLibraryDirectories)
+
+
+
+
+
+
+
+
+ Create
+ Create
+ Create
+ Create
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/HW1_Test/HW1_Test/HW1_Test.vcxproj.filters b/HW1_Test/HW1_Test/HW1_Test.vcxproj.filters
new file mode 100644
index 0000000..d9e164e
--- /dev/null
+++ b/HW1_Test/HW1_Test/HW1_Test.vcxproj.filters
@@ -0,0 +1,33 @@
+
+
+
+
+ {4FC737F1-C7A5-4376-A066-2A32D752A2FF}
+ cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx
+
+
+ {93995380-89BD-4b04-88EB-625FBE52EBFB}
+ h;hh;hpp;hxx;hm;inl;inc;xsd
+
+
+ {67DA6AB6-F800-4c08-8B7A-83BB121AAD01}
+ rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms
+
+
+
+
+ Заголовочные файлы
+
+
+ Заголовочные файлы
+
+
+
+
+ Файлы исходного кода
+
+
+ Файлы исходного кода
+
+
+
\ No newline at end of file
diff --git a/HW1_Test/HW1_Test/HW1_Test.vcxproj.user b/HW1_Test/HW1_Test/HW1_Test.vcxproj.user
new file mode 100644
index 0000000..abe8dd8
--- /dev/null
+++ b/HW1_Test/HW1_Test/HW1_Test.vcxproj.user
@@ -0,0 +1,4 @@
+
+
+
+
\ No newline at end of file
diff --git a/HW1_Test/HW1_Test/stdafx.cpp b/HW1_Test/HW1_Test/stdafx.cpp
new file mode 100644
index 0000000..8e782af
--- /dev/null
+++ b/HW1_Test/HW1_Test/stdafx.cpp
@@ -0,0 +1,8 @@
+// stdafx.cpp: ,
+// HW1_Test.pch
+// stdafx.obj
+
+#include "stdafx.h"
+
+// TODO: STDAFX.H
+// ,
diff --git a/HW1_Test/HW1_Test/stdafx.h b/HW1_Test/HW1_Test/stdafx.h
new file mode 100644
index 0000000..d59bc9c
--- /dev/null
+++ b/HW1_Test/HW1_Test/stdafx.h
@@ -0,0 +1,13 @@
+// stdafx.h: ,
+// , ,
+//
+//
+
+#pragma once
+
+#include "targetver.h"
+
+// CppUnitTest
+#include "CppUnitTest.h"
+
+// TODO: ,
diff --git a/HW1_Test/HW1_Test/targetver.h b/HW1_Test/HW1_Test/targetver.h
new file mode 100644
index 0000000..e606977
--- /dev/null
+++ b/HW1_Test/HW1_Test/targetver.h
@@ -0,0 +1,8 @@
+#pragma once
+
+// SDKDDKVer.h Windows.
+
+// Windows, WinSDKVer.h
+// _WIN32_WINNT , , SDKDDKVer.h.
+
+#include
diff --git a/HW1_Test/HW1_Test/unittest1.cpp b/HW1_Test/HW1_Test/unittest1.cpp
new file mode 100644
index 0000000..de906bf
--- /dev/null
+++ b/HW1_Test/HW1_Test/unittest1.cpp
@@ -0,0 +1,108 @@
+#include "stdafx.h"
+#include "CppUnitTest.h"
+#include "../../HW1/HW1/Stack.h"
+#include "../../HW1/HW1/StackImpl.h"
+#include
+using namespace Microsoft::VisualStudio::CppUnitTestFramework;
+
+namespace HW1_Test
+{
+ TEST_CLASS(UnitTest1)
+ {
+ public:
+
+ TEST_METHOD(base_empty)
+ {
+ Stack * s = new StackImpl();
+ Assert::IsTrue(s->empty());
+ delete s;
+ }
+
+ TEST_METHOD(base_push_pop_empty_size)
+ {
+ Stack * s = new StackImpl();
+ for (int i=1; i<=5; i++)
+ s->push(i);
+ for (int i=5; i>=1; i--)
+ {
+ Assert::AreEqual(s->size(), static_cast(i));
+ Assert::AreEqual(s->pop(), i);
+ }
+ Assert::IsTrue(s->empty());
+ delete s;
+ }
+
+ TEST_METHOD(base_badpop)
+ {
+ Stack * s = new StackImpl();
+ try
+ {
+ s->push(4);
+ s->pop();
+ s->pop();
+ Assert::AreEqual(1, 2);
+ }
+ catch(const char * e)
+ {
+ Assert::AreEqual(e, "stack is empty");
+ }
+
+ delete s;
+ }
+
+ TEST_METHOD(copy_constr)
+ {
+ StackImpl *s = new StackImpl();
+ s->push(1);
+ s->push(2);
+ s->push(3);
+ s->push(4);
+
+ Stack *s2 = new StackImpl(*s);
+ s2->push(45);
+ s->push(34);
+ Assert::AreNotEqual(s->pop(), s2->pop());
+ Assert::AreEqual(s->pop(), s2->pop());
+ Assert::AreEqual(s->pop(), s2->pop());
+ Assert::AreEqual(s->pop(), s2->pop());
+ Assert::AreEqual(s->pop(), s2->pop());
+ delete s;
+ delete s2;
+ }
+
+
+ //don't work/ its normal
+ TEST_METHOD(base_badpointer)
+ {
+ Stack * s = new StackImpl();
+ Stack ** d = &s;
+ s->push(4);
+ s->push(34);
+ s->~Stack();
+ try
+ {
+ (*d)->size();
+ Assert::AreEqual(1, 2);
+ }
+ catch(const char *e)
+ {
+ Assert::AreEqual(e, "stack is corrupted");
+ }
+ }
+
+ TEST_METHOD(base_top)
+ {
+ Stack * s = new StackImpl();
+ s->push(1);
+ s->push(2);
+ Assert::AreEqual(s->top(), 2);
+ Assert::AreEqual(s->size(), static_cast(2));
+ Assert::AreEqual(s->pop(), 2);
+ Assert::AreEqual(s->top(), 1);
+ Assert::AreEqual(s->size(), static_cast(1));
+ delete s;
+ }
+
+
+ };
+}
\ No newline at end of file
diff --git a/HW1_Test/ipch/HW1_TEST-eac7f58/HW1_TEST-47d8303b.ipch b/HW1_Test/ipch/HW1_TEST-eac7f58/HW1_TEST-47d8303b.ipch
new file mode 100644
index 0000000..97872a4
Binary files /dev/null and b/HW1_Test/ipch/HW1_TEST-eac7f58/HW1_TEST-47d8303b.ipch differ