about summary refs log tree commit diff stats
path: root/032array.cc
diff options
context:
space:
mode:
authorKartik Agaram <vc@akkartik.com>2018-06-09 08:59:33 -0700
committerKartik Agaram <vc@akkartik.com>2018-06-09 09:50:35 -0700
commit3f34ac9369978b396d00a4fd02c9fb06b8eea621 (patch)
treeeb1899f86308c712e54ef94a1c85243c26621c45 /032array.cc
parent46b6e2a34915a6d5cf7b1b15b3d2c28f54e02622 (diff)
downloadmu-3f34ac9369978b396d00a4fd02c9fb06b8eea621.tar.gz
4256 - get rid of container metadata entirely
We have some ugly duplication in computing size_of on containers between
layers 30/33 and 55.
Diffstat (limited to '032array.cc')
-rw-r--r--032array.cc80
1 files changed, 0 insertions, 80 deletions
diff --git a/032array.cc b/032array.cc
index a696b450..3bde42fb 100644
--- a/032array.cc
+++ b/032array.cc
@@ -200,86 +200,6 @@ def foo [
 ]
 # shouldn't die
 
-//:: containers inside arrays
-//: make sure we compute container sizes inside arrays
-
-:(before "End compute_container_sizes Non-atom Special-cases")
-else if (type->left->name == "array")
-  compute_container_sizes(array_element(type), pending_metadata, location_for_error_messages);
-
-:(before "End Unit Tests")
-void test_container_sizes_from_array() {
-  // a container we don't have the size for
-  reagent container("x:point");
-  CHECK(!contains_key(Container_metadata, container.type));
-  // scanning an array of the container precomputes the size of the container
-  reagent r("x:array:point");
-  compute_container_sizes(r, "");
-  CHECK(contains_key(Container_metadata, container.type));
-  CHECK_EQ(get(Container_metadata, container.type).size, 2);
-}
-
-void test_container_sizes_from_address_to_array() {
-  // a container we don't have the size for
-  reagent container("x:point");
-  CHECK(!contains_key(Container_metadata, container.type));
-  // scanning an address to an array of the container precomputes the size of the container
-  reagent r("x:address:array:point");
-  compute_container_sizes(r, "");
-  CHECK(contains_key(Container_metadata, container.type));
-  CHECK_EQ(get(Container_metadata, container.type).size, 2);
-}
-
-void test_container_sizes_from_static_array() {
-  // a container we don't have the size for
-  reagent container("x:point");
-  int old_size = SIZE(Container_metadata);
-  // scanning an address to an array of the container precomputes the size of the container
-  reagent r("x:array:point:10");
-  compute_container_sizes(r, "");
-  CHECK(contains_key(Container_metadata, container.type));
-  CHECK_EQ(get(Container_metadata, container.type).size, 2);
-  // no non-container types precomputed
-  CHECK_EQ(SIZE(Container_metadata)-old_size, 1);
-}
-
-void test_container_sizes_from_address_to_static_array() {
-  // a container we don't have the size for
-  reagent container("x:point");
-  int old_size = SIZE(Container_metadata);
-  // scanning an address to an array of the container precomputes the size of the container
-  reagent r("x:address:array:point:10");
-  compute_container_sizes(r, "");
-  CHECK(contains_key(Container_metadata, container.type));
-  CHECK_EQ(get(Container_metadata, container.type).size, 2);
-  // no non-container types precomputed
-  CHECK_EQ(SIZE(Container_metadata)-old_size, 1);
-}
-
-void test_container_sizes_from_repeated_address_and_array_types() {
-  // a container we don't have the size for
-  reagent container("x:point");
-  int old_size = SIZE(Container_metadata);
-  // scanning repeated address and array types modifying the container precomputes the size of the container
-  reagent r("x:address:array:address:array:point:10");
-  compute_container_sizes(r, "");
-  CHECK(contains_key(Container_metadata, container.type));
-  CHECK_EQ(get(Container_metadata, container.type).size, 2);
-  // no non-container types precomputed
-  CHECK_EQ(SIZE(Container_metadata)-old_size, 1);
-}
-
-void test_container_sizes_on_unknown_type() {
-  // a container we don't have the size for
-  reagent container("x:point");
-  int old_size = SIZE(Container_metadata);
-  // scanning address to array with a typo
-  reagent r("x:address:array:adress:number");
-  compute_container_sizes(r, "");  // should not crash
-  // no non-container types precomputed
-  CHECK_EQ(SIZE(Container_metadata), old_size);
-}
-
 //:: To access elements of an array, use 'index'
 
 :(scenario index)