1 /* EasyTAG - tag editor for audio files
2  * Copyright (C) 2016 David King <amigadave@amigadave.com>
3  *
4  * This program is free software; you can redistribute it and/or modify it
5  * under the terms of the GNU General Public License as published by the Free
6  * Software Foundation; either version 2 of the License, or (at your option)
7  * any later version.
8  *
9  * This program is distributed in the hope that it will be useful, but WITHOUT
10  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
12  * more details.
13  *
14  * You should have received a copy of the GNU General Public License along with
15  * this program; if not, write to the Free Software Foundation, Inc., 51
16  * Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
17  */
18 
19 #include <glib.h>
20 
21 #include "genres.h"
22 
23 static void
genres_genre_no(void)24 genres_genre_no (void)
25 {
26     gsize i;
27 
28     for (i = 0; i < G_N_ELEMENTS (id3_genres); i++)
29     {
30         g_assert_cmpstr (genre_no (i), !=, "Unknown");
31     }
32 
33     g_assert_cmpint (i, ==, GENRE_MAX + 1);
34 
35     for (; i < 255; i++)
36     {
37         g_assert_cmpstr (genre_no (i), ==, "Unknown");
38     }
39 }
40 
41 int
main(int argc,char ** argv)42 main (int argc, char** argv)
43 {
44     g_test_init (&argc, &argv, NULL);
45 
46     g_test_add_func ("/genres/genre_no", genres_genre_no);
47 
48     return g_test_run ();
49 }
50