1 /*****************************************************************************
2 * LibvlcLogTest.java: VLC Java Bindings
3 *****************************************************************************
4 * Copyright (C) 1998-2008 the VideoLAN team
6 * Authors: Filippo Carone <filippo@carone.org>
11 * This program is free software; you can redistribute it and/or modify
12 * it under the terms of the GNU General Public License as published by
13 * the Free Software Foundation; either version 2 of the License, or
14 * (at your option) any later version.
16 * This program is distributed in the hope that it will be useful,
17 * but WITHOUT ANY WARRANTY; without even the implied warranty of
18 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 * GNU General Public License for more details.
21 * You should have received a copy of the GNU General Public License
22 * along with this program; if not, write to the Free Software
23 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111, USA.
24 *****************************************************************************/
26 package org.videolan.jvlc.internal;
28 import org.junit.Assert;
29 import org.junit.Test;
30 import org.videolan.jvlc.internal.LibVlc.LibVlcLog;
31 import org.videolan.jvlc.internal.LibVlc.LibVlcLogIterator;
32 import org.videolan.jvlc.internal.LibVlc.libvlc_exception_t;
35 public class LibvlcLogTest extends AbstractVLCInternalTest
39 public void testLogOpen()
41 libvlc_exception_t exception = new libvlc_exception_t();
42 LibVlcLog libvlcLog = libvlc.libvlc_log_open(libvlcInstance, exception);
43 Assert.assertNotNull(libvlcLog);
47 public void testLogClose()
49 libvlc_exception_t exception = new libvlc_exception_t();
50 LibVlcLog libvlcLog = libvlc.libvlc_log_open(libvlcInstance, exception);
51 libvlc.libvlc_log_close(libvlcLog, exception);
52 Assert.assertEquals(exception.message, 0, exception.raised);
56 public void testLogClear()
58 libvlc_exception_t exception = new libvlc_exception_t();
59 LibVlcLog libvlcLog = libvlc.libvlc_log_open(libvlcInstance, exception);
60 libvlc.libvlc_log_clear(libvlcLog, exception);
61 Assert.assertEquals(exception.message, 0, exception.raised);
62 Assert.assertEquals(0, libvlc.libvlc_log_count(libvlcLog, exception));
66 public void testLogGetIterator()
68 libvlc_exception_t exception = new libvlc_exception_t();
69 LibVlcLog libvlcLog = libvlc.libvlc_log_open(libvlcInstance, exception);
70 libvlc.libvlc_log_clear(libvlcLog, exception);
71 Assert.assertEquals(exception.message, 0, exception.raised);
72 Assert.assertEquals(0, libvlc.libvlc_log_count(libvlcLog, exception));
73 LibVlcLogIterator logIterator = libvlc.libvlc_log_get_iterator(libvlcLog, exception);
74 Assert.assertNotNull(logIterator);