Skip to content
Snippets Groups Projects
Commit b879b8c0 authored by t2-akhmetov's avatar t2-akhmetov
Browse files

Update unittest_1.cpp

parent 9cf7960d
No related branches found
No related tags found
No related merge requests found
......@@ -30,10 +30,12 @@ DEFINE_TEST(TestFiberStackAlignment) {
// Test Fiber Stack Size
DEFINE_TEST(TestFiberStackSize) {
Fiber testFiber([](Context*, Context*){});
char* stackBottom = reinterpret_cast<char*>(testFiber.context.rsp);
char* stackTop = testFiber.stack;
char* stackBottom = testFiber.stack_bottom_; // Assuming stack_bottom_ points to the beginning of the stack
char* stackTop = testFiber.stack_top_; // stack_top_ should point to the top of the stack (end of allocation)
TEST_EQ(stackTop - stackBottom, StackSize - 128); // Check for expected stack size accounting for Red Zone
// Since stack grows downwards, stackTop should be a smaller address than stackBottom
int actualStackSize = stackBottom - stackTop;
TEST_EQ(actualStackSize, StackSize - 128); // Check for expected stack size accounting for Red Zone
}
// Test Fiber Context Initialization
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment