Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers test_at_cellularbase.cpp Source File

test_at_cellularbase.cpp

00001 /*
00002  * Copyright (c) 2018, Arm Limited and affiliates.
00003  * SPDX-License-Identifier: Apache-2.0
00004  *
00005  * Licensed under the Apache License, Version 2.0 (the "License");
00006  * you may not use this file except in compliance with the License.
00007  * You may obtain a copy of the License at
00008  *
00009  *     http://www.apache.org/licenses/LICENSE-2.0
00010  *
00011  * Unless required by applicable law or agreed to in writing, software
00012  * distributed under the License is distributed on an "AS IS" BASIS,
00013  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
00014  * See the License for the specific language governing permissions and
00015  * limitations under the License.
00016  */
00017 #include "CppUTest/TestHarness.h"
00018 #include "test_at_cellularbase.h"
00019 #include "EventQueue.h"
00020 #include "AT_CellularBase.h"
00021 #include "ATHandler_stub.h"
00022 #include "FileHandle_stub.h"
00023 #include <string.h>
00024 
00025 using namespace mbed;
00026 using namespace events;
00027 
00028 Test_AT_CellularBase::Test_AT_CellularBase()
00029 {
00030 
00031 }
00032 
00033 Test_AT_CellularBase::~Test_AT_CellularBase()
00034 {
00035 }
00036 
00037 void Test_AT_CellularBase::test_AT_CellularBase_get_at_handler()
00038 {
00039     EventQueue eq;
00040     FileHandle_stub fh;
00041     ATHandler ah(&fh, eq, 100, ",");
00042     AT_CellularBase at(ah);
00043 
00044     CHECK(&ah == &at.get_at_handler());
00045 }
00046 
00047 void Test_AT_CellularBase::test_AT_CellularBase_get_device_error()
00048 {
00049     EventQueue eq;
00050     FileHandle_stub fh;
00051     ATHandler ah(&fh, eq, 0, ",");
00052     AT_CellularBase at(ah);
00053 
00054     ATHandler_stub::device_err_value.errCode = 8;
00055 
00056     CHECK_EQUAL(8, at.get_device_error().errCode);
00057 
00058     ATHandler_stub::device_err_value.errCode = 0;
00059 }