Skip to content

Commit 06a3d25

Browse files
Fixed unit test issues
1 parent d11d06e commit 06a3d25

File tree

3 files changed

+12
-1
lines changed

3 files changed

+12
-1
lines changed

src/app/clusters/ota-requestor/DefaultOTARequestorStorage.h

+3
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,9 @@ class DefaultOTARequestorStorage : public OTARequestorStorage
4949
CHIP_ERROR ClearTargetVersion() override;
5050

5151
private:
52+
/**
53+
* Check if a provider is in the lists
54+
*/
5255
bool ProviderAlreadyInList(ProviderLocationList & listProviders, ProviderLocationType provider);
5356
CHIP_ERROR Load(const char * key, MutableByteSpan & buffer);
5457
PersistentStorageDelegate * mPersistentStorage = nullptr;

src/app/clusters/ota-requestor/OTARequestorInterface.h

+8
Original file line numberDiff line numberDiff line change
@@ -131,6 +131,14 @@ class ProviderLocationList
131131
return CHIP_ERROR_NOT_FOUND;
132132
}
133133

134+
/**
135+
* Get the list size
136+
*/
137+
size_t GetListSize()
138+
{
139+
return mListSize;
140+
}
141+
134142
private:
135143
Optional<app::Clusters::OtaSoftwareUpdateRequestor::Structs::ProviderLocation::Type> mList[CHIP_CONFIG_MAX_FABRICS];
136144
size_t mListSize = 0;

src/app/tests/TestDefaultOTARequestorStorage.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@ TEST(TestDefaultOTARequestorStorage, TestDefaultProvidersDuplicated)
123123
providers = {};
124124
EXPECT_EQ(CHIP_NO_ERROR, otaStorage.LoadDefaultProviders(providers));
125125

126-
EXPECT_TRUE(providers.mListSize == 3U);
126+
EXPECT_TRUE(providers.GetListSize() == 3U);
127127
}
128128

129129
TEST(TestDefaultOTARequestorStorage, TestCurrentProviderLocation)

0 commit comments

Comments
 (0)