-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Use octal number's actual value in socket permission
- Loading branch information
1 parent
ec69c6e
commit 5f9a738
Showing
4 changed files
with
60 additions
and
42 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
using E5Renewer.Models; | ||
|
||
namespace E5Renewer.Tests.Models; | ||
|
||
/// <summary>Test | ||
/// <see cref="UintExtends"/> | ||
/// </summary> | ||
[TestClass] | ||
public class UintExtendsTests | ||
{ | ||
/// <summary> | ||
/// Test | ||
/// <see cref="UintExtends.ToUnixFileMode(uint)" /> | ||
/// </summary> | ||
[TestMethod] | ||
[DataRow(0b000000000, UnixFileMode.None)] | ||
[DataRow(0b000000001, UnixFileMode.OtherExecute)] | ||
[DataRow(0b000000010, UnixFileMode.OtherWrite)] | ||
[DataRow(0b000000011, UnixFileMode.OtherWrite | UnixFileMode.OtherExecute)] | ||
[DataRow(0b000000100, UnixFileMode.OtherRead)] | ||
[DataRow(0b000000101, UnixFileMode.OtherRead | UnixFileMode.OtherExecute)] | ||
[DataRow(0b000000110, UnixFileMode.OtherRead | UnixFileMode.OtherWrite)] | ||
[DataRow(0b000000111, UnixFileMode.OtherRead | UnixFileMode.OtherWrite | UnixFileMode.OtherExecute)] | ||
[DataRow(0b000001000, UnixFileMode.GroupExecute)] | ||
[DataRow(0b000010000, UnixFileMode.GroupWrite)] | ||
[DataRow(0b000011000, UnixFileMode.GroupWrite | UnixFileMode.GroupExecute)] | ||
[DataRow(0b000100000, UnixFileMode.GroupRead)] | ||
[DataRow(0b000101000, UnixFileMode.GroupRead | UnixFileMode.GroupExecute)] | ||
[DataRow(0b000110000, UnixFileMode.GroupRead | UnixFileMode.GroupWrite)] | ||
[DataRow(0b000111000, UnixFileMode.GroupRead | UnixFileMode.GroupWrite | UnixFileMode.GroupExecute)] | ||
[DataRow(0b001000000, UnixFileMode.UserExecute)] | ||
[DataRow(0b010000000, UnixFileMode.UserWrite)] | ||
[DataRow(0b011000000, UnixFileMode.UserWrite | UnixFileMode.UserExecute)] | ||
[DataRow(0b100000000, UnixFileMode.UserRead)] | ||
[DataRow(0b101000000, UnixFileMode.UserRead | UnixFileMode.UserExecute)] | ||
[DataRow(0b110000000, UnixFileMode.UserRead | UnixFileMode.UserWrite)] | ||
[DataRow(0b111000000, UnixFileMode.UserRead | UnixFileMode.UserWrite | UnixFileMode.UserExecute)] | ||
[DataRow(0b100100100, UnixFileMode.UserRead | UnixFileMode.GroupRead | UnixFileMode.OtherRead)] | ||
public void TestToUnixFileMode(int permission, UnixFileMode mode) | ||
{ | ||
Assert.AreEqual(mode, ((uint)permission).ToUnixFileMode()); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters