示例#1
0
TYPED_TEST(HDF5OutputLayerTest, TestForward) {
  typedef typename TypeParam::Dtype Dtype;
  LOG(INFO) << "Loading HDF5 file " << this->input_file_name_;
  hid_t file_id = H5Fopen(this->input_file_name_.c_str(), H5F_ACC_RDONLY,
                          H5P_DEFAULT);
  ASSERT_GE(file_id, 0)<< "Failed to open HDF5 file" <<
      this->input_file_name_;
  hdf5_load_nd_dataset(file_id, HDF5_DATA_DATASET_NAME, 0, 4,
                       this->blob_data_);
  hdf5_load_nd_dataset(file_id, HDF5_DATA_LABEL_NAME, 0, 4,
                       this->blob_label_);
  herr_t status = H5Fclose(file_id);
  EXPECT_GE(status, 0)<< "Failed to close HDF5 file " <<
      this->input_file_name_;
  this->blob_bottom_vec_.push_back(this->blob_data_);
  this->blob_bottom_vec_.push_back(this->blob_label_);

  LayerParameter param;
  param.mutable_hdf5_output_param()->set_file_name(this->output_file_name_);
  // This code block ensures that the layer is deconstructed and
  //   the output hdf5 file is closed.
  {
    HDF5OutputLayer<Dtype> layer(param);
    EXPECT_EQ(layer.file_name(), this->output_file_name_);
    layer.SetUp(this->blob_bottom_vec_, this->blob_top_vec_);
    layer.Forward(this->blob_bottom_vec_, this->blob_top_vec_);
  }
  file_id = H5Fopen(this->output_file_name_.c_str(), H5F_ACC_RDONLY,
                          H5P_DEFAULT);
  ASSERT_GE(
    file_id, 0)<< "Failed to open HDF5 file" <<
          this->input_file_name_;

  Blob<Dtype>* blob_data = new Blob<Dtype>();
  hdf5_load_nd_dataset(file_id, HDF5_DATA_DATASET_NAME, 0, 4,
                       blob_data);
  this->CheckBlobEqual(*(this->blob_data_), *blob_data);

  Blob<Dtype>* blob_label = new Blob<Dtype>();
  hdf5_load_nd_dataset(file_id, HDF5_DATA_LABEL_NAME, 0, 4,
                       blob_label);
  this->CheckBlobEqual(*(this->blob_label_), *blob_label);

  status = H5Fclose(file_id);
  EXPECT_GE(status, 0) << "Failed to close HDF5 file " <<
      this->output_file_name_;
}
示例#2
0
void testSorting(std::vector<uint64_t> values, uint64_t memSize) {
  char inFileName[] = "unsortedXXXXXX";
  char outFileName[] = "sortedXXXXXX";
  //create temporary input and output files
  int fdIn = mkstemp(inFileName);
  ASSERT_GE(fdIn, 0) << "unable to create input file: " << strerror(errno);
  int fdOut = mkstemp(outFileName);
  ASSERT_GE(fdOut, 0) << "unable to create output file: " << strerror(errno);

  //store the input numbers into the input file
  uint64_t bytesWritten = 0;
  uint64_t bytesToBeWritten = values.size()*sizeof(uint64_t);
  while(bytesWritten < bytesToBeWritten) {
    int pwriteRet = pwrite(fdIn, &values[0], bytesToBeWritten - bytesWritten, bytesWritten);
    ASSERT_GE(pwriteRet, 0) << "unable to write values to input file: " << strerror(errno);
    bytesWritten += pwriteRet;
  }

  //sort the values
  dbImpl::externalSort(fdIn, values.size(), fdOut, memSize);

  //check the file size of the output file
  struct stat outStat;
  ASSERT_EQ(0, fstat(fdOut, &outStat)) << strerror(errno);
  EXPECT_EQ(values.size()*sizeof(uint64_t), outStat.st_size);

  //read back the results
  std::unique_ptr<uint64_t[]> results(new uint64_t[values.size()]);
  uint64_t bytesRead = 0;
  uint64_t bytesToBeRead = values.size()*sizeof(uint64_t);
  while(bytesRead < bytesToBeRead) {
    int preadRet = pread(fdOut, &results[0], bytesToBeRead - bytesRead, bytesRead);
    ASSERT_GE(preadRet, 0) << "unable to read values from output file: " << strerror(errno);
    bytesRead += preadRet;
  }
  //they should be sorted now...
  ASSERT_TRUE(std::is_sorted(&results[0], &results[values.size()]));

  //close both file descriptors
  //since they were created using O_TMPFILE, the files will be
  //deleted automatically
  ASSERT_EQ(0, close(fdOut)) << strerror(errno);
  ASSERT_EQ(0, close(fdIn)) << strerror(errno);
  //unlink the files
  ASSERT_EQ(0, unlink(inFileName)) << strerror(errno);
  ASSERT_EQ(0, unlink(outFileName)) << strerror(errno);
}
示例#3
0
	void bar_widget::set_value(const std::string& key, const variant& value)
	{
		if(key == "segments") {
			segments_ = value.as_int();
			ASSERT_GE(segments_, 0);
			init();
		} else if(key == "segment_length") {
			segment_length_ = value.as_int();
			ASSERT_GT(segment_length_, 0);
			init();
		} else if(key == "tick_width") {
			tick_width_ = value.as_int();
			ASSERT_GT(tick_width_, 0);
			init();
		} else if(key == "scale") {
			scale_ = value.as_decimal().as_float();
			ASSERT_GT(scale_, 0.0f);
			init();
		} else if(key == "drain_rate") {
			drain_rate_ = value.as_decimal().as_float();
			ASSERT_GE(drain_rate_, 0.0);
		} else if(key == "drained") {
			int drain = value.as_int();
			if(drain == drained_segments_) {
				return;
			}
			int animation_start_position = segments_-drained_segments_;
			animation_current_position_ = 0;
			drained_segments_after_anim_ = drain;
			if(drained_segments_after_anim_ < 0) {
				drained_segments_after_anim_ = 0;
			}
			if(drained_segments_after_anim_ > segments_) {
				drained_segments_after_anim_ = segments_;
			}
			int animation_end_position = segments_-drained_segments_after_anim_;
			animation_end_point_unscaled_ = animation_end_position - animation_start_position;
			animating_ = true;
			init();
		} else if(key == "max_width") { 
			bar_max_width_ = value.as_int();
			init();
		} else if(key == "animation_position") {
			animation_current_position_ = value.as_decimal().as_float();
		}
		widget::set_value(key, value);
	}
