Skip to content

Commit

Permalink
test: Use tempdir for broadcast profiles
Browse files Browse the repository at this point in the history
  • Loading branch information
xeruf committed Jul 30, 2020
1 parent 759b3fc commit 1856fa5
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 6 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ mixxx-test

src/test/test_data
src/test/golden_buffers/*.actual
*test.bcp.xml

res/qrc_mixxx.cc

Expand Down
10 changes: 4 additions & 6 deletions src/test/broadcastprofile_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -42,11 +42,10 @@ TEST(BroadcastProfileTest, SaveAndLoadXML) {
// Preliminary: set a discriminating value in one of the profile fields
QString streamName("unit testing in progress");

BroadcastProfile profile("Unit Testing Profile");
BroadcastProfile profile("Broadcast Profile test");
profile.setStreamName(streamName);

QString filename = profile.getProfileName() + QString(".bcp.xml");

QString filename = QDir::temp().filePath(profile.getProfileName() + QString(".bcp.xml"));
// Call save() on a profile and assert it actually exists
QFile::remove(filename); // First, make sure it doesn't exists
profile.save(filename);
Expand All @@ -60,12 +59,11 @@ TEST(BroadcastProfileTest, SaveAndLoadXML) {
}

TEST(BroadcastProfileTest, SaveAndLoadXMLDotName) {
QString profileName("profile has a dot. (in the name)");
QString profileName("broadcast profile has a dot. (in the name) test");

BroadcastProfile profile(profileName);

QString filename = profile.getProfileName() + QString(".bcp.xml");

QString filename = QDir::temp().filePath(profile.getProfileName() + QString(".bcp.xml"));
// Call save() on a profile and assert it actually exists
QFile::remove(filename); // First, make sure it doesn't exists
profile.save(filename);
Expand Down

0 comments on commit 1856fa5

Please sign in to comment.