17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
18 *
19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
20 * or visit www.oracle.com if you need additional information or have any
21 * questions.
22 */
23
24 #include "precompiled.hpp"
25 #include "gc/shared/workerDataArray.inline.hpp"
26 #include "memory/resourceArea.hpp"
27 #include "unittest.hpp"
28 #include "utilities/ostream.hpp"
29
30 static const double epsilon = 0.0001;
31
32 template<typename T>
33 class WorkerDataArrayTest : public ::testing::Test {
34 protected:
35 WorkerDataArrayTest() :
36 title("Test array"),
37 array(3, title),
38 sub_item_title("Sub item array") {
39
40 array.link_thread_work_items(new WorkerDataArray<size_t>(3, sub_item_title));
41 }
42
43 const char* print_summary() {
44 stringStream out;
45 array.print_summary_on(&out);
46 return out.as_string();
47 }
48
49 const char* print_details() {
50 stringStream out;
51 array.print_details_on(&out);
52 return out.as_string();
53 }
54
55 const char* print_expected_summary() {
56 return prepend_with(title, expected_summary());
57 }
58
59 const char* print_expected_details() {
60 return prepend_with("", expected_details());
|
17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
18 *
19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
20 * or visit www.oracle.com if you need additional information or have any
21 * questions.
22 */
23
24 #include "precompiled.hpp"
25 #include "gc/shared/workerDataArray.inline.hpp"
26 #include "memory/resourceArea.hpp"
27 #include "unittest.hpp"
28 #include "utilities/ostream.hpp"
29
30 static const double epsilon = 0.0001;
31
32 template<typename T>
33 class WorkerDataArrayTest : public ::testing::Test {
34 protected:
35 WorkerDataArrayTest() :
36 title("Test array"),
37 array(title, 3),
38 sub_item_title("Sub item array") {
39
40 array.create_thread_work_items(sub_item_title);
41 }
42
43 const char* print_summary() {
44 stringStream out;
45 array.print_summary_on(&out);
46 return out.as_string();
47 }
48
49 const char* print_details() {
50 stringStream out;
51 array.print_details_on(&out);
52 return out.as_string();
53 }
54
55 const char* print_expected_summary() {
56 return prepend_with(title, expected_summary());
57 }
58
59 const char* print_expected_details() {
60 return prepend_with("", expected_details());
|