示例#4
0
TEST_F(LayoutTextTest, WidthLengthBeyondLength) {
  setBasicBody("x");
  // Width may vary by platform and we just want to make sure it's something
  // roughly reasonable.
  float width = getBasicText()->width(0u, 2u, LayoutUnit(), LTR, false);
  ASSERT_GE(width, 4.f);
  ASSERT_LE(width, 20.f);
}
示例#5
0
TEST_F(SemaphoreTest, timedwait) {
  semaphore->post();
  ASSERT_TRUE(semaphore->timedwait(0.1));
  Time start_time(Time::now());
  semaphore->timedwait(0.1);
  Time elapsed_time(Time::now() - start_time);
  ASSERT_GE(elapsed_time, Time(0.1));
}
示例#6
0
TEST(BugKillingTests, RemoveLastBugIfDead) {
	bug_list.clear();
	bug_list.push_back(initBug(0, 0, EAST, 0));
	bug_list.push_back(initBug(0, 1, EAST, MOVE_HEALTH * 3));
	bug_list.push_back(initBug(0, 2, EAST, MOVE_HEALTH * 3));
	bug_list.push_back(initBug(0, 3, EAST, 0));
	initWorld();

	moveBugs();
	killDeadBugs();

	ASSERT_EQ(bug_list.size(), 2);
	ASSERT_EQ(world[0][1], EMPTY);
	ASSERT_GE(world[0][2], 0);
	ASSERT_GE(world[0][3], 0);
	ASSERT_EQ(world[0][4], EMPTY);
}
示例#7
0
/**
 * The only process we are really guaranteed to have is this test process itself.
 */
TEST( Process_List_Test, find_our_process )
{
  std::vector< PROCESSENTRY32W > v ;
  initialize_process_list( v, our_process_by_name(), copy_all() ) ;
  size_t size( v.size() );
  EXPECT_EQ( 1u, size );    // Please, don't run multiple test executables simultaneously
  ASSERT_GE( 1u, size );
}
/**
 * Locate the PID of our process using the
 */
