diff --git a/Task 1/unittest_1.cpp b/Task 1/unittest_1.cpp deleted file mode 100644 index 01b5e41b15e0e4aa9576d2a8c0e6a69e125916a3..0000000000000000000000000000000000000000 --- a/Task 1/unittest_1.cpp +++ /dev/null @@ -1,37 +0,0 @@ -#include "simpletest.h" -#include "../context/context.hpp" -#include "../your_fiber_code.hpp" // Replace with the path to your fiber code file - -// Test for fiber creation -void testFiberCreation() { - Fiber testFiber([](Context* mc, Context* sc) {}); - // Replace with an appropriate check - ST_ASSERT("Fiber stack is correctly aligned", - reinterpret_cast<uintptr_t>(testFiber.context.rsp) % 16 == 0); -} - -// Test for context switching -void testContextSwitching() { - Fiber testFiber([](Context* mc, Context* sc) { - swap_context(sc, mc); - }); - - Context mainContext; - get_context(&mainContext); - swap_context(&mainContext, &testFiber.context); - - // Replace with an appropriate check - ST_ASSERT("Context switched back to main", /* condition */); -} - -// Define more test functions as needed... - -// Main function for running tests -int main() { - ST_RUN_TEST(testFiberCreation); - ST_RUN_TEST(testContextSwitching); - // Add more tests as needed... - - ST_SHOW_SUMMARY(); - return 0; -}