Update diagnostics/os_diagnostics.py

This commit is contained in:
2026-03-18 12:18:08 +00:00
parent c1808cfa75
commit f37df8b99a

View File

@@ -836,6 +836,12 @@ class UStructTest:
unpacked = struct.unpack('ii', packed)
print(f'Unpacked values using unpack(): {unpacked}')
print(unpacked == (42, 100))
if(unpacked == (42, 100)):
print("Completed Test 1/2: pack - SUCCESSFUL")
self.successfultests += 1
else:
print("Completed Test 1/2: pack - FAILED")
self.failedtests["pack"] = "Failed"
format_string = 'hhl'
size = struct.calcsize(format_string)
@@ -849,9 +855,11 @@ class UStructTest:
print("Unpacked buffer using unpack_from():", unpackedfrom)
if(unpackedfrom == (5, 10, 15)):
print("Completed Test 2/2: pack_into - SUCCESSFUL")
self.successfultests += 1
else:
print("Completed Test 2/2: pack_into - FAILED")
print(f"\n=== Results: {self.successfultests}/0 tests passed ===")
self.failedtests["pack_into"] = "Failed"
print(f"\n=== Results: {self.successfultests}/2 tests passed ===")
if self.failedtests:
print("Failed tests:")
for key, value in self.failedtests.items():