Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
A
ASD_assignment
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
t2-akhmetov
ASD_assignment
Commits
b879b8c0
Commit
b879b8c0
authored
1 year ago
by
t2-akhmetov
Browse files
Options
Downloads
Patches
Plain Diff
Update unittest_1.cpp
parent
9cf7960d
No related branches found
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
Task 1/unittest_1.cpp
+5
-3
5 additions, 3 deletions
Task 1/unittest_1.cpp
with
5 additions
and
3 deletions
Task 1/unittest_1.cpp
+
5
−
3
View file @
b879b8c0
...
...
@@ -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
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment