summaryrefslogtreecommitdiffstats
path: root/test/array_test.cpp
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2016-09-18 12:43:52 -0400
committerDavid Robillard <d@drobilla.net>2016-09-18 20:33:18 -0400
commitf2a771911c02ab04c344922849295c82c2cb3329 (patch)
tree340ad260810f86daeb32dad6826bfdec7ff37706 /test/array_test.cpp
parentf1248a8dd3a6e67cd0e61e66ea92ad54b4b2b20b (diff)
downloadraul-f2a771911c02ab04c344922849295c82c2cb3329.tar.gz
raul-f2a771911c02ab04c344922849295c82c2cb3329.tar.bz2
raul-f2a771911c02ab04c344922849295c82c2cb3329.zip
Fix minor memory errors in test suite
Diffstat (limited to 'test/array_test.cpp')
-rw-r--r--test/array_test.cpp9
1 files changed, 6 insertions, 3 deletions
diff --git a/test/array_test.cpp b/test/array_test.cpp
index 559e834..ea9eb13 100644
--- a/test/array_test.cpp
+++ b/test/array_test.cpp
@@ -1,6 +1,6 @@
/*
This file is part of Raul.
- Copyright 2007-2013 David Robillard <http://drobilla.net>
+ Copyright 2007-2016 David Robillard <http://drobilla.net>
Raul is free software: you can redistribute it and/or modify it under the
terms of the GNU General Public License as published by the Free Software
@@ -21,12 +21,15 @@
int
main(int argc, char** argv)
{
- Raul::Array<int> array1(32);
+ Raul::Array<int> array1(32, 2);
array1[0] = 42;
if (array1[0] != 42) {
fprintf(stderr, "array1[0] != 42\n");
return 1;
+ } else if (array1[1] != 2) {
+ fprintf(stderr, "array1[1] != 2\n");
+ return 1;
} else if (array1.size() != 32) {
fprintf(stderr, "array1.size() != 1\n");
return 1;
@@ -44,7 +47,7 @@ main(int argc, char** argv)
return 1;
}
- array1.alloc(8);
+ array1.alloc(8, 0);
if (array1.size() != 8) {
fprintf(stderr, "array1.size() != 8\n");
return 1;