mirror of
https://github.com/vale981/openAV-Luppp
synced 2025-03-05 09:01:39 -05:00
-Updated diskwriter & test
This commit is contained in:
parent
b2e27b0847
commit
1f3cbdf653
3 changed files with 12 additions and 3 deletions
|
@ -31,6 +31,7 @@ DiskWriter::DiskWriter()
|
|||
void DiskWriter::initialize(std::string path, std::string name )
|
||||
{
|
||||
sessionName = name;
|
||||
sessionPath = path;
|
||||
|
||||
// write session.luppp JSON node to <path>/<sessionName>.luppp
|
||||
stringstream sessionDirStream;
|
||||
|
@ -67,7 +68,7 @@ std::string DiskWriter::getLastSaveName()
|
|||
|
||||
std::string DiskWriter::getLastSavePath()
|
||||
{
|
||||
return sessionDir;
|
||||
return sessionPath;
|
||||
}
|
||||
|
||||
int DiskWriter::writeAudioBuffer(int track, int scene, AudioBuffer* ab )
|
||||
|
|
|
@ -51,6 +51,7 @@ class DiskWriter
|
|||
|
||||
bool foldersCreated;
|
||||
std::string sessionName;
|
||||
std::string sessionPath;
|
||||
std::string audioDir;
|
||||
std::string sessionDir;
|
||||
|
||||
|
|
|
@ -19,10 +19,17 @@ int DiskWriter::runTests()
|
|||
|
||||
// set the session path to /tmp for test writing
|
||||
|
||||
string path = "/tmp";
|
||||
string session = "testSession";
|
||||
|
||||
AudioBuffer ab(440);
|
||||
//QUNIT_IS_TRUE( gui->getDiskWriter()->writeAudioBuffer(0, 0, &ab) == LUPPP_RETURN_OK );
|
||||
//QUNIT_IS_TRUE( gui->getDiskWriter()->writeSession("/tmp","luppTestSession") == LUPPP_RETURN_OK );
|
||||
gui->getDiskWriter()->initialize(path, session);
|
||||
|
||||
QUNIT_IS_TRUE( gui->getDiskWriter()->writeAudioBuffer(0, 0, &ab) == LUPPP_RETURN_OK );
|
||||
QUNIT_IS_TRUE( gui->getDiskWriter()->writeSession() == LUPPP_RETURN_OK );
|
||||
|
||||
QUNIT_IS_TRUE( strcmp( gui->getDiskWriter()->getLastSavePath().c_str(), path.c_str() ) == 0 );
|
||||
QUNIT_IS_TRUE( strcmp( gui->getDiskWriter()->getLastSaveName().c_str(), session.c_str() ) == 0 );
|
||||
|
||||
return qunit.errors();
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue