~morphis/aethercast/enable-arm64-builds

« back to all changes in this revision

Viewing changes to tests/w11t/wfddeviceinfo_test.cpp

  • Committer: Tarmac
  • Author(s): Simon Fels
  • Date: 2016-02-04 06:38:31 UTC
  • mfrom: (119.1.65 trunk)
  • Revision ID: tarmac-20160204063831-b6q9o8ktznevvd8x
Add a network manager implementation to use the DBus interface of wpa-supplicant.

Approved by PS Jenkins bot.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/*
2
 
 * Copyright (C) 2015 Canonical, Ltd.
3
 
 *
4
 
 * This program is free software: you can redistribute it and/or modify it
5
 
 * under the terms of the GNU General Public License version 3, as published
6
 
 * by the Free Software Foundation.
7
 
 *
8
 
 * This program is distributed in the hope that it will be useful, but
9
 
 * WITHOUT ANY WARRANTY; without even the implied warranties of
10
 
 * MERCHANTABILITY, SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR
11
 
 * PURPOSE.  See the GNU General Public License for more details.
12
 
 *
13
 
 * You should have received a copy of the GNU General Public License along
14
 
 * with this program.  If not, see <http://www.gnu.org/licenses/>.
15
 
 *
16
 
 */
17
 
 
18
 
#include <gtest/gtest.h>
19
 
 
20
 
#include <w11t/wfddeviceinfo.h>
21
 
 
22
 
TEST(WfdDeviceInfo, FromStringWithValidInput) {
23
 
    auto info = w11t::WfdDeviceInfo::Parse("0x00111c440032");
24
 
    EXPECT_TRUE(info.IsSupported());
25
 
    EXPECT_TRUE(info.IsSupportedSink());
26
 
    EXPECT_EQ(info.ctrl_port_, 7236);
27
 
    EXPECT_EQ(info.max_tput_, 50);
28
 
}
29
 
 
30
 
TEST(WfdDeviceInfo, FromStringWithInvalidInput) {
31
 
    auto info = w11t::WfdDeviceInfo::Parse("0xa1231sdas12312131232134235243rasasdsa");
32
 
    EXPECT_TRUE(!info.IsSupported());
33
 
    EXPECT_TRUE(!info.IsSupportedSink());
34
 
    EXPECT_EQ(info.ctrl_port_, 0);
35
 
    EXPECT_EQ(info.max_tput_, 0);
36
 
 
37
 
    EXPECT_THROW(w11t::WfdDeviceInfo::Parse("0xabcdefghijkl"), std::invalid_argument);
38
 
}