about summary refs log tree commit homepage
path: root/test
diff options
context:
space:
mode:
authorEric Wong <e@80x24.org>2015-12-07 09:50:26 +0000
committerEric Wong <e@80x24.org>2015-12-07 09:50:26 +0000
commitb08fe09e296524daf4de7ed16e0bed224f5008a2 (patch)
treec349b14b6e72f168469e3a8a732099d5bd5d681a /test
parent3e013d3f24f0f935dce985d4c6bd155889e05dbb (diff)
downloaddtas-b08fe09e296524daf4de7ed16e0bed224f5008a2.tar.gz
This defaults to 16384?  This is what mpd uses by default as well.
Of course folks interacting with dtas-player directly can override
this:

	dtas-tl max INTEGER
	dtas-tl max

This is NOT meant to be a hard security measure for local users
talking to dtas-player directly.  It is only to prevent
accidentally stupid things like flooding the playlist with
a broken script and to prevent remote users from DoS-ing
us via the to-be-written mpd proxy/emulation layer.

Remember: dtas-player itself will ALWAYS remain capable of
executing arbitrary code :)
Diffstat (limited to 'test')
-rw-r--r--test/test_tracklist.rb12
1 files changed, 12 insertions, 0 deletions
diff --git a/test/test_tracklist.rb b/test/test_tracklist.rb
index a3c89f6..4d00227 100644
--- a/test/test_tracklist.rb
+++ b/test/test_tracklist.rb
@@ -106,4 +106,16 @@ class TestTracklist < Testcase
     tl.remove_track(1 << 128)
     assert_equal %w(b c e f), list_to_path(tl), "no change"
   end
+
+  def test_max
+    tl = DTAS::Tracklist.new
+    assert_kind_of Integer, tl.add_track('z')
+    assert_kind_of Integer, tl.max
+    tl.max = 1
+    assert_equal false, tl.add_track('y')
+    assert_equal 1, tl.instance_variable_get(:@list).size
+    tl.max = 2
+    assert_kind_of Integer, tl.add_track('y')
+    assert_equal 2, tl.instance_variable_get(:@list).size
+  end
 end