TEST(Process_List_Test, find_our_process_in_set)
{
  std::vector<DWORD> v;
  initialize_process_list(v, find_in_set, CopyPID());
  size_t size(v.size());
  EXPECT_EQ(size, 1u);      // Please, don't run multiple test executables simultaneously
  ASSERT_GE(size, 1u);
}
/**
 * The only process we are really guaranteed to have is this test process itself.
 * This test uses the generic filter function.
 */
TEST(Process_List_Test, find_our_process_CI_as_used)
{
  std::vector<PROCESSENTRY32W> v;
  initialize_process_list(v, process_by_any_file_name_CI(FileNameSet(multiple_exe_names)), CopyAll());
  size_t size(v.size());
  EXPECT_EQ(1u, size);      // Please, don't run multiple test executables simultaneously
  ASSERT_GE(1u, size);
}
示例#10
0
TEST(pid_set, find_our_process_in_set_not_immersive)
{
  std::set<DWORD> s;
  initialize_process_set(s, find_in_set_not_immersive, CopyPID());
  size_t size(s.size());
  EXPECT_EQ(size, 1u);
  ASSERT_GE(size, 1u);
}
示例#11
0
/**
 * The only process we are really guaranteed to have is this test process itself.
 * This test uses same one used in Process_Closer
 */
