#include "tests/HeapArrayTests.h" #include "tests/Test.h" #include "utils/HeapArray.h" #include "utils/StringBuffer.h" typedef StringBuffer<50> String; static void testToString1(Test& test) { HeapArray a(3); a[0] = 1; a[1] = 243; a[2] = -423; test.checkEqual(String("[1, 243, -423]"), String(a), "to string 1"); } static void testToString2(Test& test) { HeapArray a(1); a[0] = 1; test.checkEqual(String("[1]"), String(a), "to string 2"); } void HeapArrayTests::test() { Test test("HeapArray"); testToString1(test); testToString2(test); test.finalize(); }