Skip to content

Test fixes#91

Closed
rw2 wants to merge 6 commits intoPelicanPlatform:mainfrom
rw2:test-fixes
Closed

Test fixes#91
rw2 wants to merge 6 commits intoPelicanPlatform:mainfrom
rw2:test-fixes

Conversation

@rw2
Copy link
Collaborator

@rw2 rw2 commented Feb 4, 2025

repairs a signing issue in some tests.

Copy link
Collaborator

@bbockelm bbockelm left a comment

Choose a reason for hiding this comment

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

It's not clear why some of these cast to int while others to unsigned int. I think it'd be better to use mode_t -- the defined type of st_mode -- where possible.

Before we merge, can you please rebase and squash as well?

ASSERT_EQ(fs.Stat("/test", &buf, 0, nullptr), 0);

ASSERT_EQ(buf.st_mode & S_IFDIR, S_IFDIR);
ASSERT_EQ(static_cast<int>(buf.st_mode & S_IFDIR), S_IFDIR);
Copy link
Collaborator

Choose a reason for hiding this comment

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

If we need to cast, I think it'd be better to keep everything as mode_t as in:

Suggested change
ASSERT_EQ(static_cast<int>(buf.st_mode & S_IFDIR), S_IFDIR);
ASSERT_EQ(buf.st_mode & S_IFDIR, static_cast<mode_t>(S_IFDIR));

However, I haven't noticed this comparison issue. What platform are you hitting this on?

@rw2 rw2 marked this pull request as draft August 21, 2025 23:19
@rw2 rw2 closed this Aug 21, 2025
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