Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: test case ut_lind_fs_mkdir_success #66

Merged
merged 1 commit into from
Oct 25, 2024

Conversation

ChinmayShringi
Copy link
Contributor

Description

Fixes # (issue)

This PR updates the ut_lind_fs_mkdir_success test to correct the expected link counts for newly created directories. Previously, the test expected the parent directory to have a link count of 3 initially, and 4 after creating a child directory, which was incorrect.

  • Initial Parent Directory Link Count: A newly created directory should have a link count of 2, not 3, because it has:

    • 1 link to itself (.)
    • 1 link from its parent directory (typically the root directory).
  • Parent Directory After Child Directory Creation: After creating a child directory inside the parent, the parent’s link count increases to 3 (not 4). This is due to the child directory’s .. entry pointing back to the parent directory.

The changes fix the incorrect expectations for link counts and ensure the test correctly verifies the behavior of the mkdir and stat syscalls.

Type of change

  • Bug fix (non-breaking change which fixes an issue)

How Has This Been Tested?

  • cargo test ut_lind_fs_mkdir_success

Checklist:

  • My code follows the style guidelines of this project
  • I have commented my code, particularly in hard-to-understand areas
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • Any dependent changes have been added to a pull request and/or merged in other modules (native-client, lind-glibc, lind-project)

Copy link
Member

@Yaxuan-w Yaxuan-w left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Well commented! Great job!

@Yaxuan-w Yaxuan-w merged commit afbe5f4 into main Oct 25, 2024
1 check failed
@Yaxuan-w Yaxuan-w deleted the fix-ut-lind-fs-mkdir-success branch October 25, 2024 21:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants