Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -444,9 +444,11 @@ if (Boost_FOUND AND Boost_filesystem_FOUND AND Boost_system_FOUND)
add_djinterop_test(engine/ engine_test)
add_djinterop_test(engine/ playlist_test)
add_djinterop_test(engine/ track_test)
add_djinterop_test(engine/v2/ information_table_test)
add_djinterop_test(engine/v2/ playlist_entity_table_test)
add_djinterop_test(engine/v2/ playlist_table_test)
add_djinterop_test(engine/v2/ track_table_test)
add_djinterop_test(engine/v3/ information_table_test)
add_djinterop_test(engine/v3/ performance_data_table_test)
add_djinterop_test(engine/v3/ track_table_test)

Expand Down
3 changes: 2 additions & 1 deletion include/djinterop/engine/v2/information_table.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,8 @@ struct DJINTEROP_PUBLIC information_row
{
/// Auto-generated id column.
///
/// Not especially meaningful when there is only a single row in the table.
/// The table holds only one row, and Engine keeps it at id 1. Hardware
/// players have been observed to reject a library whose row is elsewhere.
int64_t id;

/// UUID for the database.
Expand Down
1 change: 0 additions & 1 deletion src/djinterop/engine/schema/schema_3_0_2.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -322,7 +322,6 @@ void schema_3_0_2::create(sqlite::database& db)
"CONSTRAINT C_NAME_UNIQUE_FOR_PARENT UNIQUE (title, "
"parentPlaylistPath), CONSTRAINT C_NEXT_LIST_UNIQUE_FOR_PARENT "
"UNIQUE (parentPlaylistPath, nextPlaylistPath, nextListUuid) );";
db << "INSERT INTO sqlite_sequence VALUES('Information',1);";
db << "CREATE VIEW ChangeLog (id, trackId) AS SELECT 0, 0 WHERE FALSE;";
db << "CREATE VIEW PlaylistAllParent AS WITH FindAllParent AS ( SELECT "
"id, parentListId FROM Playlist UNION ALL SELECT "
Expand Down
41 changes: 41 additions & 0 deletions test/djinterop/engine/v2/information_table_test.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
/*
This file is part of libdjinterop.

libdjinterop is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.

libdjinterop is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Lesser General Public License for more details.

You should have received a copy of the GNU Lesser General Public License
along with libdjinterop. If not, see <http://www.gnu.org/licenses/>.
*/

#define BOOST_TEST_MODULE engine_v2_information_table_test
#include <boost/test/data/test_case.hpp>
#include <boost/test/included/unit_test.hpp>

#include <djinterop/engine/engine.hpp>
#include <djinterop/engine/v2/engine_library.hpp>

namespace utf = boost::unit_test;
namespace e = djinterop::engine;
namespace ev2 = djinterop::engine::v2;

BOOST_TEST_DECORATOR(*utf::description("get() on a newly-created library"))
BOOST_DATA_TEST_CASE(
get__new_library__row_at_id_one, e::supported_v2_schemas, schema)
{
// Arrange
auto library = ev2::engine_library::create_temporary(schema);

// Act
auto row = library.information().get();

// Assert
BOOST_CHECK_EQUAL(row.id, 1);
}
41 changes: 41 additions & 0 deletions test/djinterop/engine/v3/information_table_test.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
/*
This file is part of libdjinterop.

libdjinterop is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.

libdjinterop is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Lesser General Public License for more details.

You should have received a copy of the GNU Lesser General Public License
along with libdjinterop. If not, see <http://www.gnu.org/licenses/>.
*/

#define BOOST_TEST_MODULE engine_v3_information_table_test
#include <boost/test/data/test_case.hpp>
#include <boost/test/included/unit_test.hpp>

#include <djinterop/engine/engine.hpp>
#include <djinterop/engine/v3/engine_library.hpp>

namespace utf = boost::unit_test;
namespace e = djinterop::engine;
namespace ev3 = djinterop::engine::v3;

BOOST_TEST_DECORATOR(*utf::description("get() on a newly-created library"))
BOOST_DATA_TEST_CASE(
get__new_library__row_at_id_one, e::supported_v3_schemas, schema)
{
// Arrange
auto library = ev3::engine_library::create_temporary(schema);

// Act
auto row = library.information().get();

// Assert
BOOST_CHECK_EQUAL(row.id, 1);
}
Loading