/*
 SPDX-License-Identifier: GPL-3.0-or-later
 myMPD (c) 2018-2026 Juergen Mang <mail@jcgames.de>
 https://github.com/jcorporation/mympd
*/

#ifndef TEST_UTILITY_H
#define TEST_UTILITY_H

#include "dist/sds/sds.h"
#include "mpd_song.h"
#include "src/lib/list/list.h"

#include <stdbool.h>

#define MYMPD_BUILD_DIR "${PROJECT_BINARY_DIR}"

#define TESTFILE_CONTENT "asdfjlkasdfjklsafd\nasfdsdfawaerwer"
#define TESTFILE_CONTENT_LEN 34
#define TESTFILE_CONTENT_NW "asdfjlkasdfjklsafdasfdsdfawaerwer"
#define TESTFILE_CONTENT_NW_LEN 33

extern sds workdir;

struct t_input_result {
    const char *input;
    const char *result;
};

void init_testenv(void);
void clean_testenv(void);
bool create_testfile(void);
bool song_append_tag(struct mpd_song *song, enum mpd_tag_type type, const char *value);
struct t_album *new_test_album(void);
struct mpd_song *new_test_song(void);

unsigned populate_list(struct t_list *l);
unsigned populate_large_list(struct t_list *l, bool shuffled, int count);
bool check_list_integrity(struct t_list *l, unsigned expected_len);

#endif