TEST(Process_List_Test, find_our_process_CI_generic)
{
  std::vector<PROCESSENTRY32W> v;
  initialize_process_list(v, process_by_name_CI(mixedcase_exe_name), CopyAll());
  size_t size(v.size());
  EXPECT_EQ(1u, size);      // Please, don't run multiple test executables simultaneously
  ASSERT_GE(1u, size);
}
示例#12
0
// Does the PRNG generate random integers with approximately even distribution?
TEST(UtilTest, CanGenerateRandomInts)
{
    const int num_tests = 100000;

    long long avg = 0;
    for(size_t i = 0; i < num_tests; i++) {
        int res = rend_rand();
        ASSERT_LE(REND_RAND_MIN, res);
        ASSERT_GE(REND_RAND_MAX, res);
        avg += res;
    }
    avg /= num_tests;
    long long mid = REND_RAND_MIN + (REND_RAND_MAX - REND_RAND_MIN) / 2;
    long long err = mid / 100; // Test for +/-1% accuracy
    ASSERT_LE(mid - err, avg);
    ASSERT_GE(mid + err, avg);
}
示例#13
0
// Does the PRNG generate random floats with approximately even distribution?
TEST(UtilTest, CanGenerateRandomFloats)
{
    const int num_tests = 100000;

    double avg = 0.0f;
    for(size_t i = 0; i < num_tests; i++) {
        float res = rend_randf();
        ASSERT_LT(0.0f, res);
        ASSERT_GE(1.0f, res);
        avg += res;
    }
    avg /= (float)num_tests;
    double mid = 0.5f;
    double err = mid / 100.0f; // Test for +/-1% accuracy
    ASSERT_LE(mid - err, avg);
    ASSERT_GE(mid + err, avg);
}
TEST_F(Allocate, Zeroed)
{
    void *zeroes = calloc(4096, 1);

    for (unsigned int heapMask : m_allHeaps) {
        SCOPED_TRACE(::testing::Message() << "heap " << heapMask);
        int fds[16];
        for (unsigned int i = 0; i < 16; i++) {
            int map_fd = -1;

            ASSERT_EQ(0, ion_alloc_fd(m_ionFd, 4096, 0, heapMask, 0, &map_fd));
            ASSERT_GE(map_fd, 0);

            void *ptr = NULL;
            ptr = mmap(NULL, 4096, PROT_WRITE, MAP_SHARED, map_fd, 0);
            ASSERT_TRUE(ptr != NULL);

            memset(ptr, 0xaa, 4096);

            ASSERT_EQ(0, munmap(ptr, 4096));
            fds[i] = map_fd;
        }

        for (unsigned int i = 0; i < 16; i++) {
            ASSERT_EQ(0, close(fds[i]));
        }

        int newIonFd = ion_open();
        int map_fd = -1;

        ASSERT_EQ(0, ion_alloc_fd(newIonFd, 4096, 0, heapMask, 0, &map_fd));
        ASSERT_GE(map_fd, 0);

        void *ptr = NULL;
        ptr = mmap(NULL, 4096, PROT_READ, MAP_SHARED, map_fd, 0);
        ASSERT_TRUE(ptr != NULL);

        ASSERT_EQ(0, memcmp(ptr, zeroes, 4096));

        ASSERT_EQ(0, munmap(ptr, 4096));
        ASSERT_EQ(0, close(map_fd));
    }

    free(zeroes);

}
示例#15
0
TEST(MoneyTest, comparisons) {
  ASSERT_LT(change::Money(10, 99), change::Money(11, 10));
  ASSERT_LE(change::Money(10, 99), change::Money(11, 10));
  ASSERT_EQ(change::Money(10, 99), change::Money(10, 99));
  ASSERT_LE(change::Money(10, 99), change::Money(10, 99));
  ASSERT_GE(change::Money(10, 99), change::Money(10, 99));
  ASSERT_GT(change::Money(11, 00), change::Money(10, 99));
  ASSERT_GE(change::Money(11, 00), change::Money(10, 99));

  EXPECT_TRUE(change::Money(10, 99) < change::Money(11, 10));
  EXPECT_TRUE(change::Money(10, 99) <= change::Money(11, 10));
  EXPECT_TRUE(change::Money(10, 99) == change::Money(10, 99));
  EXPECT_TRUE(change::Money(10, 99) <= change::Money(10, 99));
  EXPECT_TRUE(change::Money(10, 99) >= change::Money(10, 99));
  EXPECT_TRUE(change::Money(11, 00) > change::Money(10, 99));
  EXPECT_TRUE(change::Money(11, 00) >= change::Money(10, 99)); 
}
示例#16
0
TEST_F( JihankiTest, GetJuiceList ) {
  auto list = jihanki.insert(1000).second;
  ASSERT_GE(list.size(), 1);

  Juice tmp = list[0];
  ASSERT_EQ("cola", tmp.name);
  ASSERT_EQ(120,    tmp.price);
}
示例#17
0
TEST( pid_set, find_our_process_in_set )
{
  std::set< DWORD > s ;
  initialize_process_set( s, find_in_set, copy_PID() ) ;
  size_t size( s.size() ) ;
  EXPECT_EQ( size, 1u );
  ASSERT_GE( size, 1u );
}
TEST_F(StateMachineTests, AdvancedConnection) {
    ASSERT_EQ(BST_MODE_CONNECTING_TO_BOOTSTRAP, bst_get_state());
    bst_periodic();
    ASSERT_EQ(BST_MODE_WAITING_FOR_DATA, bst_get_state());

    prv_instance.options.retry_connecting_to_destination_network = 2;
    prv_instance.options.need_advanced_connection = true;

    { // Send hello packet now
        bst_udp_hello_receive_pkt_t pkt;
        prv_generate_test_hello(&pkt);
        bst_network_input((char*)&pkt,sizeof(bst_udp_hello_receive_pkt_t));
    }

    bst_periodic();

    { // Send bootstrap packet
        bst_udp_bootstrap_receive_pkt_t pkt;
        prv_generate_test_data(&pkt, true);
        bst_network_input((char*)&pkt,sizeof(bst_udp_bootstrap_receive_pkt_t));
    }

    ASSERT_EQ(BST_MODE_WAITING_FOR_DATA, prv_instance.state.state);
    bst_periodic();
    ASSERT_EQ(BST_STATE_CONNECTED, bst_get_connection_state());
    ASSERT_EQ(BST_MODE_CONNECTING_TO_DEST, prv_instance.state.state);
    ASSERT_EQ(0, retry_advanced_connection);

    // Expect no further connect to advanced until timeout_connecting_state_ms is over
    for(unsigned i=0;i<5;++i) {
        bst_periodic();
    }

    ASSERT_EQ(BST_STATE_CONNECTED, bst_get_connection_state());
    ASSERT_GE(1, retry_advanced_connection);

    // Expect second try to connect to advanced
    addTimeMsOverwrite(prv_instance.options.timeout_connecting_state_ms+10);

    ASSERT_GE(2, retry_advanced_connection);
    next_connect_state = BST_STATE_CONNECTED_ADVANCED;

    bst_periodic();

    ASSERT_EQ(BST_STATE_CONNECTED_ADVANCED, bst_get_connection_state());
}
示例#19
0
TEST_F(ConstexprMathTest, constexpr_add_overflow_clamped) {
  for (int a = kInt8Min; a <= kInt8Max; a++) {
    for (int b = kInt8Min; b <= kInt8Max; b++) {
      int c = folly::constexpr_clamp(a + b, int(kInt8Min), int(kInt8Max));
      int8_t a1 = a;
      int8_t b1 = b;
      int8_t c1 = folly::constexpr_add_overflow_clamped(a1, b1);
      ASSERT_LE(c1, kInt8Max);
      ASSERT_GE(c1, kInt8Min);
      ASSERT_EQ(c1, c);
    }
  }

  for (int a = 0; a <= kUInt8Max; a++) {
    for (int b = 0; b <= kUInt8Max; b++) {
      int c = folly::constexpr_clamp(a + b, 0, int(kUInt8Max));
      uint8_t a1 = a;
      uint8_t b1 = b;
      uint8_t c1 = folly::constexpr_add_overflow_clamped(a1, b1);
      ASSERT_LE(c1, kUInt8Max);
      ASSERT_GE(c1, 0);
      ASSERT_EQ(c1, c);
    }
  }

  constexpr auto v1 =
      folly::constexpr_add_overflow_clamped(int64_t(23), kInt64Max - 12);
  EXPECT_EQ(kInt64Max, v1);

  constexpr auto v2 =
      folly::constexpr_add_overflow_clamped(int64_t(23), int64_t(12));
  EXPECT_EQ(int64_t(35), v2);

  constexpr auto v3 =
      folly::constexpr_add_overflow_clamped(int64_t(-23), int64_t(12));
  EXPECT_EQ(int64_t(-11), v3);

  constexpr auto v4 =
      folly::constexpr_add_overflow_clamped(int64_t(-23), int64_t(-12));
  EXPECT_EQ(int64_t(-35), v4);

  constexpr auto v5 =
      folly::constexpr_add_overflow_clamped(uint64_t(23), kUInt64Max - 12);
  EXPECT_EQ(kUInt64Max, v5);
}
 void safe_circular_char_buffer::
 advance_head(const std::streamsize advance_len) {
   ASSERT_GE(advance_len, 0);
   ASSERT_LE(advance_len, size());
   // advance the head forward as far as possible
   head += advance_len;
   // If head wraps around move head to begginning and then offset
   if (head >= bufsize) head -= bufsize;    
 } // end of advance head
