コード例 #1
0
        public void CreateBcatSaveData_AlreadyExists_ReturnsPathAlreadyExists()
        {
            var applicationId   = new Ncm.ApplicationId(1);
            FileSystemClient fs = FileSystemServerFactory.CreateClient(true);

            Assert.Success(fs.CreateBcatSaveData(applicationId, 0x400000));
            Assert.Result(ResultFs.PathAlreadyExists, fs.CreateBcatSaveData(applicationId, 0x400000));
        }
コード例 #2
0
ファイル: BcatSaveData.cs プロジェクト: ckurtz22/LibHac
        public void MountBcatSaveData_SaveExists_ReturnsSuccess()
        {
            var applicationId   = new Ncm.ApplicationId(1);
            FileSystemClient fs = FileSystemServerFactory.CreateClient(true);

            Assert.Success(fs.CreateBcatSaveData(applicationId, 0x400000));
            Assert.Success(fs.MountBcatSaveData("bcat_test".ToU8Span(), applicationId));
        }
コード例 #3
0
        public void CreateBcatSaveData_DoesNotExist_SaveIsCreated()
        {
            var applicationId   = new Ncm.ApplicationId(1);
            FileSystemClient fs = FileSystemServerFactory.CreateClient(true);

            Assert.Success(fs.CreateBcatSaveData(applicationId, 0x400000));

            fs.OpenSaveDataIterator(out SaveDataIterator iterator, SaveDataSpaceId.User);

            var info = new SaveDataInfo[2];

            iterator.ReadSaveDataInfo(out long entriesRead, info);

            Assert.Equal(1, entriesRead);
            Assert.Equal(applicationId, info[0].ProgramId);
            Assert.Equal(SaveDataType.Bcat, info[0].Type);
        }
コード例 #4
0
ファイル: BcatSaveData.cs プロジェクト: ckurtz22/LibHac
        public void MountBcatSaveData_WrittenDataPersists()
        {
            var applicationId   = new Ncm.ApplicationId(1);
            FileSystemClient fs = FileSystemServerFactory.CreateClient(true);

            Assert.Success(fs.CreateBcatSaveData(applicationId, 0x400000));
            Assert.Success(fs.MountBcatSaveData("bcat_test".ToU8Span(), applicationId));

            // Check that the path doesn't exist
            Assert.Result(ResultFs.PathNotFound, fs.GetEntryType(out _, "bcat_test:/file".ToU8Span()));

            fs.CreateFile("bcat_test:/file".ToU8Span(), 0);
            fs.Commit("bcat_test".ToU8Span());
            fs.Unmount("bcat_test".ToU8Span());

            Assert.Success(fs.MountBcatSaveData("bcat_test".ToU8Span(), applicationId));
            Assert.Success(fs.GetEntryType(out DirectoryEntryType type, "bcat_test:/file".ToU8Span()));
            Assert.Equal(DirectoryEntryType.File, type);
        }