2018-07-26 15:37:10 -07:00
|
|
|
/*
|
|
|
|
|
* Author: Mihai Stefanescu <mihai.stefanescu@rinftech.com>
|
|
|
|
|
* Copyright (c) 2018 Intel Corporation.
|
|
|
|
|
*
|
2019-05-09 09:47:11 -07:00
|
|
|
* SPDX-License-Identifier: MIT
|
2018-07-26 15:37:10 -07:00
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
#include "mraa/initio.hpp"
|
|
|
|
|
#include "gtest/gtest.h"
|
|
|
|
|
#include <iostream>
|
|
|
|
|
#include <exception>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/* MRAA IO INIT hpp test fixture */
|
|
|
|
|
class mraa_initio_hpp_unit : public ::testing::Test
|
|
|
|
|
{
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
/* Test for an invalid AIO init. */
|
|
|
|
|
TEST_F(mraa_initio_hpp_unit, test_aio_init_invalid)
|
|
|
|
|
{
|
|
|
|
|
ASSERT_THROW(mraa::MraaIo io("a:bogus:10"), std::runtime_error);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* Test for a valid AIO init. */
|
|
|
|
|
TEST_F(mraa_initio_hpp_unit, test_aio_init_valid)
|
|
|
|
|
{
|
|
|
|
|
mraa::MraaIo io("a:0:10");
|
|
|
|
|
ASSERT_EQ(1, io.aios.size());
|
|
|
|
|
}
|