forked from libxmp/libxmp
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest_api_create_module.c
More file actions
35 lines (26 loc) · 862 Bytes
/
Copy pathtest_api_create_module.c
File metadata and controls
35 lines (26 loc) · 862 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
#include "test.h"
TEST(test_api_create_module)
{
xmp_context ctx;
int state, ret;
struct xmp_module_info mi;
struct xmp_module *mod;
ctx = xmp_create_context();
state = xmp_get_player(ctx, XMP_PLAYER_STATE);
fail_unless(state == XMP_STATE_UNLOADED, "state error");
ret = xmp_create_module(ctx, 4);
fail_unless(ret == 0, "create module");
state = xmp_get_player(ctx, XMP_PLAYER_STATE);
fail_unless(state == XMP_STATE_LOADED, "state error");
xmp_get_module_info(ctx, &mi);
mod = mi.mod;
fail_unless(mod->chn == 4, "number of channels");
fail_unless(mod->len == 1, "module length");
fail_unless(mod->pat == 1, "number of patterns");
fail_unless(mod->trk == 4, "number of tracks");
/* unload */
xmp_release_module(ctx);
state = xmp_get_player(ctx, XMP_PLAYER_STATE);
fail_unless(state == XMP_STATE_UNLOADED, "state error");
}
END_TEST