Skip to content

Commit d83f52a

Browse files
author
Kimmo Vaisanen
committed
Improve UT for cellular properties
1 parent e824714 commit d83f52a

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

UNITTESTS/features/cellular/framework/AT/at_cellularbase/at_cellularbasetest.cpp

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,11 @@ class my_base : public AT_CellularBase {
5353
{
5454
return get_property(PROPERTY_AT_CGDATA);
5555
}
56+
57+
void reset_property_array()
58+
{
59+
_property_array = NULL;
60+
}
5661
};
5762

5863
// AStyle ignored as the definition is not clear due to preprocessor usage
@@ -137,3 +142,18 @@ TEST_F(TestAT_CellularBase, test_AT_CellularBase_is_supported)
137142
EXPECT_EQ(true, my_at.check_supported());
138143
EXPECT_EQ(false, my_at.check_not_supported());
139144
}
145+
146+
TEST_F(TestAT_CellularBase, test_invalid_params)
147+
{
148+
EventQueue eq;
149+
FileHandle_stub fh;
150+
ATHandler ah(&fh, eq, 0, ",");
151+
my_base my_at(ah);
152+
153+
my_at.reset_property_array(); // as array is a static variable, it might have been set in previous tests
154+
155+
my_at.set_cellular_properties(NULL);
156+
157+
// Property array not set
158+
EXPECT_EQ(0, my_at.get_property(AT_CellularBase::PROPERTY_IPV4_PDP_TYPE));
159+
}

0 commit comments

Comments
 (0)