Merge "Add more VTS tests for ISupplicantP2pIface" into oc-dev
diff --git a/power/1.0/default/Power.cpp b/power/1.0/default/Power.cpp
index 6ea9167..51f87f5 100644
--- a/power/1.0/default/Power.cpp
+++ b/power/1.0/default/Power.cpp
@@ -145,25 +145,27 @@
}
IPower* HIDL_FETCH_IPower(const char* /* name */) {
- int ret = 0;
- const hw_module_t* hw_module = NULL;
- power_module_t *power_module;
- ret = hw_get_module(POWER_HARDWARE_MODULE_ID, &hw_module);
- if (ret == 0 && hw_module->methods->open) {
- ret = hw_module->methods->open(hw_module, POWER_HARDWARE_MODULE_ID,
- reinterpret_cast<hw_device_t**>(&power_module));
- if (ret == 0) {
- return new Power(power_module);
- }
- else {
- ALOGE("Passthrough failed to load legacy power HAL.");
+ const hw_module_t* hw_module = nullptr;
+ power_module_t* power_module = nullptr;
+ int err = hw_get_module(POWER_HARDWARE_MODULE_ID, &hw_module);
+ if (err) {
+ ALOGE("hw_get_module %s failed: %d", POWER_HARDWARE_MODULE_ID, err);
+ return nullptr;
+ }
+
+ if (!hw_module->methods || !hw_module->methods->open) {
+ power_module = reinterpret_cast<power_module_t*>(
+ const_cast<hw_module_t*>(hw_module));
+ } else {
+ err = hw_module->methods->open(
+ hw_module, POWER_HARDWARE_MODULE_ID,
+ reinterpret_cast<hw_device_t**>(&power_module));
+ if (err) {
+ ALOGE("Passthrough failed to load legacy HAL.");
return nullptr;
}
}
- else {
- ALOGE ("hw_get_module %s failed: %d", POWER_HARDWARE_MODULE_ID, ret);
- return nullptr;
- }
+ return new Power(power_module);
}
} // namespace implementation
diff --git a/renderscript/1.0/vts/functional/VtsCopyTests.cpp b/renderscript/1.0/vts/functional/VtsCopyTests.cpp
index 168e681..f47253f 100644
--- a/renderscript/1.0/vts/functional/VtsCopyTests.cpp
+++ b/renderscript/1.0/vts/functional/VtsCopyTests.cpp
@@ -30,12 +30,18 @@
TEST_F(RenderscriptHidlTest, Simple1DCopyTest) {
// float1
Element element = context->elementCreate(DataType::FLOAT_32, DataKind::USER, false, 1);
+ ASSERT_NE(Element(0), element);
+
// 128 x float1
Type type = context->typeCreate(element, 128, 0, 0, false, false, YuvFormat::YUV_NONE);
+ ASSERT_NE(Type(0), type);
+
// 128 x float1
Allocation allocation = context->allocationCreateTyped(type, AllocationMipmapControl::NONE,
(int)AllocationUsageType::SCRIPT,
(Ptr)nullptr);
+ ASSERT_NE(Allocation(0), allocation);
+
std::vector<float> dataIn(128), dataOut(128);
std::generate(dataIn.begin(), dataIn.end(), [](){ static int val = 0; return (float)val++; });
hidl_vec<uint8_t> _data;
@@ -60,12 +66,18 @@
TEST_F(RenderscriptHidlTest, Simple2DCopyTest) {
// float1
Element element = context->elementCreate(DataType::FLOAT_32, DataKind::USER, false, 1);
+ ASSERT_NE(Element(0), element);
+
// 128 x 128 x float1
Type type = context->typeCreate(element, 128, 128, 0, false, false, YuvFormat::YUV_NONE);
+ ASSERT_NE(Type(0), type);
+
// 128 x 128 x float1
Allocation allocation = context->allocationCreateTyped(type, AllocationMipmapControl::NONE,
(int)AllocationUsageType::SCRIPT,
(Ptr)nullptr);
+ ASSERT_NE(Allocation(0), allocation);
+
std::vector<float> dataIn(128*128), dataOut(128*128);
std::generate(dataIn.begin(), dataIn.end(), [](){ static int val = 0; return (float)val++; });
hidl_vec<uint8_t> _data;
@@ -91,12 +103,18 @@
TEST_F(RenderscriptHidlTest, Simple3DCopyTest) {
// float1
Element element = context->elementCreate(DataType::FLOAT_32, DataKind::USER, false, 1);
+ ASSERT_NE(Element(0), element);
+
// 32 x 32 x 32 x float1
Type type = context->typeCreate(element, 32, 32, 32, false, false, YuvFormat::YUV_NONE);
+ ASSERT_NE(Type(0), type);
+
// 32 x 32 x 32 x float1
Allocation allocation = context->allocationCreateTyped(type, AllocationMipmapControl::NONE,
(int)AllocationUsageType::SCRIPT,
(Ptr)nullptr);
+ ASSERT_NE(Allocation(0), allocation);
+
std::vector<float> dataIn(32*32*32), dataOut(32*32*32);
std::generate(dataIn.begin(), dataIn.end(), [](){ static int val = 0; return (float)val++; });
hidl_vec<uint8_t> _data;
@@ -122,8 +140,12 @@
TEST_F(RenderscriptHidlTest, SimpleBitmapTest) {
// float1
Element element = context->elementCreate(DataType::FLOAT_32, DataKind::USER, false, 1);
+ ASSERT_NE(Element(0), element);
+
// 512 x 512 x float1
Type type = context->typeCreate(element, 512, 512, 0, false, false, YuvFormat::YUV_NONE);
+ ASSERT_NE(Type(0), type);
+
std::vector<float> dataIn(512*512), dataOut1(512*512), dataOut2(512*512);
std::generate(dataIn.begin(), dataIn.end(), [](){ static int val = 0; return (float)val++; });
hidl_vec<uint8_t> _data;
@@ -133,7 +155,7 @@
AllocationMipmapControl::NONE,
_data,
(int)AllocationUsageType::SCRIPT);
- EXPECT_NE(Allocation(0), allocation);
+ ASSERT_NE(Allocation(0), allocation);
context->allocationCopyToBitmap(allocation, (Ptr)dataOut1.data(),
(Size)dataOut1.size()*sizeof(float));
@@ -158,10 +180,16 @@
TEST_F(RenderscriptHidlTest, AllocationCopy2DRangeTest) {
// float1
Element element = context->elementCreate(DataType::FLOAT_32, DataKind::USER, false, 1);
+ ASSERT_NE(Element(0), element);
+
// 512 x 512 x float1
Type typeSrc = context->typeCreate(element, 512, 512, 0, false, false, YuvFormat::YUV_NONE);
+ ASSERT_NE(Type(0), typeSrc);
+
// 256 x 256 x float1
Type typeDst = context->typeCreate(element, 256, 256, 0, false, false, YuvFormat::YUV_NONE);
+ ASSERT_NE(Type(0), typeDst);
+
std::vector<float> dataIn(512*512), dataOut(256*256), expected(256*256);
std::generate(dataIn.begin(), dataIn.end(), [](){ static int val = 0; return (float)val++; });
hidl_vec<uint8_t> _data;
@@ -170,10 +198,14 @@
Allocation allocSrc = context->allocationCreateFromBitmap(typeSrc,
AllocationMipmapControl::NONE, _data,
(int)AllocationUsageType::SCRIPT);
+ ASSERT_NE(Allocation(0), allocSrc);
+
// 256 x 256 x float1
Allocation allocDst = context->allocationCreateTyped(typeDst, AllocationMipmapControl::NONE,
(int)AllocationUsageType::SCRIPT,
(Ptr)nullptr);
+ ASSERT_NE(Allocation(0), allocDst);
+
context->allocationCopy2DRange(allocDst, 0, 0, 0, AllocationCubemapFace::POSITIVE_X, 256, 256,
allocSrc, 128, 128, 0, AllocationCubemapFace::POSITIVE_X);
context->allocationRead(allocDst, (Ptr)dataOut.data(), (Size)dataOut.size()*sizeof(float));
@@ -200,10 +232,16 @@
TEST_F(RenderscriptHidlTest, AllocationCopy3DRangeTest) {
// float1
Element element = context->elementCreate(DataType::FLOAT_32, DataKind::USER, false, 1);
+ ASSERT_NE(Element(0), element);
+
// 128 x 128 x 128 x float1
Type typeSrc = context->typeCreate(element, 128, 128, 128, false, false, YuvFormat::YUV_NONE);
+ ASSERT_NE(Type(0), typeSrc);
+
// 64 x 64 x 64 x float1
Type typeDst = context->typeCreate(element, 64, 64, 64, false, false, YuvFormat::YUV_NONE);
+ ASSERT_NE(Type(0), typeDst);
+
std::vector<float> dataIn(128*128*128), dataOut(64*64*64), expected(64*64*64);
std::generate(dataIn.begin(), dataIn.end(), [](){ static int val = 0; return (float)val++; });
hidl_vec<uint8_t> _data;
@@ -212,10 +250,14 @@
Allocation allocSrc = context->allocationCreateTyped(typeSrc, AllocationMipmapControl::NONE,
(int)AllocationUsageType::SCRIPT,
(Ptr)nullptr);
+ ASSERT_NE(Allocation(0), allocSrc);
+
// 256 x 256 x float1
Allocation allocDst = context->allocationCreateTyped(typeDst, AllocationMipmapControl::NONE,
(int)AllocationUsageType::SCRIPT,
(Ptr)nullptr);
+ ASSERT_NE(Allocation(0), allocDst);
+
context->allocation3DWrite(allocSrc, 0, 0, 0, 0, 128, 128, 128, _data, 128*sizeof(float));
context->allocationCopy3DRange(allocDst, 0, 0, 0, 0, 64, 64, 64, allocSrc, 32, 32, 32, 0);
context->allocationRead(allocDst, (Ptr)dataOut.data(), (Size)dataOut.size()*sizeof(float));
@@ -243,8 +285,12 @@
TEST_F(RenderscriptHidlTest, SimpleAdapterTest) {
// float1
Element element = context->elementCreate(DataType::FLOAT_32, DataKind::USER, false, 1);
+ ASSERT_NE(Element(0), element);
+
// 512 x 512 x float1
Type type = context->typeCreate(element, 512, 512, 0, false, false, YuvFormat::YUV_NONE);
+ ASSERT_NE(Type(0), type);
+
std::vector<float> dataIn(512*512), dataOut(256*256), expected;
std::generate(dataIn.begin(), dataIn.end(), [](){ static int val = 0; return (float)val++; });
hidl_vec<uint8_t> _data;
@@ -254,11 +300,15 @@
AllocationMipmapControl::NONE,
_data,
(int)AllocationUsageType::SCRIPT);
+ ASSERT_NE(Allocation(0), allocation);
+
// 256 x 256 x float1
Type subType = context->typeCreate(element, 256, 256, 0, false, false, YuvFormat::YUV_NONE);
+ ASSERT_NE(Type(0), subType);
+
// 256 x 256 x float1
AllocationAdapter allocationAdapter = context->allocationAdapterCreate(subType, allocation);
- EXPECT_NE(AllocationAdapter(0), allocationAdapter);
+ ASSERT_NE(AllocationAdapter(0), allocationAdapter);
std::vector<uint32_t> offsets(9, 0);
offsets[0] = 128;
@@ -292,8 +342,12 @@
TEST_F(RenderscriptHidlTest, SimpleMipmapTest) {
// uint8_t
Element element = context->elementCreate(DataType::UNSIGNED_8, DataKind::USER, false, 1);
+ ASSERT_NE(Element(0), element);
+
// 64 x 64 x uint8_t
Type type = context->typeCreate(element, 64, 64, 0, true, false, YuvFormat::YUV_NONE);
+ ASSERT_NE(Type(0), type);
+
std::vector<uint8_t> dataIn(64*64), dataOut(32*32), expected(32*32);
std::generate(dataIn.begin(), dataIn.end(),
[](){ static int val = 0; return (uint8_t)(0xFF & val++); });
@@ -303,6 +357,8 @@
Allocation allocation = context->allocationCreateTyped(type, AllocationMipmapControl::FULL,
(int)AllocationUsageType::SCRIPT,
(Ptr)nullptr);
+ ASSERT_NE(Allocation(0), allocation);
+
context->allocation2DWrite(allocation, 0, 0, 0, AllocationCubemapFace::POSITIVE_X, 64, 64,
_data, 64*sizeof(uint8_t));
context->allocationGenerateMipmaps(allocation);
@@ -333,8 +389,12 @@
TEST_F(RenderscriptHidlTest, SimpleCubemapTest) {
// float1
Element element = context->elementCreate(DataType::FLOAT_32, DataKind::USER, false, 1);
+ ASSERT_NE(Element(0), element);
+
// 128 x 128 x float1
Type type = context->typeCreate(element, 128, 128, 0, false, true, YuvFormat::YUV_NONE);
+ ASSERT_NE(Type(0), type);
+
std::vector<float> dataIn(128*128*6), dataOut(128*128), expected(128*128);
std::generate(dataIn.begin(), dataIn.end(), [](){ static int val = 0; return (float)val++; });
hidl_vec<uint8_t> _data;
@@ -342,7 +402,7 @@
// 128 x 128 x float1 x 6
Allocation allocation = context->allocationCubeCreateFromBitmap(
type, AllocationMipmapControl::NONE, _data, (int)AllocationUsageType::SCRIPT);
- EXPECT_NE(Allocation(0), allocation);
+ ASSERT_NE(Allocation(0), allocation);
context->allocation2DRead(allocation, 0, 0, 0, AllocationCubemapFace::NEGATIVE_Z, 128,
128, (Ptr)dataOut.data(), (Size)dataOut.size()*sizeof(float),
@@ -367,13 +427,16 @@
*/
TEST_F(RenderscriptHidlTest, ComplexElementTest) {
Element element1 = context->elementCreate(DataType::UNSIGNED_8, DataKind::USER, false, 1);
+ ASSERT_NE(Element(0), element1);
+
Element element2 = context->elementCreate(DataType::UNSIGNED_32, DataKind::USER, false, 1);
+ ASSERT_NE(Element(0), element2);
hidl_vec<Element> eins = {element1, element2};
hidl_vec<hidl_string> names = {hidl_string("first"), hidl_string("second")};
hidl_vec<Size> arraySizesPtr = {1, 1};
Element element3 = context->elementComplexCreate(eins, names, arraySizesPtr);
- EXPECT_NE(Element(0), element3);
+ ASSERT_NE(Element(0), element3);
std::vector<Element> ids;
std::vector<std::string> namesOut;
@@ -395,10 +458,14 @@
// 1 x (uint8_t, uint32_t)
Type type = context->typeCreate(element3, 1, 0, 0, false, false, YuvFormat::YUV_NONE);
+ ASSERT_NE(Type(0), type);
+
// 1 x (uint8_t, uint32_t)
Allocation allocation = context->allocationCreateTyped(type, AllocationMipmapControl::NONE,
(int)AllocationUsageType::SCRIPT,
(Ptr)nullptr);
+ ASSERT_NE(Allocation(0), allocation);
+
std::vector<uint32_t> dataIn(1), dataOut(1);
std::generate(dataIn.begin(), dataIn.end(), [](){ static uint32_t val = 0; return val++; });
hidl_vec<uint8_t> _data;
diff --git a/renderscript/1.0/vts/functional/VtsMiscellaneousTests.cpp b/renderscript/1.0/vts/functional/VtsMiscellaneousTests.cpp
index 39d63ca..23b09ac 100644
--- a/renderscript/1.0/vts/functional/VtsMiscellaneousTests.cpp
+++ b/renderscript/1.0/vts/functional/VtsMiscellaneousTests.cpp
@@ -46,18 +46,18 @@
TEST_F(RenderscriptHidlTest, ElementTypeAllocationCreate) {
// Element create test
Element element = context->elementCreate(DataType::FLOAT_32, DataKind::USER, false, 1);
- EXPECT_NE(Element(0), element);
+ ASSERT_NE(Element(0), element);
// Type create test
Type type = context->typeCreate(element, 1, 0, 0, false, false, YuvFormat::YUV_NONE);
- EXPECT_NE(Type(0), type);
+ ASSERT_NE(Type(0), type);
// Allocation create test
Allocation allocation = context->allocationCreateTyped(type, AllocationMipmapControl::NONE,
(int)((uint32_t)AllocationUsageType::ALL
& ~(uint32_t)AllocationUsageType::OEM),
(Ptr)nullptr);
- EXPECT_NE(Allocation(0), allocation);
+ ASSERT_NE(Allocation(0), allocation);
// Allocation type test
Type type2 = context->allocationGetType(allocation);
@@ -74,8 +74,11 @@
TEST_F(RenderscriptHidlTest, MetadataTest) {
// float1
Element element = context->elementCreate(DataType::FLOAT_32, DataKind::USER, false, 1);
+ ASSERT_NE(Element(0), element);
+
// 128 x float1
Type type = context->typeCreate(element, 128, 0, 0, false, false, YuvFormat::YUV_NONE);
+ ASSERT_NE(Type(0), type);
std::vector<uint32_t> elementMetadata(5);
context->elementGetNativeMetadata(element, [&](const hidl_vec<uint32_t>& _metadata){
@@ -107,24 +110,30 @@
TEST_F(RenderscriptHidlTest, ResizeTest) {
// float1
Element element = context->elementCreate(DataType::FLOAT_32, DataKind::USER, false, 1);
+ ASSERT_NE(Element(0), element);
+
// 128 x float1
Type type = context->typeCreate(element, 128, 0, 0, false, false, YuvFormat::YUV_NONE);
+ ASSERT_NE(Type(0), type);
+
// 128 x float1
Allocation allocation = context->allocationCreateTyped(type, AllocationMipmapControl::NONE,
(int)AllocationUsageType::SCRIPT,
(Ptr)nullptr);
+ ASSERT_NE(Allocation(0), allocation);
+
Ptr dataPtr1, dataPtr2;
Size stride;
context->allocationGetPointer(allocation, 0, AllocationCubemapFace::POSITIVE_X, 0,
[&](Ptr _dataPtr, Size _stride){
dataPtr1 = _dataPtr; stride = _stride; });
- EXPECT_EQ(0ul, stride);
+ EXPECT_EQ(Size(0), stride);
context->allocationResize1D(allocation, 1024*1024);
context->allocationGetPointer(allocation, 0, AllocationCubemapFace::POSITIVE_X, 0,
[&](Ptr _dataPtr, Size _stride){
dataPtr2 = _dataPtr; stride = _stride; });
- EXPECT_EQ(0ul, stride);
+ EXPECT_EQ(Size(0), stride);
EXPECT_NE(dataPtr1, dataPtr2);
}
@@ -139,8 +148,12 @@
TEST_F(RenderscriptHidlTest, NativeWindowIoTest) {
// uint8x4
Element element = context->elementCreate(DataType::UNSIGNED_8, DataKind::USER, false, 4);
+ ASSERT_NE(Element(0), element);
+
// 512 x 512 x uint8x4
Type type = context->typeCreate(element, 512, 512, 0, false, false, YuvFormat::YUV_NONE);
+ ASSERT_NE(Type(0), type);
+
std::vector<uint32_t> dataIn(512*512), dataOut(512*512);
std::generate(dataIn.begin(), dataIn.end(), [](){ static uint32_t val = 0; return val++; });
hidl_vec<uint8_t> _data;
@@ -150,12 +163,16 @@
(int)(AllocationUsageType::SCRIPT
| AllocationUsageType::IO_INPUT),
(Ptr)nullptr);
+ ASSERT_NE(Allocation(0), allocationRecv);
+
Allocation allocationSend = context->allocationCreateTyped(type, AllocationMipmapControl::NONE,
(int)(AllocationUsageType::SCRIPT
| AllocationUsageType::IO_OUTPUT),
(Ptr)nullptr);
+ ASSERT_NE(Allocation(0), allocationSend);
+
NativeWindow nativeWindow = context->allocationGetNativeWindow(allocationRecv);
- EXPECT_NE(NativeWindow(0), nativeWindow);
+ ASSERT_NE(NativeWindow(0), nativeWindow);
((ANativeWindow *)nativeWindow)->incStrong(nullptr);
@@ -174,14 +191,20 @@
* two allocations with IO_INPUT are made to share the same BufferQueue.
*
* Calls: elementCreate, typeCreate, allocationCreateTyped,
- * allocationCreateFromBitmap, allocationSetupBufferQueue,
- * allocationShareBufferQueue
+ * allocationSetupBufferQueue, allocationShareBufferQueue,
+ * allocationGetNativeWindow, allocationSetNativeWindow,
+ * allocation2DWrite, allocation2DRead, allocationIoSend,
+ * allocationIoReceive
*/
TEST_F(RenderscriptHidlTest, BufferQueueTest) {
// uint8x4
Element element = context->elementCreate(DataType::UNSIGNED_8, DataKind::USER, false, 4);
+ ASSERT_NE(Element(0), element);
+
// 512 x 512 x uint8x4
Type type = context->typeCreate(element, 512, 512, 0, false, false, YuvFormat::YUV_NONE);
+ ASSERT_NE(Type(0), type);
+
std::vector<uint32_t> dataIn(512*512), dataOut1(512*512), dataOut2(512*512);
std::generate(dataIn.begin(), dataIn.end(), [](){ static uint32_t val = 0; return val++; });
hidl_vec<uint8_t> _data;
@@ -191,20 +214,28 @@
(int)(AllocationUsageType::SCRIPT
| AllocationUsageType::IO_INPUT),
(Ptr)nullptr);
+ ASSERT_NE(Allocation(0), allocationRecv1);
+
Allocation allocationRecv2 = context->allocationCreateTyped(type, AllocationMipmapControl::NONE,
(int)(AllocationUsageType::SCRIPT
| AllocationUsageType::IO_INPUT),
(Ptr)nullptr);
+ ASSERT_NE(Allocation(0), allocationRecv2);
+
Allocation allocationSend = context->allocationCreateTyped(type, AllocationMipmapControl::NONE,
(int)(AllocationUsageType::SCRIPT
| AllocationUsageType::IO_INPUT),
(Ptr)nullptr);
+ ASSERT_NE(Allocation(0), allocationSend);
+
context->allocationSetupBufferQueue(allocationRecv1, 2);
context->allocationShareBufferQueue(allocationRecv2, allocationRecv1);
NativeWindow nativeWindow1 = context->allocationGetNativeWindow(allocationRecv1);
- EXPECT_NE(NativeWindow(0), nativeWindow1);
+ ASSERT_NE(NativeWindow(0), nativeWindow1);
+
NativeWindow nativeWindow2 = context->allocationGetNativeWindow(allocationRecv2);
+ ASSERT_NE(NativeWindow(0), nativeWindow2);
EXPECT_EQ(nativeWindow2, nativeWindow1);
((ANativeWindow *)nativeWindow1)->incStrong(nullptr);
@@ -269,6 +300,8 @@
context->contextSetCacheDir("/data/local/tmp/temp/");
Element element = context->elementCreate(DataType::UNSIGNED_8, DataKind::USER, false, 1);
+ ASSERT_NE(Element(0), element);
+
std::string nameIn = "element_test_name";
std::string nameOut = "not_name";
hidl_string _nameIn;
diff --git a/renderscript/1.0/vts/functional/VtsScriptTests.cpp b/renderscript/1.0/vts/functional/VtsScriptTests.cpp
index 6bb375a..fed7c6e 100644
--- a/renderscript/1.0/vts/functional/VtsScriptTests.cpp
+++ b/renderscript/1.0/vts/functional/VtsScriptTests.cpp
@@ -25,6 +25,8 @@
TEST_F(RenderscriptHidlTest, IntrinsicTest) {
// uint8
Element element = context->elementCreate(DataType::UNSIGNED_8, DataKind::USER, false, 1);
+ EXPECT_NE(Element(0), element);
+
Script script = context->scriptIntrinsicCreate(ScriptIntrinsicID::ID_BLUR, element);
EXPECT_NE(Script(0), script);
@@ -43,7 +45,7 @@
hidl_vec<uint8_t> bitcode;
bitcode.setToExternal((uint8_t*)bitCode, bitCodeLength);
Script script = context->scriptCCreate("struct_test", "/data/local/tmp/", bitcode);
- EXPECT_NE(Script(0), script);
+ ASSERT_NE(Script(0), script);
// arg tests
context->scriptSetVarI(script, mExportVarIdx_var_int, 100);
@@ -75,12 +77,18 @@
// float1
Element element = context->elementCreate(DataType::FLOAT_32, DataKind::USER, false, 1);
+ ASSERT_NE(Element(0), element);
+
// 128 x float1
Type type = context->typeCreate(element, 128, 0, 0, false, false, YuvFormat::YUV_NONE);
+ ASSERT_NE(Type(0), type);
+
// 128 x float1
Allocation allocationIn = context->allocationCreateTyped(type, AllocationMipmapControl::NONE,
(int)AllocationUsageType::SCRIPT,
(Ptr)nullptr);
+ ASSERT_NE(Allocation(0), allocationIn);
+
Allocation allocationOut = Allocation(0);
context->scriptSetVarObj(script, mExportVarIdx_var_allocation, (ObjectBase)allocationIn);
context->scriptGetVarV(script, mExportVarIdx_var_allocation, sizeof(ObjectBase),
@@ -107,6 +115,8 @@
_dimsVE.setToExternal((uint32_t*)dimsVE.data(), dimsVE.size());
// intx2 to represent point2 which is {int, int}
Element elementVE = context->elementCreate(DataType::SIGNED_32, DataKind::USER, false, 2);
+ ASSERT_NE(Element(0), elementVE);
+
context->scriptSetVarVE(script, mExportVarIdx_var_point2, _dataVE, elementVE, _dimsVE);
context->scriptGetVarV(script, mExportVarIdx_var_point2, 2*sizeof(int),
[&](const hidl_vec<uint8_t>& _data){
@@ -126,7 +136,7 @@
hidl_vec<uint8_t> bitcode;
bitcode.setToExternal((uint8_t*)bitCode, bitCodeLength);
Script script = context->scriptCCreate("struct_test", "/data/local/tmp/", bitcode);
- EXPECT_NE(Script(0), script);
+ ASSERT_NE(Script(0), script);
// invoke test
int resultI = 0;
@@ -185,12 +195,16 @@
hidl_vec<uint8_t> bitcode;
bitcode.setToExternal((uint8_t*)bitCode, bitCodeLength);
Script script = context->scriptCCreate("struct_test", "/data/local/tmp/", bitcode);
- EXPECT_NE(Script(0), script);
+ ASSERT_NE(Script(0), script);
// uint8_t
Element element = context->elementCreate(DataType::UNSIGNED_8, DataKind::USER, false, 1);
+ ASSERT_NE(Element(0), element);
+
// 64 x uint8_t
Type type = context->typeCreate(element, 64, 0, 0, false, false, YuvFormat::YUV_NONE);
+ ASSERT_NE(Type(0), type);
+
std::vector<uint8_t> dataIn(64), dataOut(64), expected(64);
std::generate(dataIn.begin(), dataIn.end(), [](){ static uint8_t val = 0; return val++; });
std::generate(expected.begin(), expected.end(), [](){ static uint8_t val = 1; return val++; });
@@ -200,9 +214,13 @@
Allocation allocation = context->allocationCreateTyped(type, AllocationMipmapControl::NONE,
(int)AllocationUsageType::SCRIPT,
(Ptr)nullptr);
+ ASSERT_NE(Allocation(0), allocation);
+
Allocation vout = context->allocationCreateTyped(type, AllocationMipmapControl::NONE,
(int)AllocationUsageType::SCRIPT,
(Ptr)nullptr);
+ ASSERT_NE(Allocation(0), vout);
+
context->allocation1DWrite(allocation, 0, 0, (Size)dataIn.size(), _data);
hidl_vec<Allocation> vains;
vains.setToExternal(&allocation, 1);
@@ -223,13 +241,19 @@
hidl_vec<uint8_t> bitcode;
bitcode.setToExternal((uint8_t*)bitCode, bitCodeLength);
Script script = context->scriptCCreate("struct_test", "/data/local/tmp/", bitcode);
- EXPECT_NE(Script(0), script);
+ ASSERT_NE(Script(0), script);
// uint8_t
Element element = context->elementCreate(DataType::SIGNED_32, DataKind::USER, false, 1);
+ ASSERT_NE(Element(0), element);
+
// 64 x uint8_t
Type type = context->typeCreate(element, 64, 0, 0, false, false, YuvFormat::YUV_NONE);
+ ASSERT_NE(Type(0), type);
+
Type type2 = context->typeCreate(element, 1, 0, 0, false, false, YuvFormat::YUV_NONE);
+ ASSERT_NE(Type(0), type2);
+
std::vector<int> dataIn(64), dataOut(1);
std::generate(dataIn.begin(), dataIn.end(), [](){ static int val = 0; return val++; });
hidl_vec<uint8_t> _data;
@@ -238,9 +262,13 @@
Allocation allocation = context->allocationCreateTyped(type, AllocationMipmapControl::NONE,
(int)AllocationUsageType::SCRIPT,
(Ptr)nullptr);
+ ASSERT_NE(Allocation(0), allocation);
+
Allocation vaout = context->allocationCreateTyped(type2, AllocationMipmapControl::NONE,
(int)AllocationUsageType::SCRIPT,
(Ptr)nullptr);
+ ASSERT_NE(Allocation(0), vaout);
+
context->allocation1DWrite(allocation, 0, 0, (Size)dataIn.size(), _data);
hidl_vec<Allocation> vains;
vains.setToExternal(&allocation, 1);
@@ -257,22 +285,29 @@
* RenderScript script, represented in the bitcode.
*
* Calls: scriptCCreate, elementCreate, typeCreate, allocationCreateTyped,
- * scriptSetVarV, scriptBindAllocation, allocationRead
+ * allocation1DWrite, scriptBindAllocation, scriptSetVarV, scriptBindAllocation,
+ * allocationRead, scriptInvokeV, allocationRead
*/
TEST_F(RenderscriptHidlTest, ScriptBindTest) {
hidl_vec<uint8_t> bitcode;
bitcode.setToExternal((uint8_t*)bitCode, bitCodeLength);
Script script = context->scriptCCreate("struct_test", "/data/local/tmp/", bitcode);
- EXPECT_NE(Script(0), script);
+ ASSERT_NE(Script(0), script);
// in32
Element element = context->elementCreate(DataType::SIGNED_32, DataKind::USER, false, 1);
+ ASSERT_NE(Element(0), element);
+
// 64 x int32
Type type = context->typeCreate(element, 64, 0, 0, false, false, YuvFormat::YUV_NONE);
+ ASSERT_NE(Type(0), type);
+
// 64 x int32
Allocation allocation = context->allocationCreateTyped(type, AllocationMipmapControl::NONE,
(int)AllocationUsageType::SCRIPT,
(Ptr)nullptr);
+ ASSERT_NE(Allocation(0), allocation);
+
std::vector<int> dataIn(64), dataOut(64), expected(64, 5);
hidl_vec<uint8_t> _data;
_data.setToExternal((uint8_t*)dataIn.data(), dataIn.size()*sizeof(int));
@@ -295,7 +330,8 @@
*
* Calls: elementCreate, typeCreate, allocationCreateTyped, allocation2DWrite,
* scriptIntrinsicCreate, scriptKernelIDCreate, scriptFieldIDCreate,
- * scriptGroupCreate, scriptGroupSetOutput, scriptGroupExecute, allocation2DRead
+ * scriptGroupCreate, scriptSetVarObj, scriptGroupSetOutput, scriptGroupExecute,
+ * contextFinish, allocation2DRead
*/
TEST_F(RenderscriptHidlTest, ScriptGroupTest) {
std::vector<uint8_t> dataIn(256*256*1, 128), dataOut(256*256*4, 0), zeros(256*256*4, 0);
@@ -305,36 +341,49 @@
// 256 x 256 YUV pixels
Element element1 = context->elementCreate(DataType::UNSIGNED_8, DataKind::PIXEL_YUV, true, 1);
+ ASSERT_NE(Element(0), element1);
+
Type type1 = context->typeCreate(element1, 256, 256, 0, false, false, YuvFormat::YUV_420_888);
+ ASSERT_NE(Type(0), type1);
+
Allocation allocation1 = context->allocationCreateTyped(type1, AllocationMipmapControl::NONE,
(int)AllocationUsageType::SCRIPT,
(Ptr)nullptr);
+ ASSERT_NE(Allocation(0), allocation1);
+
context->allocation2DWrite(allocation1, 0, 0, 0, AllocationCubemapFace::POSITIVE_X, 256, 256,
_dataIn, 0);
// 256 x 256 RGBA pixels
Element element2 = context->elementCreate(DataType::UNSIGNED_8, DataKind::PIXEL_RGBA, true, 4);
+ ASSERT_NE(Element(0), element2);
+
Type type2 = context->typeCreate(element2, 256, 256, 0, false, false, YuvFormat::YUV_NONE);
+ ASSERT_NE(Type(0), type2);
+
Allocation allocation2 = context->allocationCreateTyped(type2, AllocationMipmapControl::NONE,
(int)AllocationUsageType::SCRIPT,
(Ptr)nullptr);
+ ASSERT_NE(Allocation(0), allocation2);
+
context->allocation2DWrite(allocation2, 0, 0, 0, AllocationCubemapFace::POSITIVE_X, 256, 256,
_dataOut, 0);
// create scripts
Script yuv2rgb = context->scriptIntrinsicCreate(ScriptIntrinsicID::ID_YUV_TO_RGB, element1);
- EXPECT_NE(Script(0), yuv2rgb);
+ ASSERT_NE(Script(0), yuv2rgb);
ScriptKernelID yuv2rgbKID = context->scriptKernelIDCreate(yuv2rgb, 0, 2);
- EXPECT_NE(ScriptKernelID(0), yuv2rgbKID);
+ ASSERT_NE(ScriptKernelID(0), yuv2rgbKID);
Script blur = context->scriptIntrinsicCreate(ScriptIntrinsicID::ID_BLUR, element2);
- EXPECT_NE(Script(0), blur);
+ ASSERT_NE(Script(0), blur);
ScriptKernelID blurKID = context->scriptKernelIDCreate(blur, 0, 2);
- EXPECT_NE(ScriptKernelID(0), blurKID);
+ ASSERT_NE(ScriptKernelID(0), blurKID);
+
ScriptFieldID blurFID = context->scriptFieldIDCreate(blur, 1);
- EXPECT_NE(ScriptFieldID(0), blurFID);
+ ASSERT_NE(ScriptFieldID(0), blurFID);
// ScriptGroup
hidl_vec<ScriptKernelID> kernels = {yuv2rgbKID, blurKID};
@@ -343,7 +392,7 @@
hidl_vec<ScriptFieldID> dstF = {blurFID};
hidl_vec<Type> types = {type2};
ScriptGroup scriptGroup = context->scriptGroupCreate(kernels, srcK, dstK, dstF, types);
- EXPECT_NE(ScriptGroup(0), scriptGroup);
+ ASSERT_NE(ScriptGroup(0), scriptGroup);
context->scriptSetVarObj(yuv2rgb, 0, (ObjectBase)allocation1);
context->scriptGroupSetOutput(scriptGroup, blurKID, allocation2);
@@ -360,14 +409,16 @@
* Similar to the ScriptGroup test, this test verifies the execution flow of
* RenderScript kernels and invokables.
*
- * Calls: scriptFieldIDCreate, closureCreate, scriptInvokeIDCreate,
- * invokeClosureCreate, closureSetGlobal, scriptGroup2Create, scriptGroupExecute
+ * Calls: scriptCCreate, elementCreate, typeCreate, allocationCreateTyped,
+ * allocation1DWrite, scriptFieldIDCreate, scriptInvokeIDCreate,
+ * invokeClosureCreate, closureCreate, closureSetGlobal, scriptGroup2Create,
+ * scriptGroupExecute, allocationRead
*/
TEST_F(RenderscriptHidlTest, ScriptGroup2Test) {
hidl_vec<uint8_t> bitcode;
bitcode.setToExternal((uint8_t*)bitCode, bitCodeLength);
Script script = context->scriptCCreate("struct_test", "/data/local/tmp/", bitcode);
- EXPECT_NE(Script(0), script);
+ ASSERT_NE(Script(0), script);
std::vector<uint8_t> dataIn(128, 128), dataOut(128, 0), expected(128, 7+1);
hidl_vec<uint8_t> _dataIn, _dataOut;
@@ -375,19 +426,23 @@
// 256 x 256 YUV pixels
Element element = context->elementCreate(DataType::UNSIGNED_8, DataKind::USER, false, 1);
+ ASSERT_NE(Element(0), element);
+
Type type = context->typeCreate(element, 128, 0, 0, false, false, YuvFormat::YUV_NONE);
+ ASSERT_NE(Type(0), type);
+
Allocation allocation = context->allocationCreateTyped(type, AllocationMipmapControl::NONE,
(int)AllocationUsageType::SCRIPT,
(Ptr)nullptr);
+ ASSERT_NE(Allocation(0), allocation);
+
context->allocation1DWrite(allocation, 0, 0, (Size)_dataIn.size(), _dataIn);
ScriptFieldID fieldID = context->scriptFieldIDCreate(script, mExportVarIdx_var_allocation);
- EXPECT_NE(ScriptFieldID(0), fieldID);
ASSERT_NE(ScriptFieldID(0), fieldID);
// invoke
ScriptInvokeID invokeID = context->scriptInvokeIDCreate(script, mExportFuncIdx_setAllocation);
- EXPECT_NE(ScriptInvokeID(0), invokeID);
ASSERT_NE(ScriptInvokeID(0), invokeID);
int dim = 128;
@@ -397,12 +452,10 @@
hidl_vec<int64_t> values1 = {int64_t(0)};
hidl_vec<int32_t> sizes1 = {int32_t(0)};
Closure closure1 = context->invokeClosureCreate(invokeID, params, fieldIDS1, values1, sizes1);
- EXPECT_NE(Closure(0), closure1);
ASSERT_NE(Closure(0), closure1);
// kernel
ScriptKernelID kernelID = context->scriptKernelIDCreate(script, mExportForEachIdx_increment, 3);
- EXPECT_NE(ScriptKernelID(0), kernelID);
ASSERT_NE(ScriptKernelID(0), kernelID);
hidl_vec<ScriptFieldID> fieldIDS2 = {ScriptFieldID(0)};
@@ -412,7 +465,6 @@
hidl_vec<ScriptFieldID> depFieldIDS2 = {fieldID};
Closure closure2 = context->closureCreate(kernelID, allocation /* returnValue */, fieldIDS2,
values2, sizes2, depClosures2, depFieldIDS2);
- EXPECT_NE(Closure(0), closure2);
ASSERT_NE(Closure(0), closure2);
// set argument
@@ -424,7 +476,6 @@
hidl_string cacheDir = "/data/local/tmp";
hidl_vec<Closure> closures = {closure1, closure2};
ScriptGroup2 scriptGroup2 = context->scriptGroup2Create(name, cacheDir, closures);
- EXPECT_NE(ScriptGroup2(0), scriptGroup2);
ASSERT_NE(ScriptGroup2(0), scriptGroup2);
context->scriptGroupExecute(scriptGroup2);
@@ -436,14 +487,15 @@
* Similar to the ScriptGroup test, this test verifies a single kernel can be
* called by ScriptGroup with an unbound allocation specified before launch
*
- * Calls: scriptFieldIDCreate, closureCreate, scriptInvokeIDCreate,
- * invokeClosureCreate, closureSetArg, scriptGroup2Create, scriptGroupExecute
+ * Calls: scriptCCreate, elementCreate, typeCreate, allocationCreateTyped,
+ * allocation1DWrite, scriptKernelIDCreate, closureCreate, closureSetArg,
+ * scriptGroup2Create, scriptGroupExecute, allocationRead
*/
TEST_F(RenderscriptHidlTest, ScriptGroup2KernelTest) {
hidl_vec<uint8_t> bitcode;
bitcode.setToExternal((uint8_t*)bitCode, bitCodeLength);
Script script = context->scriptCCreate("struct_test", "/data/local/tmp/", bitcode);
- EXPECT_NE(Script(0), script);
+ ASSERT_NE(Script(0), script);
std::vector<uint8_t> dataIn(128, 128), dataOut(128, 0), expected(128, 128 + 1);
hidl_vec<uint8_t> _dataIn, _dataOut;
@@ -451,15 +503,20 @@
// 256 x 256 YUV pixels
Element element = context->elementCreate(DataType::UNSIGNED_8, DataKind::USER, false, 1);
+ ASSERT_NE(Element(0), element);
+
Type type = context->typeCreate(element, 128, 0, 0, false, false, YuvFormat::YUV_NONE);
+ ASSERT_NE(Type(0), type);
+
Allocation allocation = context->allocationCreateTyped(type, AllocationMipmapControl::NONE,
(int)AllocationUsageType::SCRIPT,
(Ptr)nullptr);
+ ASSERT_NE(Allocation(0), allocation);
+
context->allocation1DWrite(allocation, 0, 0, (Size)_dataIn.size(), _dataIn);
// kernel
ScriptKernelID kernelID = context->scriptKernelIDCreate(script, mExportForEachIdx_increment, 3);
- EXPECT_NE(ScriptKernelID(0), kernelID);
ASSERT_NE(ScriptKernelID(0), kernelID);
hidl_vec<ScriptFieldID> fieldIDS = {ScriptFieldID(0)};
@@ -469,7 +526,6 @@
hidl_vec<ScriptFieldID> depFieldIDS = {ScriptFieldID(0)};
Closure closure = context->closureCreate(kernelID, allocation /* returnValue */, fieldIDS,
values, sizes, depClosures, depFieldIDS);
- EXPECT_NE(Closure(0), closure);
ASSERT_NE(Closure(0), closure);
// set argument
@@ -480,7 +536,6 @@
hidl_string cacheDir = "/data/local/tmp";
hidl_vec<Closure> closures = {closure};
ScriptGroup2 scriptGroup2 = context->scriptGroup2Create(name, cacheDir, closures);
- EXPECT_NE(ScriptGroup2(0), scriptGroup2);
ASSERT_NE(ScriptGroup2(0), scriptGroup2);
context->scriptGroupExecute(scriptGroup2);
diff --git a/soundtrigger/2.0/types.hal b/soundtrigger/2.0/types.hal
index fc7d019..99bbd56 100644
--- a/soundtrigger/2.0/types.hal
+++ b/soundtrigger/2.0/types.hal
@@ -75,8 +75,3 @@
vec<ConfidenceLevel> levels;
};
-/** TODO(elaurent) remove when Java build problem is fixed */
-union Dummy {
- uint32_t dummy1;
- int32_t dummy2;
-};
diff --git a/wifi/supplicant/1.0/vts/functional/supplicant_p2p_iface_hidl_test.cpp b/wifi/supplicant/1.0/vts/functional/supplicant_p2p_iface_hidl_test.cpp
index d746a01..5a210d6 100644
--- a/wifi/supplicant/1.0/vts/functional/supplicant_p2p_iface_hidl_test.cpp
+++ b/wifi/supplicant/1.0/vts/functional/supplicant_p2p_iface_hidl_test.cpp
@@ -29,6 +29,7 @@
using ::android::hardware::hidl_vec;
using ::android::hardware::Return;
using ::android::hardware::Void;
+using ::android::hardware::wifi::supplicant::V1_0::IfaceType;
using ::android::hardware::wifi::supplicant::V1_0::ISupplicantP2pIface;
using ::android::hardware::wifi::supplicant::V1_0::ISupplicantP2pIfaceCallback;
using ::android::hardware::wifi::supplicant::V1_0::SupplicantNetworkId;
@@ -180,6 +181,26 @@
}
/*
+ * GetName
+ */
+TEST_F(SupplicantP2pIfaceHidlTest, GetName) {
+ const auto& status_and_interface_name = HIDL_INVOKE(p2p_iface_, getName);
+ EXPECT_EQ(SupplicantStatusCode::SUCCESS,
+ status_and_interface_name.first.code);
+ EXPECT_FALSE(std::string(status_and_interface_name.second).empty());
+}
+
+/*
+ * GetType
+ */
+TEST_F(SupplicantP2pIfaceHidlTest, GetType) {
+ const auto& status_and_interface_type = HIDL_INVOKE(p2p_iface_, getType);
+ EXPECT_EQ(SupplicantStatusCode::SUCCESS,
+ status_and_interface_type.first.code);
+ EXPECT_EQ(status_and_interface_type.second, IfaceType::P2P);
+}
+
+/*
* GetDeviceAddress
*/
TEST_F(SupplicantP2pIfaceHidlTest, GetDeviceAddress) {
@@ -221,10 +242,6 @@
p2p_iface_->stopFind([](const SupplicantStatus& status) {
EXPECT_EQ(SupplicantStatusCode::SUCCESS, status.code);
});
-
- p2p_iface_->stopFind([](const SupplicantStatus& status) {
- EXPECT_NE(SupplicantStatusCode::SUCCESS, status.code);
- });
}
/*
diff --git a/wifi/supplicant/1.0/vts/functional/supplicant_sta_iface_hidl_test.cpp b/wifi/supplicant/1.0/vts/functional/supplicant_sta_iface_hidl_test.cpp
index 5abf4e0..3670321 100644
--- a/wifi/supplicant/1.0/vts/functional/supplicant_sta_iface_hidl_test.cpp
+++ b/wifi/supplicant/1.0/vts/functional/supplicant_sta_iface_hidl_test.cpp
@@ -20,6 +20,7 @@
#include <android/hardware/wifi/supplicant/1.0/ISupplicantStaIface.h>
+#include "supplicant_hidl_call_util.h"
#include "supplicant_hidl_test_utils.h"
using ::android::sp;
@@ -28,6 +29,7 @@
using ::android::hardware::hidl_vec;
using ::android::hardware::Return;
using ::android::hardware::Void;
+using ::android::hardware::wifi::supplicant::V1_0::IfaceType;
using ::android::hardware::wifi::supplicant::V1_0::ISupplicantStaIface;
using ::android::hardware::wifi::supplicant::V1_0::ISupplicantStaIfaceCallback;
using ::android::hardware::wifi::supplicant::V1_0::ISupplicantStaNetwork;
@@ -163,6 +165,26 @@
}
/*
+ * GetName
+ */
+TEST_F(SupplicantStaIfaceHidlTest, GetName) {
+ const auto& status_and_interface_name = HIDL_INVOKE(sta_iface_, getName);
+ EXPECT_EQ(SupplicantStatusCode::SUCCESS,
+ status_and_interface_name.first.code);
+ EXPECT_FALSE(std::string(status_and_interface_name.second).empty());
+}
+
+/*
+ * GetType
+ */
+TEST_F(SupplicantStaIfaceHidlTest, GetType) {
+ const auto& status_and_interface_type = HIDL_INVOKE(sta_iface_, getType);
+ EXPECT_EQ(SupplicantStatusCode::SUCCESS,
+ status_and_interface_type.first.code);
+ EXPECT_EQ(status_and_interface_type.second, IfaceType::STA);
+}
+
+/*
* listNetworks.
*/
TEST_F(SupplicantStaIfaceHidlTest, listNetworks) {
diff --git a/wifi/supplicant/1.0/vts/functional/supplicant_sta_network_hidl_test.cpp b/wifi/supplicant/1.0/vts/functional/supplicant_sta_network_hidl_test.cpp
index aa84e9a..832dd41 100644
--- a/wifi/supplicant/1.0/vts/functional/supplicant_sta_network_hidl_test.cpp
+++ b/wifi/supplicant/1.0/vts/functional/supplicant_sta_network_hidl_test.cpp
@@ -22,6 +22,7 @@
#include <android/hardware/wifi/supplicant/1.0/ISupplicantStaNetwork.h>
+#include "supplicant_hidl_call_util.h"
#include "supplicant_hidl_test_utils.h"
using ::android::sp;
@@ -30,6 +31,7 @@
using ::android::hardware::hidl_vec;
using ::android::hardware::Return;
using ::android::hardware::Void;
+using ::android::hardware::wifi::supplicant::V1_0::IfaceType;
using ::android::hardware::wifi::supplicant::V1_0::ISupplicantStaIface;
using ::android::hardware::wifi::supplicant::V1_0::ISupplicantStaNetwork;
using ::android::hardware::wifi::supplicant::V1_0::
@@ -39,7 +41,7 @@
namespace {
constexpr char kTestSsidStr[] = "TestSsid1234";
-constexpr char kTestPsk[] = "TestPsk123";
+constexpr char kTestPskPassphrase[] = "TestPsk123";
constexpr char kTestIdStr[] = "TestIdstr";
constexpr char kTestEapPasswdStr[] = "TestEapPasswd1234";
constexpr char kTestEapCert[] = "keystore://CERT";
@@ -54,7 +56,10 @@
constexpr uint8_t kTestIk[] = {[0 ... 15] = 0x65};
constexpr uint8_t kTestCk[] = {[0 ... 15] = 0x45};
constexpr uint8_t kTestIdentity[] = {0x45, 0x67, 0x98, 0x67, 0x56};
+constexpr uint8_t kTestPsk[] = {[0 ... 31] = 0x12};
+constexpr uint8_t kTestAutParam[] = {[0 ... 13] = 0xe1};
constexpr uint32_t kTestWepTxKeyIdx = 2;
+constexpr uint32_t kTestUpdateIdentifier = 21;
constexpr uint32_t kTestKeyMgmt = (ISupplicantStaNetwork::KeyMgmtMask::WPA_PSK |
ISupplicantStaNetwork::KeyMgmtMask::WPA_EAP);
constexpr uint32_t kTestProto = (ISupplicantStaNetwork::ProtoMask::OSEN |
@@ -137,6 +142,27 @@
});
}
+/*
+ * GetInterfaceName
+ */
+TEST_F(SupplicantStaNetworkHidlTest, GetInterfaceName) {
+ const auto& status_and_interface_name =
+ HIDL_INVOKE(sta_network_, getInterfaceName);
+ EXPECT_EQ(SupplicantStatusCode::SUCCESS,
+ status_and_interface_name.first.code);
+ EXPECT_FALSE(std::string(status_and_interface_name.second).empty());
+}
+
+/*
+ * GetType
+ */
+TEST_F(SupplicantStaNetworkHidlTest, GetType) {
+ const auto& status_and_interface_type = HIDL_INVOKE(sta_network_, getType);
+ EXPECT_EQ(SupplicantStatusCode::SUCCESS,
+ status_and_interface_type.first.code);
+ EXPECT_EQ(status_and_interface_type.second, IfaceType::STA);
+}
+
/* Tests out the various setter/getter methods. */
/*
* SetGetSsid
@@ -246,17 +272,29 @@
*/
TEST_F(SupplicantStaNetworkHidlTest, SetGetPskPassphrase) {
sta_network_->setPskPassphrase(
- kTestPsk, [](const SupplicantStatus& status) {
+ kTestPskPassphrase, [](const SupplicantStatus& status) {
EXPECT_EQ(SupplicantStatusCode::SUCCESS, status.code);
});
sta_network_->getPskPassphrase(
[&](const SupplicantStatus& status, const hidl_string& psk) {
EXPECT_EQ(SupplicantStatusCode::SUCCESS, status.code);
- EXPECT_EQ(kTestPsk, std::string(psk.c_str()));
+ EXPECT_EQ(kTestPskPassphrase, std::string(psk.c_str()));
});
}
/*
+ * SetGetPsk
+ */
+TEST_F(SupplicantStaNetworkHidlTest, SetGetPsk) {
+ EXPECT_EQ(SupplicantStatusCode::SUCCESS,
+ HIDL_INVOKE(sta_network_, setPsk, kTestPsk).code);
+ const auto& status_and_psk = HIDL_INVOKE(sta_network_, getPsk);
+ EXPECT_EQ(SupplicantStatusCode::SUCCESS, status_and_psk.first.code);
+ hidl_array<uint8_t, 32> expected_psk(kTestPsk);
+ EXPECT_EQ(expected_psk, status_and_psk.second);
+}
+
+/*
* SetGetWepKeys
*/
TEST_F(SupplicantStaNetworkHidlTest, SetGetWepTxKeyIdx) {
@@ -361,6 +399,12 @@
* SetGetEapPhase2Method
*/
TEST_F(SupplicantStaNetworkHidlTest, SetGetEapPhase2Method) {
+ ISupplicantStaNetwork::EapMethod set_eap_method =
+ ISupplicantStaNetwork::EapMethod::PEAP;
+ sta_network_->setEapMethod(
+ set_eap_method, [](const SupplicantStatus& status) {
+ EXPECT_EQ(SupplicantStatusCode::SUCCESS, status.code);
+ });
ISupplicantStaNetwork::EapPhase2Method set_eap_phase2_method =
ISupplicantStaNetwork::EapPhase2Method::NONE;
sta_network_->setEapPhase2Method(
@@ -500,6 +544,21 @@
}
/*
+ * SetGetEapSubjectMatch
+ */
+TEST_F(SupplicantStaNetworkHidlTest, SetGetEapSubjectMatch) {
+ EXPECT_EQ(
+ SupplicantStatusCode::SUCCESS,
+ HIDL_INVOKE(sta_network_, setEapSubjectMatch, kTestEapMatch).code);
+ const auto& status_and_subject_match =
+ HIDL_INVOKE(sta_network_, getEapSubjectMatch);
+ EXPECT_EQ(SupplicantStatusCode::SUCCESS,
+ status_and_subject_match.first.code);
+ EXPECT_EQ(kTestEapMatch,
+ std::string(status_and_subject_match.second.c_str()));
+}
+
+/*
* SetGetEapDomainSuffixMatch
*/
TEST_F(SupplicantStaNetworkHidlTest, SetGetEapDomainSuffixMatch) {
@@ -634,6 +693,14 @@
}
/*
+ * SendNetworkEapSimGsmAuthFailure
+ */
+TEST_F(SupplicantStaNetworkHidlTest, SendNetworkEapSimGsmAuthFailure) {
+ EXPECT_EQ(SupplicantStatusCode::SUCCESS,
+ HIDL_INVOKE(sta_network_, sendNetworkEapSimGsmAuthFailure).code);
+}
+
+/*
* SendNetworkEapSimUmtsAuthResponse
*/
TEST_F(SupplicantStaNetworkHidlTest, SendNetworkEapSimUmtsAuthResponse) {
@@ -648,6 +715,24 @@
}
/*
+ * SendNetworkEapSimUmtsAuthFailure
+ */
+TEST_F(SupplicantStaNetworkHidlTest, SendNetworkEapSimUmtsAuthFailure) {
+ EXPECT_EQ(SupplicantStatusCode::SUCCESS,
+ HIDL_INVOKE(sta_network_, sendNetworkEapSimUmtsAuthFailure).code);
+}
+
+/*
+ * SendNetworkEapSimUmtsAutsResponse
+ */
+TEST_F(SupplicantStaNetworkHidlTest, SendNetworkEapSimUmtsAutsResponse) {
+ EXPECT_EQ(SupplicantStatusCode::SUCCESS,
+ HIDL_INVOKE(sta_network_, sendNetworkEapSimUmtsAutsResponse,
+ kTestAutParam)
+ .code);
+}
+
+/*
* SendNetworkEapIdentityResponse
*/
TEST_F(SupplicantStaNetworkHidlTest, SendNetworkEapIdentityResponse) {
@@ -658,3 +743,40 @@
EXPECT_EQ(SupplicantStatusCode::SUCCESS, status.code);
});
}
+
+/*
+ * SetUpdateIdentifier
+ */
+TEST_F(SupplicantStaNetworkHidlTest, SetUpdateIdentifier) {
+ EXPECT_EQ(
+ SupplicantStatusCode::SUCCESS,
+ HIDL_INVOKE(sta_network_, setUpdateIdentifier, kTestUpdateIdentifier)
+ .code);
+}
+
+/*
+ * SetProactiveKeyCaching
+ */
+TEST_F(SupplicantStaNetworkHidlTest, SetProactiveKeyCaching) {
+ EXPECT_EQ(SupplicantStatusCode::SUCCESS,
+ HIDL_INVOKE(sta_network_, setProactiveKeyCaching, true).code);
+ EXPECT_EQ(SupplicantStatusCode::SUCCESS,
+ HIDL_INVOKE(sta_network_, setProactiveKeyCaching, false).code);
+}
+
+/*
+ * GetWpsNfcConfigurationToken
+ */
+TEST_F(SupplicantStaNetworkHidlTest, GetWpsNfcConfigurationToken) {
+ ASSERT_EQ(SupplicantStatusCode::SUCCESS,
+ HIDL_INVOKE(sta_network_, setSsid, ssid_).code);
+ ASSERT_EQ(SupplicantStatusCode::SUCCESS,
+ HIDL_INVOKE(sta_network_, setKeyMgmt, kTestKeyMgmt).code);
+ ASSERT_EQ(
+ SupplicantStatusCode::SUCCESS,
+ HIDL_INVOKE(sta_network_, setPskPassphrase, kTestPskPassphrase).code);
+ const auto& status_and_token =
+ HIDL_INVOKE(sta_network_, getWpsNfcConfigurationToken);
+ EXPECT_EQ(SupplicantStatusCode::SUCCESS, status_and_token.first.code);
+ EXPECT_FALSE(0 == status_and_token.second.size());
+}