Private
Public Access
2
0
Files
mraa/tests/unit/api/mraa_initio_hpp_unit.cxx
Thomas Ingleby 170bdd104f spdx: add spdx tags to most files
Large change that removes the duplicated MIT notice withe a spdx tag

Signed-off-by: Thomas Ingleby <thomas.ingleby@intel.com>
2019-05-23 10:09:12 -07:00

31 lines
647 B
C++

/*
* Author: Mihai Stefanescu <mihai.stefanescu@rinftech.com>
* Copyright (c) 2018 Intel Corporation.
*
* SPDX-License-Identifier: MIT
*/
#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());
}