Decoupled print and called functions, added test for OpenFile
This commit is contained in:
parent
fae2f1f821
commit
238957c65a
@ -10,36 +10,49 @@ void FS_TestAll()
|
||||
{
|
||||
FS_TestInit();
|
||||
FS_TestSdmcOpen();
|
||||
FS_TestSdmcOpenFile();
|
||||
FS_TestSdmcCreateDir();
|
||||
FS_TestSdmcClose();
|
||||
FS_TestExit();
|
||||
}
|
||||
|
||||
void FS_TestInit()
|
||||
{
|
||||
print("fsInit %08X\n", (unsigned int)
|
||||
fsInit()
|
||||
);
|
||||
unsigned int initResult = fsInit();
|
||||
print("fsInit - [%u]\n", initResult);
|
||||
}
|
||||
|
||||
void FS_TestSdmcOpen()
|
||||
{
|
||||
sdmcArchive = (FS_archive) { 0x00000009, { PATH_EMPTY, 1, (u8*) "" } };
|
||||
|
||||
print("FSUSER_OpenArchive %08X\n", (unsigned int)
|
||||
FSUSER_OpenArchive(NULL, &sdmcArchive)
|
||||
);
|
||||
unsigned int openResult = FSUSER_OpenArchive(NULL, &sdmcArchive);
|
||||
print("FSUSER_OpenArchive - [%u]\n", openResult);
|
||||
}
|
||||
|
||||
void FS_TestSdmcOpenFile()
|
||||
{
|
||||
Handle fileHandle;
|
||||
FS_path filePath = FS_makePath(PATH_CHAR, "/new_file.txt");
|
||||
unsigned int openResult = FSUSER_OpenFile(NULL, &fileHandle, sdmcArchive, filePath, 2, 0);
|
||||
print("FSUSER_OpenFile - [%u]\n", openResult);
|
||||
svcCloseHandle(fileHandle);
|
||||
}
|
||||
|
||||
void FS_TestSdmcCreateDir()
|
||||
{
|
||||
print("FSUSER_CreateDirectory %08X\n", (unsigned int)
|
||||
FSUSER_CreateDirectory(NULL, sdmcArchive, FS_makePath(PATH_CHAR, "/new_dir"))
|
||||
);
|
||||
unsigned int createResult = FSUSER_CreateDirectory(NULL, sdmcArchive, FS_makePath(PATH_CHAR, "/new_dir"));
|
||||
print("FSUSER_CreateDirectory - [%u]\n", createResult);
|
||||
}
|
||||
|
||||
void FS_TestSdmcClose()
|
||||
{
|
||||
print("FSUSER_CloseArchive %08X\n", (unsigned int)
|
||||
FSUSER_CloseArchive(NULL, &sdmcArchive)
|
||||
);
|
||||
unsigned int closeResult = FSUSER_CloseArchive(NULL, &sdmcArchive);
|
||||
print("FSUSER_CloseArchive - [%u]\n", closeResult);
|
||||
}
|
||||
|
||||
void FS_TestExit()
|
||||
{
|
||||
unsigned int exitResult = fsExit();
|
||||
print("fsExit - [%u]", exitResult);
|
||||
}
|
||||
|
@ -19,4 +19,6 @@ void FS_TestSdmcOpenDir();
|
||||
// FS_TestSdmcDeleteDirRecursively();
|
||||
void FS_TestSdmcClose();
|
||||
|
||||
void FS_TestExit();
|
||||
|
||||
#endif
|
||||
|
Loading…
x
Reference in New Issue
Block a user