core/database: Pass database index when allocating dbes
This is useful for user playlists so they can store their playlist-id directly, letting us remove the entire playlist_get_id() function. Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
This commit is contained in:
parent
9b4a1785a1
commit
58cd43c330
|
@ -40,7 +40,7 @@ static struct db_entry *__dbe_read(struct database *db, unsigned int index)
|
||||||
|
|
||||||
file_readf(&db->db_file, "%d", &valid);
|
file_readf(&db->db_file, "%d", &valid);
|
||||||
if (valid)
|
if (valid)
|
||||||
dbe = db->db_ops->dbe_read(&db->db_file);
|
dbe = db->db_ops->dbe_read(&db->db_file, index);
|
||||||
|
|
||||||
g_ptr_array_index(db->db_entries, index) = dbe;
|
g_ptr_array_index(db->db_entries, index) = dbe;
|
||||||
return dbe;
|
return dbe;
|
||||||
|
@ -137,7 +137,7 @@ struct db_entry *db_insert(struct database *db, const gchar *key)
|
||||||
struct db_entry *item = NULL;
|
struct db_entry *item = NULL;
|
||||||
|
|
||||||
if (key)
|
if (key)
|
||||||
item = db->db_ops->dbe_alloc(key);
|
item = db->db_ops->dbe_alloc(key, db_actual_size(db));
|
||||||
|
|
||||||
if (item) {
|
if (item) {
|
||||||
g_ptr_array_add(db->db_entries, item);
|
g_ptr_array_add(db->db_entries, item);
|
||||||
|
|
|
@ -18,7 +18,7 @@ static struct user_playlist *__user_db_alloc(gchar *name)
|
||||||
return playlist;
|
return playlist;
|
||||||
}
|
}
|
||||||
|
|
||||||
static struct db_entry *user_db_alloc(const gchar *name)
|
static struct db_entry *user_db_alloc(const gchar *name, unsigned int index)
|
||||||
{
|
{
|
||||||
return &__user_db_alloc(g_strdup(name))->pl_dbe;
|
return &__user_db_alloc(g_strdup(name))->pl_dbe;
|
||||||
}
|
}
|
||||||
|
@ -35,7 +35,7 @@ static gchar *user_db_key(struct db_entry *dbe)
|
||||||
return g_strdup(USER_PLAYLIST(dbe)->pl_playlist.pl_name);
|
return g_strdup(USER_PLAYLIST(dbe)->pl_playlist.pl_name);
|
||||||
}
|
}
|
||||||
|
|
||||||
static struct db_entry *user_db_read(struct file *file)
|
static struct db_entry *user_db_read(struct file *file, unsigned int index)
|
||||||
{
|
{
|
||||||
gchar *name = file_readl(file);
|
gchar *name = file_readl(file);
|
||||||
struct user_playlist *playlist = __user_db_alloc(name);
|
struct user_playlist *playlist = __user_db_alloc(name);
|
||||||
|
|
|
@ -203,7 +203,7 @@ static struct db_entry *__album_alloc_v0(const gchar *key)
|
||||||
return &__album_alloc(NULL, NULL, name, year)->al_dbe;
|
return &__album_alloc(NULL, NULL, name, year)->al_dbe;
|
||||||
}
|
}
|
||||||
|
|
||||||
static struct db_entry *album_alloc(const gchar *key)
|
static struct db_entry *album_alloc(const gchar *key, unsigned int index)
|
||||||
{
|
{
|
||||||
unsigned int artist_id, genre_id, year, n;
|
unsigned int artist_id, genre_id, year, n;
|
||||||
gchar *name;
|
gchar *name;
|
||||||
|
@ -241,7 +241,7 @@ static struct album *__album_parse_v0(gchar *line)
|
||||||
return __album_alloc(NULL, NULL, name, year);
|
return __album_alloc(NULL, NULL, name, year);
|
||||||
}
|
}
|
||||||
|
|
||||||
static struct db_entry *album_read(struct file *file)
|
static struct db_entry *album_read(struct file *file, unsigned int index)
|
||||||
{
|
{
|
||||||
unsigned int year, artist_id, genre_id, n;
|
unsigned int year, artist_id, genre_id, n;
|
||||||
struct album *album;
|
struct album *album;
|
||||||
|
|
|
@ -20,7 +20,7 @@ static struct artist *__artist_alloc(gchar *name)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
static struct db_entry *artist_alloc(const gchar *name)
|
static struct db_entry *artist_alloc(const gchar *name, unsigned int index)
|
||||||
{
|
{
|
||||||
return &__artist_alloc(g_strdup(name))->ar_dbe;
|
return &__artist_alloc(g_strdup(name))->ar_dbe;
|
||||||
}
|
}
|
||||||
|
@ -37,7 +37,7 @@ static gchar *artist_key(struct db_entry *dbe)
|
||||||
return ARTIST(dbe)->ar_name;
|
return ARTIST(dbe)->ar_name;
|
||||||
}
|
}
|
||||||
|
|
||||||
struct db_entry *artist_read(struct file *file)
|
struct db_entry *artist_read(struct file *file, unsigned int index)
|
||||||
{
|
{
|
||||||
return &__artist_alloc(file_readl(file))->ar_dbe;
|
return &__artist_alloc(file_readl(file))->ar_dbe;
|
||||||
}
|
}
|
||||||
|
|
|
@ -18,7 +18,7 @@ static struct genre *__genre_alloc(gchar *name)
|
||||||
return genre;
|
return genre;
|
||||||
}
|
}
|
||||||
|
|
||||||
static struct db_entry *genre_alloc(const gchar *name)
|
static struct db_entry *genre_alloc(const gchar *name, unsigned int index)
|
||||||
{
|
{
|
||||||
return &__genre_alloc(g_strdup(name))->ge_dbe;
|
return &__genre_alloc(g_strdup(name))->ge_dbe;
|
||||||
}
|
}
|
||||||
|
@ -35,7 +35,7 @@ static gchar *genre_key(struct db_entry *dbe)
|
||||||
return GENRE(dbe)->ge_name;
|
return GENRE(dbe)->ge_name;
|
||||||
}
|
}
|
||||||
|
|
||||||
static struct db_entry *genre_read(struct file *file)
|
static struct db_entry *genre_read(struct file *file, unsigned int index)
|
||||||
{
|
{
|
||||||
return &__genre_alloc(file_readl(file))->ge_dbe;
|
return &__genre_alloc(file_readl(file))->ge_dbe;
|
||||||
}
|
}
|
||||||
|
|
|
@ -17,7 +17,7 @@ static struct library *__library_alloc(gchar *path)
|
||||||
return library;
|
return library;
|
||||||
}
|
}
|
||||||
|
|
||||||
static struct db_entry *library_alloc(const gchar *path)
|
static struct db_entry *library_alloc(const gchar *path, unsigned int index)
|
||||||
{
|
{
|
||||||
return &__library_alloc(g_strdup(path))->li_dbe;
|
return &__library_alloc(g_strdup(path))->li_dbe;
|
||||||
}
|
}
|
||||||
|
@ -32,7 +32,7 @@ static gchar *library_key(struct db_entry *dbe)
|
||||||
return LIBRARY(dbe)->li_path;
|
return LIBRARY(dbe)->li_path;
|
||||||
}
|
}
|
||||||
|
|
||||||
static struct db_entry *library_read(struct file *file)
|
static struct db_entry *library_read(struct file *file, unsigned int index)
|
||||||
{
|
{
|
||||||
int enabled;
|
int enabled;
|
||||||
gchar *path;
|
gchar *path;
|
||||||
|
|
|
@ -42,7 +42,7 @@ static struct track *__track_alloc()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
struct db_entry *track_alloc(const gchar *key)
|
struct db_entry *track_alloc(const gchar *key, unsigned int index)
|
||||||
{
|
{
|
||||||
const TagLib_AudioProperties *audio;
|
const TagLib_AudioProperties *audio;
|
||||||
struct library *library;
|
struct library *library;
|
||||||
|
@ -132,7 +132,7 @@ static void track_read_v0(struct file *file, struct track *track)
|
||||||
track->tr_album = album;
|
track->tr_album = album;
|
||||||
}
|
}
|
||||||
|
|
||||||
static struct db_entry *track_read(struct file *file)
|
static struct db_entry *track_read(struct file *file, unsigned int index)
|
||||||
{
|
{
|
||||||
struct track *track = __track_alloc();
|
struct track *track = __track_alloc();
|
||||||
unsigned int library_id, album_id;
|
unsigned int library_id, album_id;
|
||||||
|
|
|
@ -48,7 +48,7 @@ static inline void *DBE_DATA(struct db_entry *dbe)
|
||||||
|
|
||||||
struct db_ops {
|
struct db_ops {
|
||||||
/* Allocate a new struct db_entry from a given key. */
|
/* Allocate a new struct db_entry from a given key. */
|
||||||
struct db_entry *(*dbe_alloc)(const gchar *);
|
struct db_entry *(*dbe_alloc)(const gchar *, unsigned int);
|
||||||
|
|
||||||
/* Free a struct db_entry. */
|
/* Free a struct db_entry. */
|
||||||
void (*dbe_free)(struct db_entry *);
|
void (*dbe_free)(struct db_entry *);
|
||||||
|
@ -57,7 +57,7 @@ struct db_ops {
|
||||||
gchar *(*dbe_key)(struct db_entry *);
|
gchar *(*dbe_key)(struct db_entry *);
|
||||||
|
|
||||||
/* Read a single struct db_entry from disk. */
|
/* Read a single struct db_entry from disk. */
|
||||||
struct db_entry *(*dbe_read)(struct file *);
|
struct db_entry *(*dbe_read)(struct file *, unsigned int);
|
||||||
|
|
||||||
/* Write a single struct db_entry to disk. */
|
/* Write a single struct db_entry to disk. */
|
||||||
void (*dbe_write)(struct file *, struct db_entry *);
|
void (*dbe_write)(struct file *, struct db_entry *);
|
||||||
|
|
|
@ -26,7 +26,7 @@ static struct int_entry *__int_alloc(unsigned int val)
|
||||||
return ent;
|
return ent;
|
||||||
}
|
}
|
||||||
|
|
||||||
static struct db_entry *int_alloc(const gchar *key)
|
static struct db_entry *int_alloc(const gchar *key, unsigned int index)
|
||||||
{
|
{
|
||||||
unsigned int val;
|
unsigned int val;
|
||||||
sscanf(key, "%u", &val);
|
sscanf(key, "%u", &val);
|
||||||
|
@ -44,7 +44,7 @@ static gchar *int_key(struct db_entry *dbe)
|
||||||
return g_strdup_printf("%u", INT_ENTRY(dbe)->ie_val);
|
return g_strdup_printf("%u", INT_ENTRY(dbe)->ie_val);
|
||||||
}
|
}
|
||||||
|
|
||||||
static struct db_entry *int_read(struct file *f)
|
static struct db_entry *int_read(struct file *f, unsigned int index)
|
||||||
{
|
{
|
||||||
unsigned int val;
|
unsigned int val;
|
||||||
file_readf(f, "%u", &val);
|
file_readf(f, "%u", &val);
|
||||||
|
@ -70,7 +70,7 @@ static void test_db_entry()
|
||||||
struct int_entry *ent;
|
struct int_entry *ent;
|
||||||
struct file f;
|
struct file f;
|
||||||
|
|
||||||
ent = INT_ENTRY(int_ops.dbe_alloc("1"));
|
ent = INT_ENTRY(int_ops.dbe_alloc("1", 0));
|
||||||
g_assert_cmpuint(ent->ie_dbe.dbe_index, ==, 0);
|
g_assert_cmpuint(ent->ie_dbe.dbe_index, ==, 0);
|
||||||
g_assert(ent->ie_dbe.dbe_data == ent);
|
g_assert(ent->ie_dbe.dbe_data == ent);
|
||||||
g_assert_cmpuint(ent->ie_val, ==, 1);
|
g_assert_cmpuint(ent->ie_val, ==, 1);
|
||||||
|
@ -85,7 +85,7 @@ static void test_db_entry()
|
||||||
g_assert_cmpuint(test_free_count, ==, 1);
|
g_assert_cmpuint(test_free_count, ==, 1);
|
||||||
|
|
||||||
file_open(&f, OPEN_READ);
|
file_open(&f, OPEN_READ);
|
||||||
ent = INT_ENTRY(int_ops.dbe_read(&f));
|
ent = INT_ENTRY(int_ops.dbe_read(&f, 0));
|
||||||
file_close(&f);
|
file_close(&f);
|
||||||
|
|
||||||
g_assert(ent->ie_dbe.dbe_data == ent);
|
g_assert(ent->ie_dbe.dbe_data == ent);
|
||||||
|
|
|
@ -52,7 +52,7 @@ static void test_album()
|
||||||
|
|
||||||
koji = artist_find("Koji Kondo");
|
koji = artist_find("Koji Kondo");
|
||||||
genre = genre_find("Video Game Music");
|
genre = genre_find("Video Game Music");
|
||||||
album = ALBUM(album_ops->dbe_alloc("0/0/1998/Hyrule Symphony"));
|
album = ALBUM(album_ops->dbe_alloc("0/0/1998/Hyrule Symphony", 0));
|
||||||
test_verify_hyrule(album, koji, genre);
|
test_verify_hyrule(album, koji, genre);
|
||||||
g_assert_true( album_match_token(album, "hyrule"));
|
g_assert_true( album_match_token(album, "hyrule"));
|
||||||
g_assert_true( album_match_token(album, "symphony"));
|
g_assert_true( album_match_token(album, "symphony"));
|
||||||
|
@ -66,11 +66,11 @@ static void test_album()
|
||||||
album_ops->dbe_free(&album->al_dbe);
|
album_ops->dbe_free(&album->al_dbe);
|
||||||
|
|
||||||
file_open(&f, OPEN_READ);
|
file_open(&f, OPEN_READ);
|
||||||
album = ALBUM(album_ops->dbe_read(&f));
|
album = ALBUM(album_ops->dbe_read(&f, 0));
|
||||||
test_verify_empty(album);
|
test_verify_empty(album);
|
||||||
album_ops->dbe_free(&album->al_dbe);
|
album_ops->dbe_free(&album->al_dbe);
|
||||||
|
|
||||||
album = ALBUM(album_ops->dbe_read(&f));
|
album = ALBUM(album_ops->dbe_read(&f, 0));
|
||||||
file_close(&f);
|
file_close(&f);
|
||||||
test_verify_hyrule(album, koji, genre);
|
test_verify_hyrule(album, koji, genre);
|
||||||
album_ops->dbe_free(&album->al_dbe);
|
album_ops->dbe_free(&album->al_dbe);
|
||||||
|
@ -81,8 +81,8 @@ static void test_album_compare()
|
||||||
const struct db_ops *album_ops = test_album_ops();
|
const struct db_ops *album_ops = test_album_ops();
|
||||||
struct album *twilight, *skyward;
|
struct album *twilight, *skyward;
|
||||||
|
|
||||||
twilight = ALBUM(album_ops->dbe_alloc("2006/Twilight Princess"));
|
twilight = ALBUM(album_ops->dbe_alloc("2006/Twilight Princess", 0));
|
||||||
skyward = ALBUM(album_ops->dbe_alloc("2011/skyward sword"));
|
skyward = ALBUM(album_ops->dbe_alloc("2011/skyward sword", 0));
|
||||||
|
|
||||||
g_assert_cmpint(album_compare(twilight, twilight), ==, 0);
|
g_assert_cmpint(album_compare(twilight, twilight), ==, 0);
|
||||||
g_assert_cmpint(album_compare(twilight, skyward), ==, 1);
|
g_assert_cmpint(album_compare(twilight, skyward), ==, 1);
|
||||||
|
|
|
@ -33,7 +33,7 @@ static void test_artist()
|
||||||
unsigned int i;
|
unsigned int i;
|
||||||
struct file f;
|
struct file f;
|
||||||
|
|
||||||
artist = ARTIST(artist_ops->dbe_alloc("Koji Kondo"));
|
artist = ARTIST(artist_ops->dbe_alloc("Koji Kondo", 0));
|
||||||
|
|
||||||
test_verify_koji(artist);
|
test_verify_koji(artist);
|
||||||
g_assert_true( artist_match_token(artist, "koji"));
|
g_assert_true( artist_match_token(artist, "koji"));
|
||||||
|
@ -50,13 +50,13 @@ static void test_artist()
|
||||||
|
|
||||||
file_open(&f, OPEN_READ);
|
file_open(&f, OPEN_READ);
|
||||||
file_readf(&f, "%u", &i);
|
file_readf(&f, "%u", &i);
|
||||||
artist = ARTIST(artist_ops->dbe_read(&f));
|
artist = ARTIST(artist_ops->dbe_read(&f, 0));
|
||||||
test_verify_empty(artist);
|
test_verify_empty(artist);
|
||||||
g_free(artist->ar_name);
|
g_free(artist->ar_name);
|
||||||
artist_ops->dbe_free(&artist->ar_dbe);
|
artist_ops->dbe_free(&artist->ar_dbe);
|
||||||
|
|
||||||
file_readf(&f, "%u", &i);
|
file_readf(&f, "%u", &i);
|
||||||
artist = ARTIST(artist_ops->dbe_read(&f));
|
artist = ARTIST(artist_ops->dbe_read(&f, 0));
|
||||||
file_close(&f);
|
file_close(&f);
|
||||||
test_verify_koji(artist);
|
test_verify_koji(artist);
|
||||||
g_free(artist->ar_name);
|
g_free(artist->ar_name);
|
||||||
|
@ -68,8 +68,8 @@ static void test_artist_compare()
|
||||||
const struct db_ops *artist_ops = test_artist_ops();
|
const struct db_ops *artist_ops = test_artist_ops();
|
||||||
struct artist *koji, *hajime;
|
struct artist *koji, *hajime;
|
||||||
|
|
||||||
koji = ARTIST(artist_ops->dbe_alloc("Koji Kondo"));
|
koji = ARTIST(artist_ops->dbe_alloc("Koji Kondo", 0));
|
||||||
hajime = ARTIST(artist_ops->dbe_alloc("hajime wakai"));
|
hajime = ARTIST(artist_ops->dbe_alloc("hajime wakai", 0));
|
||||||
|
|
||||||
g_assert_cmpint(artist_compare(koji, koji), ==, 0);
|
g_assert_cmpint(artist_compare(koji, koji), ==, 0);
|
||||||
g_assert_cmpint(artist_compare(koji, hajime), ==, 1);
|
g_assert_cmpint(artist_compare(koji, hajime), ==, 1);
|
||||||
|
|
|
@ -32,7 +32,7 @@ static void test_genre()
|
||||||
unsigned int i;
|
unsigned int i;
|
||||||
struct file f;
|
struct file f;
|
||||||
|
|
||||||
genre = GENRE(genre_ops->dbe_alloc("Video Game Music"));
|
genre = GENRE(genre_ops->dbe_alloc("Video Game Music", 0));
|
||||||
test_verify_vg(genre);
|
test_verify_vg(genre);
|
||||||
g_assert_true( genre_match_token(genre, "video"));
|
g_assert_true( genre_match_token(genre, "video"));
|
||||||
g_assert_true( genre_match_token(genre, "music"));
|
g_assert_true( genre_match_token(genre, "music"));
|
||||||
|
@ -48,13 +48,13 @@ static void test_genre()
|
||||||
|
|
||||||
file_open(&f, OPEN_READ);
|
file_open(&f, OPEN_READ);
|
||||||
file_readf(&f, "%u", &i);
|
file_readf(&f, "%u", &i);
|
||||||
genre = GENRE(genre_ops->dbe_read(&f));
|
genre = GENRE(genre_ops->dbe_read(&f, 0));
|
||||||
test_verify_empty(genre);
|
test_verify_empty(genre);
|
||||||
g_free(genre->ge_name);
|
g_free(genre->ge_name);
|
||||||
genre_ops->dbe_free(&genre->ge_dbe);
|
genre_ops->dbe_free(&genre->ge_dbe);
|
||||||
|
|
||||||
file_readf(&f, "%u", &i);
|
file_readf(&f, "%u", &i);
|
||||||
genre = GENRE(genre_ops->dbe_read(&f));
|
genre = GENRE(genre_ops->dbe_read(&f, 0));
|
||||||
file_close(&f);
|
file_close(&f);
|
||||||
test_verify_vg(genre);
|
test_verify_vg(genre);
|
||||||
g_free(genre->ge_name);
|
g_free(genre->ge_name);
|
||||||
|
@ -66,8 +66,8 @@ static void test_genre_compare()
|
||||||
const struct db_ops *genre_ops = test_genre_ops();
|
const struct db_ops *genre_ops = test_genre_ops();
|
||||||
struct genre *video, *game;
|
struct genre *video, *game;
|
||||||
|
|
||||||
video = GENRE(genre_ops->dbe_alloc("Video Game Music"));
|
video = GENRE(genre_ops->dbe_alloc("Video Game Music", 0));
|
||||||
game = GENRE(genre_ops->dbe_alloc("game music"));
|
game = GENRE(genre_ops->dbe_alloc("game music", 0));
|
||||||
|
|
||||||
g_assert_cmpint(genre_compare(video, video), ==, 0);
|
g_assert_cmpint(genre_compare(video, video), ==, 0);
|
||||||
g_assert_cmpint(genre_compare(video, game), ==, 1);
|
g_assert_cmpint(genre_compare(video, game), ==, 1);
|
||||||
|
|
|
@ -24,8 +24,8 @@ static void test_library()
|
||||||
struct library *link, *zelda, *library;
|
struct library *link, *zelda, *library;
|
||||||
struct file f;
|
struct file f;
|
||||||
|
|
||||||
link = LIBRARY(library_ops->dbe_alloc("/home/Link/Music"));
|
link = LIBRARY(library_ops->dbe_alloc("/home/Link/Music", 0));
|
||||||
zelda = LIBRARY(library_ops->dbe_alloc("/home/Zelda/Music"));
|
zelda = LIBRARY(library_ops->dbe_alloc("/home/Zelda/Music", 0));
|
||||||
|
|
||||||
test_verify_link(link);
|
test_verify_link(link);
|
||||||
test_verify_zelda(zelda);
|
test_verify_zelda(zelda);
|
||||||
|
@ -38,14 +38,14 @@ static void test_library()
|
||||||
file_close(&f);
|
file_close(&f);
|
||||||
|
|
||||||
file_open(&f, OPEN_READ);
|
file_open(&f, OPEN_READ);
|
||||||
library = LIBRARY(library_ops->dbe_read(&f));
|
library = LIBRARY(library_ops->dbe_read(&f, 0));
|
||||||
test_verify_link(library);
|
test_verify_link(library);
|
||||||
g_assert_cmpstr_free(library_file(library, "navi.mp3"), ==,
|
g_assert_cmpstr_free(library_file(library, "navi.mp3"), ==,
|
||||||
"/home/Link/Music/navi.mp3");
|
"/home/Link/Music/navi.mp3");
|
||||||
g_free(library->li_path);
|
g_free(library->li_path);
|
||||||
library_ops->dbe_free(&library->li_dbe);
|
library_ops->dbe_free(&library->li_dbe);
|
||||||
|
|
||||||
library = LIBRARY(library_ops->dbe_read(&f));
|
library = LIBRARY(library_ops->dbe_read(&f, 0));
|
||||||
file_close(&f);
|
file_close(&f);
|
||||||
test_verify_zelda(library);
|
test_verify_zelda(library);
|
||||||
g_assert_cmpstr_free(library_file(library, "impa.ogg"), ==,
|
g_assert_cmpstr_free(library_file(library, "impa.ogg"), ==,
|
||||||
|
|
|
@ -12,7 +12,7 @@
|
||||||
static struct track *test_alloc(const gchar *key)
|
static struct track *test_alloc(const gchar *key)
|
||||||
{
|
{
|
||||||
const struct db_ops *track_ops = test_track_ops();
|
const struct db_ops *track_ops = test_track_ops();
|
||||||
struct db_entry *dbe = track_ops->dbe_alloc(key);
|
struct db_entry *dbe = track_ops->dbe_alloc(key, 0);
|
||||||
g_assert_nonnull(dbe);
|
g_assert_nonnull(dbe);
|
||||||
return TRACK(dbe);
|
return TRACK(dbe);
|
||||||
}
|
}
|
||||||
|
@ -98,14 +98,14 @@ static void test_track()
|
||||||
track_ops->dbe_free(&track->tr_dbe);
|
track_ops->dbe_free(&track->tr_dbe);
|
||||||
|
|
||||||
file_open(&f, OPEN_READ);
|
file_open(&f, OPEN_READ);
|
||||||
track = TRACK(track_ops->dbe_read(&f));
|
track = TRACK(track_ops->dbe_read(&f, 0));
|
||||||
track->tr_dbe.dbe_index = 0;
|
track->tr_dbe.dbe_index = 0;
|
||||||
test_verify_notrack(track);
|
test_verify_notrack(track);
|
||||||
|
|
||||||
g_free(track->tr_path);
|
g_free(track->tr_path);
|
||||||
track_ops->dbe_free(&track->tr_dbe);
|
track_ops->dbe_free(&track->tr_dbe);
|
||||||
|
|
||||||
track = TRACK(track_ops->dbe_read(&f));
|
track = TRACK(track_ops->dbe_read(&f, 0));
|
||||||
track->tr_dbe.dbe_index = 0;
|
track->tr_dbe.dbe_index = 0;
|
||||||
test_verify_track(track);
|
test_verify_track(track);
|
||||||
file_close(&f);
|
file_close(&f);
|
||||||
|
|
Loading…
Reference in New Issue