Пример #1
0
static void test_methods(A2Methods_T methods_under_test) {
  methods = methods_under_test;
  assert(methods);
  assert(has_minimum_methods(methods));
  assert(has_small_plain_methods(methods) || has_small_blocked_methods(methods));
  assert(!(has_small_plain_methods(methods) && has_small_blocked_methods(methods)));
  assert(!(has_plain_methods(methods) && has_blocked_methods(methods)));
  if (!(has_plain_methods(methods) || has_blocked_methods(methods)))
    fprintf(stderr, "Some full mapping methods are missing\n");

  A2 array = methods->new_with_blocksize(W, H, sizeof(unsigned), BS);
  copy_unsigned(methods, array,  2,  1, 99);
  copy_unsigned(methods, array,  3,  3, 88);
  copy_unsigned(methods, array, 10, 10, 77);
  check(array,  2,  1, 99);
  check(array,  3,  3, 88);
  check(array, 10, 10, 77);
  for (int i = 0; i < W; i++) {
    for (int j = 0; j < H; j++) {
      unsigned n = 1000 * i + j; 
      copy_unsigned(methods, array, i, j, n);
      unsigned *p = methods->at(array, i, j);
      assert(*p == n);
    }
  }
  for (int i = 0; i < W; i++) {
    for (int j = 0; j < H; j++) {
      unsigned n = 1000 * i + j;
      unsigned *p = methods->at(array, i, j);
      assert(*p == n);
    }
  }
  double_row_major_plus();
  methods->free(&array);
}
Пример #2
0
static void test_methods(A2Methods_T methods_under_test) 
{
        methods = methods_under_test;
        assert(methods);
        assert(has_minimum_methods(methods));
        assert(has_small_plain_methods(methods)
               || has_small_blocked_methods(methods));
        assert(!(has_small_plain_methods(methods)
                 && has_small_blocked_methods(methods)));
        assert(!(has_plain_methods(methods)
                 && has_blocked_methods(methods)));

        if (!(has_plain_methods(methods) || has_blocked_methods(methods)))
                fprintf(stderr, "Some full mapping methods are missing\n");

        A2 array = methods->new_with_blocksize(W, H, sizeof(unsigned), BS);
<<<<<<< HEAD