From 138aa9a8a54e8c04aea110d0f587a37f28442607 Mon Sep 17 00:00:00 2001 From: Jamie Reece Wilson Date: Sat, 29 Jul 2023 10:51:23 +0100 Subject: [PATCH] [*] Update AuProcess [test] for IO handle update --- Aurora/Runtime | 2 +- Tests/Public/21. Hello IPC/Main.cpp | 2 +- Tests/Public/25. Hello Address Map/Main.cpp | 24 ++++++++++----------- 3 files changed, 14 insertions(+), 14 deletions(-) diff --git a/Aurora/Runtime b/Aurora/Runtime index 247e702..3ff5d8a 160000 --- a/Aurora/Runtime +++ b/Aurora/Runtime @@ -1 +1 @@ -Subproject commit 247e702712c7d6851d77e04fc14ab17cbd12e41c +Subproject commit 3ff5d8a74e97d0c13e85132b43a1665fd13eb8ff diff --git a/Tests/Public/21. Hello IPC/Main.cpp b/Tests/Public/21. Hello IPC/Main.cpp index f88958a..37bf901 100755 --- a/Tests/Public/21. Hello IPC/Main.cpp +++ b/Tests/Public/21. Hello IPC/Main.cpp @@ -209,9 +209,9 @@ TEST(IPC, AsyncPipe) // AuByteBuffer writeBuffer(512); - AuMemoryViewRead writeView(writeBuffer); AuRng::RngFillRange(writeBuffer); + AuMemoryViewRead writeView(writeBuffer); ASSERT_TRUE(transactionA->StartWrite(0, AuUnsafeRaiiToShared(&writeView))); AuByteBuffer readBuffer(512); diff --git a/Tests/Public/25. Hello Address Map/Main.cpp b/Tests/Public/25. Hello Address Map/Main.cpp index 179bd0e..f033aae 100644 --- a/Tests/Public/25. Hello Address Map/Main.cpp +++ b/Tests/Public/25. Hello Address Map/Main.cpp @@ -30,7 +30,7 @@ TEST(Map, FSNoLock) auto pStream = AuProcess::GetGlobalProcessSpace(); ASSERT_TRUE(bool(pStream)); - auto obj = pStream->MapFileByObject(fsMap, 0, size, AuIOFS::EFileOpenMode::eRead, AuFS::EFileAdvisoryLockLevel::eBlockWrite); + auto obj = pStream->MapFileByObject(fsMap->GetHandle(), 0, size, AuIOFS::EFileOpenMode::eRead, AuFS::EFileAdvisoryLockLevel::eBlockWrite); ASSERT_TRUE(bool(obj)); ASSERT_TRUE(AuMemcmp(obj->GetBasePointer(), rngbuffer.base, size) == 0); @@ -58,7 +58,7 @@ TEST(Map, FSNestedReadLock) auto pStream = AuProcess::GetGlobalProcessSpace(); ASSERT_TRUE(bool(pStream)); - auto obj = pStream->MapFileByObject(fsMap, 0, size, AuIOFS::EFileOpenMode::eRead, AuFS::EFileAdvisoryLockLevel::eBlockWrite); + auto obj = pStream->MapFileByObject(fsMap->GetHandle(), 0, size, AuIOFS::EFileOpenMode::eRead, AuFS::EFileAdvisoryLockLevel::eBlockWrite); ASSERT_TRUE(bool(obj)); ASSERT_TRUE(AuMemcmp(obj->GetBasePointer(), rngbuffer.base, size) == 0); @@ -86,7 +86,7 @@ TEST(Map, FSNestedReadLock2) auto pStream = AuProcess::GetGlobalProcessSpace(); ASSERT_TRUE(bool(pStream)); - auto obj = pStream->MapFileByObject(fsMap, 0, size, AuIOFS::EFileOpenMode::eRead, AuFS::EFileAdvisoryLockLevel::eBlockWrite); + auto obj = pStream->MapFileByObject(fsMap->GetHandle(), 0, size, AuIOFS::EFileOpenMode::eRead, AuFS::EFileAdvisoryLockLevel::eBlockWrite); ASSERT_TRUE(bool(obj)); ASSERT_TRUE(AuMemcmp(obj->GetBasePointer(), rngbuffer.base, size) == 0); @@ -114,7 +114,7 @@ TEST(Map, FSNestedReadLockFail1) auto pStream = AuProcess::GetGlobalProcessSpace(); ASSERT_TRUE(bool(pStream)); - auto obj = pStream->MapFileByObject(fsMap, 0, size, AuIOFS::EFileOpenMode::eWrite, AuFS::EFileAdvisoryLockLevel::eBlockWrite); + auto obj = pStream->MapFileByObject(fsMap->GetHandle(), 0, size, AuIOFS::EFileOpenMode::eWrite, AuFS::EFileAdvisoryLockLevel::eBlockWrite); ASSERT_TRUE(!bool(obj)); } } @@ -180,12 +180,12 @@ TEST(Reserve, TestMap2SubSections) auto pStream = AuProcess::ReserveAddressSpace(size * 2); ASSERT_TRUE(bool(pStream)); - auto obj = pStream->MapFileByObjectEx(0, fsMap, 0, size, AuIOFS::EFileOpenMode::eRead, AuFS::EFileAdvisoryLockLevel::eBlockWrite); + auto obj = pStream->MapFileByObjectEx(0, fsMap->GetHandle(), 0, size, AuIOFS::EFileOpenMode::eRead, AuFS::EFileAdvisoryLockLevel::eBlockWrite); ASSERT_TRUE(bool(obj)); ASSERT_TRUE(AuMemcmp(obj->GetBasePointer(), rngbuffer.base, size) == 0); - auto obj2 = pStream->MapFileByObjectEx(size, fsMap, 0, size, AuIOFS::EFileOpenMode::eRead, AuFS::EFileAdvisoryLockLevel::eBlockWrite); + auto obj2 = pStream->MapFileByObjectEx(size, fsMap->GetHandle(), 0, size, AuIOFS::EFileOpenMode::eRead, AuFS::EFileAdvisoryLockLevel::eBlockWrite); ASSERT_TRUE(bool(obj2)); ASSERT_TRUE(AuMemcmp(obj2->GetBasePointer(), rngbuffer.base, size) == 0); @@ -228,12 +228,12 @@ TEST(Reserve, TestReMap2SubSections) auto pStream = AuProcess::ReserveAddressSpace(size * 2); ASSERT_TRUE(bool(pStream)); - auto obj = pStream->MapFileByObjectEx(0, fsMap, 0, size, AuIOFS::EFileOpenMode::eRead, AuFS::EFileAdvisoryLockLevel::eBlockWrite); + auto obj = pStream->MapFileByObjectEx(0, fsMap->GetHandle(), 0, size, AuIOFS::EFileOpenMode::eRead, AuFS::EFileAdvisoryLockLevel::eBlockWrite); ASSERT_TRUE(bool(obj)); ASSERT_TRUE(AuMemcmp(obj->GetBasePointer(), rngbuffer.base, size) == 0); - auto obj2 = pStream->MapFileByObjectEx(size, fsMap, 0, size, AuIOFS::EFileOpenMode::eRead, AuFS::EFileAdvisoryLockLevel::eBlockWrite); + auto obj2 = pStream->MapFileByObjectEx(size, fsMap->GetHandle(), 0, size, AuIOFS::EFileOpenMode::eRead, AuFS::EFileAdvisoryLockLevel::eBlockWrite); ASSERT_TRUE(bool(obj2)); ASSERT_TRUE(AuMemcmp(obj2->GetBasePointer(), rngbuffer.base, size) == 0); @@ -242,7 +242,7 @@ TEST(Reserve, TestReMap2SubSections) obj->Unmap(); - auto obj3 = pStream->MapFileByObjectEx(0, fsMap2, 0, size, AuIOFS::EFileOpenMode::eRead, AuFS::EFileAdvisoryLockLevel::eBlockWrite); + auto obj3 = pStream->MapFileByObjectEx(0, fsMap2->GetHandle(), 0, size, AuIOFS::EFileOpenMode::eRead, AuFS::EFileAdvisoryLockLevel::eBlockWrite); ASSERT_TRUE(bool(obj3)); ASSERT_TRUE(AuMemcmp(obj3->GetBasePointer(), rngbuffer2.base, size) == 0); @@ -283,19 +283,19 @@ TEST(Reserve, TestReMap2SubSections_Fail) auto pStream = AuProcess::ReserveAddressSpace(size * 2); ASSERT_TRUE(bool(pStream)); - auto obj = pStream->MapFileByObjectEx(0, fsMap, 0, size, AuIOFS::EFileOpenMode::eRead, AuFS::EFileAdvisoryLockLevel::eBlockWrite); + auto obj = pStream->MapFileByObjectEx(0, fsMap->GetHandle(), 0, size, AuIOFS::EFileOpenMode::eRead, AuFS::EFileAdvisoryLockLevel::eBlockWrite); ASSERT_TRUE(bool(obj)); ASSERT_TRUE(AuMemcmp(obj->GetBasePointer(), rngbuffer.base, size) == 0); - auto obj2 = pStream->MapFileByObjectEx(size, fsMap, 0, size, AuIOFS::EFileOpenMode::eRead, AuFS::EFileAdvisoryLockLevel::eBlockWrite); + auto obj2 = pStream->MapFileByObjectEx(size, fsMap->GetHandle(), 0, size, AuIOFS::EFileOpenMode::eRead, AuFS::EFileAdvisoryLockLevel::eBlockWrite); ASSERT_TRUE(bool(obj2)); ASSERT_TRUE(AuMemcmp(obj2->GetBasePointer(), rngbuffer.base, size) == 0); ASSERT_EQ(obj2->GetBasePointer(), obj->GetPointer(size)); - auto obj3 = pStream->MapFileByObjectEx(0, fsMap2, 0, size, AuIOFS::EFileOpenMode::eRead, AuFS::EFileAdvisoryLockLevel::eBlockWrite); + auto obj3 = pStream->MapFileByObjectEx(0, fsMap2->GetHandle(), 0, size, AuIOFS::EFileOpenMode::eRead, AuFS::EFileAdvisoryLockLevel::eBlockWrite); ASSERT_FALSE(bool(obj3)); } }