TEST(scheduledreporter, test) {
	StubScheduledReporter scheduled_reporter(MetricRegistry::DEFAULT_REGISTRY(),
			boost::chrono::milliseconds(1));
	scheduled_reporter.start(boost::chrono::milliseconds(100));
	boost::this_thread::sleep(boost::posix_time::seconds(1));
	scheduled_reporter.stop();
	ASSERT_LE((size_t)9, scheduled_reporter.invocation_count());
	ASSERT_GE((size_t)11, scheduled_reporter.invocation_count());
}
示例#22
0
TEST ( Heap, make_heap )
{
    std::vector<int> numbers { 4, 3, 2, 5, 1 };
    AP::algorithms::make_heap(begin(numbers), end(numbers));
    for ( size_t i=0; i < numbers.size(); i++ )
    {
        ASSERT_GE( numbers[i], numbers[std::floor( (i-1)/2 )]);
    }
}
示例#23
0
TEST(getcwd, manual_path_max) {
  char* buf = new char[PATH_MAX];
  errno = 0;
  char* cwd = getcwd(buf, PATH_MAX);
  ASSERT_TRUE(cwd == buf);
  ASSERT_EQ(0, errno);
  ASSERT_GE(strlen(cwd), 1U);
  delete[] cwd;
}
示例#24
0
TEST(getcwd, auto_reasonable) {
  // If we ask the library to allocate a reasonable buffer, everything's fine.
  errno = 0;
  char* cwd = getcwd(NULL, PATH_MAX);
  ASSERT_TRUE(cwd != NULL);
  ASSERT_EQ(0, errno);
  ASSERT_GE(strlen(cwd), 1U);
  free(cwd);
}
示例#25
0
TEST(getcwd, auto_full) {
  // If we let the library do all the work, everything's fine.
  errno = 0;
  char* cwd = getcwd(NULL, 0);
  ASSERT_TRUE(cwd != NULL);
  ASSERT_EQ(0, errno);
  ASSERT_GE(strlen(cwd), 1U);
  free(cwd);
}
示例#26
0
TEST(pty, bug_28979140) {
  // This test is to test a kernel bug, which uses a lock free ring-buffer to
  // pass data through a raw pty, but missing necessary memory barriers.
  cpu_set_t cpus;
  ASSERT_EQ(0, sched_getaffinity(0, sizeof(cpu_set_t), &cpus));
  if (CPU_COUNT(&cpus) < 2) {
    GTEST_LOG_(INFO) << "This test tests bug happens only on multiprocessors.";
    return;
  }
  constexpr uint32_t TEST_DATA_COUNT = 200000;

  // 1. Open raw pty.
  int master;
  int slave;
  ASSERT_EQ(0, openpty(&master, &slave, nullptr, nullptr, nullptr));
  termios tattr;
  ASSERT_EQ(0, tcgetattr(slave, &tattr));
  cfmakeraw(&tattr);
  ASSERT_EQ(0, tcsetattr(slave, TCSADRAIN, &tattr));

  // 2. Make master thread and slave thread running on different cpus:
  // master thread uses first available cpu, and slave thread uses other cpus.
  PtyReader_28979140_Arg arg;
  arg.main_cpu_id = -1;
  for (int i = 0; i < CPU_SETSIZE; i++) {
    if (CPU_ISSET(i, &cpus)) {
      arg.main_cpu_id = i;
      break;
    }
  }
  ASSERT_GE(arg.main_cpu_id, 0);

  // 3. Create thread for slave reader.
  pthread_t thread;
  arg.slave_fd = slave;
  arg.data_count = TEST_DATA_COUNT;
  arg.matched = true;
  ASSERT_EQ(0, pthread_create(&thread, nullptr,
                              reinterpret_cast<void*(*)(void*)>(PtyReader_28979140),
                              &arg));

  CPU_ZERO(&cpus);
  CPU_SET(arg.main_cpu_id, &cpus);
  ASSERT_EQ(0, sched_setaffinity(0, sizeof(cpu_set_t), &cpus));

  // 4. Send data to slave.
  uint32_t counter = 0;
  while (counter <= TEST_DATA_COUNT) {
    ASSERT_TRUE(android::base::WriteFully(master, &counter, sizeof(counter)));
    ASSERT_TRUE(arg.matched) << "failed at count = " << counter;
    counter++;
  }
  ASSERT_EQ(0, pthread_join(thread, nullptr));
  ASSERT_TRUE(arg.finished);
  ASSERT_TRUE(arg.matched);
  close(master);
}
示例#27
0
TEST(adf, devices) {
    adf_id_t *devs;
    ssize_t n_devs = adf_devices(&devs);
    free(devs);

    ASSERT_GE(n_devs, 0) << "enumerating ADF devices failed: " <<
            strerror(-n_devs);
    ASSERT_TRUE(devs != NULL);
}
void ReqRepHelloWorldRequester::waitDiscovery()
{
    std::unique_lock<std::mutex> lock(mutexDiscovery_);

    if(matched_ < 2)
        cvDiscovery_.wait_for(lock, std::chrono::seconds(10));

    ASSERT_GE(matched_, 2u);
}
示例#29
0
TEST_F(MongoDriverTest, FindOneProject)
{
  bson::Document d = c.findOne(FINDCOLL, {{"a", 5}}, {{"a", 1}});
  ASSERT_GE(2, d.field_names().size()); //can still have the _id apparently... ugh
  ASSERT_EQ(5, d["a"].data<int>());
  ASSERT_EQ(1, d.field_names().count("a"));
  ASSERT_EQ(1, d.field_names().count("_id"));
  ASSERT_EQ(0, d.field_names().count("b"));
}
示例#30
0
    virtual void SetUp() {
        int err = adf_device_open(dev_id, O_RDWR, &dev);
        ASSERT_GE(err, 0) << "opening ADF device " << dev_id <<
                " failed: " << strerror(-err);

        err = adf_find_simple_post_configuration(&dev, fmt8888, n_fmt8888,
                &intf_id, &eng_id);
        ASSERT_GE(err, 0) << "finding ADF configuration failed: " <<
                strerror(-err);

        intf = adf_interface_open(&dev, intf_id, O_RDWR);
        ASSERT_GE(intf, 0) << "opening ADF interface " << dev_id << "." <<
                intf_id << " failed: " << strerror(-intf);

        eng = adf_overlay_engine_open(&dev, eng_id, O_RDWR);
        ASSERT_GE(eng, 0) << "opening ADF overlay engine " << dev_id << "." <<
                eng_id << " failed: " << strerror(-eng);
    }