mirror of
https://github.com/openharmony/developtools_syscap_codec.git
synced 2026-08-27 20:29:57 -04:00
add decode rpcid.sc to string format.
add compare pcid with rpcid string. Signed-off-by: yudechen <chenyude@huawei.com> Change-Id: Ia030b8e25a03d042c1180f9942a6e36c6798e11c
This commit is contained in:
@@ -99,4 +99,40 @@ HWTEST_F(SyscapCodecTest, DecodePrivateSyscap, TestSize.Level1)
|
||||
EXPECT_EQ(decodePriCnt, 5);
|
||||
free(priOutput);
|
||||
}
|
||||
|
||||
/*
|
||||
* @tc.name: DecodeRpcidToStringFormat
|
||||
* @tc.desc: Check the DecodeRpcidToStringFormat Decoding.
|
||||
* @tc.type: FUNC
|
||||
*/
|
||||
HWTEST_F(SyscapCodecTest, DecodeRpcidToStringFormat, TestSize.Level1)
|
||||
{
|
||||
char inputfile[] = "/system/etc/rpcid.sc";
|
||||
char *out = DecodeRpcidToStringFormat(inputfile);
|
||||
EXPECT_TRUE(out);
|
||||
if (out != NULL) {
|
||||
printf("%s\n", out);
|
||||
free(out);
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* @tc.name: ComparePcidString
|
||||
* @tc.desc: Check the DecodeRpcidToStringFormat Decoding.
|
||||
* @tc.type: FUNC
|
||||
*/
|
||||
HWTEST_F(SyscapCodecTest, ComparePcidString, TestSize.Level1)
|
||||
{
|
||||
char pcidString[] = "132096,385875968,12,17268736,2,344130,4,0,0,0,0,\
|
||||
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,\
|
||||
SystemCapability.Device.xxx1,SystemCapability.Device.xxx2,\
|
||||
SystemCapability.Vendor.xxx1,SystemCapability.Vendor.xxx2";
|
||||
char rpcidString[] = "33588224,1665236995,4,262144,0,0,4,0,0,0,0,0,\
|
||||
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,\
|
||||
SystemCapability.Device.xxx1,\
|
||||
SystemCapability.Device.xxx2,\
|
||||
SystemCapability.Vendor.xxx1,\
|
||||
SystemCapability.Vendor.xxx2";
|
||||
EXPECT_TRUE(ComparePcidString(pcidString, rpcidString));
|
||||
}
|
||||
} // namespace Syscap
|
||||
|
||||
Reference in New Issue
Block a user