@@ -78,7 +78,7 @@ TEST_F(Wddm20Tests, givenMinWindowsAddressWhenWddmIsInitializedThenWddmUseThisAd
7878 EXPECT_EQ (expectedAddress, wddm->getWddmMinAddress ());
7979}
8080
81- TEST_F (Wddm20Tests, doubleCreation ) {
81+ TEST_F (Wddm20Tests, GivenExisitingContextWhenInitializingWddmThenCreateContextResultCalledIsStillOne ) {
8282 EXPECT_EQ (1u , wddm->createContextResult .called );
8383 wddm->init ();
8484 EXPECT_EQ (1u , wddm->createContextResult .called );
@@ -149,7 +149,7 @@ TEST(WddmDiscoverDevices, WhenAdapterDescriptionContainsVirtualRenderThenAdapter
149149 EXPECT_NE (nullptr , hwDeviceIds[0 ].get ());
150150}
151151
152- TEST (Wddm20EnumAdaptersTest, expectTrue ) {
152+ TEST (Wddm20EnumAdaptersTest, WhenInitializingWddmThenHardwareInfoIsCorrectlyPopulated ) {
153153
154154 const HardwareInfo *hwInfo = defaultHwInfo.get ();
155155 std::unique_ptr<OsLibrary> mockGdiDll (setAdapterInfo (&hwInfo->platform ,
@@ -215,7 +215,7 @@ TEST_F(Wddm20Tests, whenInitializeWddmThenContextIsCreated) {
215215 EXPECT_TRUE (context != static_cast <D3DKMT_HANDLE>(0 ));
216216}
217217
218- TEST_F (Wddm20Tests, allocation ) {
218+ TEST_F (Wddm20Tests, WhenCreatingAllocationAndDestroyingAllocationThenCorrectResultReturned ) {
219219 OsAgnosticMemoryManager mm (*executionEnvironment);
220220 WddmAllocation allocation (0 , GraphicsAllocation::AllocationType::UNKNOWN, mm.allocateSystemMemory (100 , 0 ), 100 , nullptr , MemoryPool::MemoryNull);
221221 Gmm *gmm = GmmHelperFunctions::getGmm (allocation.getUnderlyingBuffer (), allocation.getUnderlyingBufferSize (), getGmmClientContext ());
@@ -261,6 +261,7 @@ TEST_F(Wddm20WithMockGdiDllTests, givenAllocationSmallerUnderlyingThanAlignedSiz
261261
262262 delete gmm;
263263}
264+
264265TEST_F (Wddm20WithMockGdiDllTests, givenReserveCallWhenItIsCalledWithProperParamtersThenAddressInRangeIsReturend) {
265266 auto sizeAlignedTo64Kb = 64 * KB;
266267
@@ -347,7 +348,7 @@ TEST_F(Wddm20WithMockGdiDllTests, GivenThreeOsHandlesWhenAskedForDestroyAllocati
347348 EXPECT_EQ (1u , ptrToDestroyAlloc2->Flags .AssumeNotInUse );
348349}
349350
350- TEST_F (Wddm20Tests, mapAndFreeGpuVa ) {
351+ TEST_F (Wddm20Tests, WhenMappingAndFreeingGpuVaThenReturnIsCorrect ) {
351352 OsAgnosticMemoryManager mm (*executionEnvironment);
352353 WddmAllocation allocation (0 , GraphicsAllocation::AllocationType::UNKNOWN, mm.allocateSystemMemory (100 , 0 ), 100 , nullptr , MemoryPool::MemoryNull);
353354 Gmm *gmm = GmmHelperFunctions::getGmm (allocation.getUnderlyingBuffer (), allocation.getUnderlyingBufferSize (), getGmmClientContext ());
@@ -434,7 +435,7 @@ TEST(WddmAllocationTest, whenAllocationIsNotShareableThenItDoesntReturnSharedHan
434435 EXPECT_EQ (nullptr , sharedHandleToModify);
435436}
436437
437- TEST_F (Wddm20Tests, makeResidentNonResident ) {
438+ TEST_F (Wddm20Tests, WhenMakingResidentAndEvictingThenReturnIsCorrect ) {
438439 OsAgnosticMemoryManager mm (*executionEnvironment);
439440 WddmAllocation allocation (0 , GraphicsAllocation::AllocationType::UNKNOWN, mm.allocateSystemMemory (100 , 0 ), 100 , nullptr , MemoryPool::MemoryNull);
440441 Gmm *gmm = GmmHelperFunctions::getGmm (allocation.getUnderlyingBuffer (), allocation.getUnderlyingBufferSize (), getGmmClientContext ());
@@ -533,7 +534,7 @@ TEST_F(Wddm20Tests, givenWddmCreatedWhenInitedThenMinAddressValid) {
533534 EXPECT_EQ (expected, actual);
534535}
535536
536- HWTEST_F (Wddm20InstrumentationTest, configureDeviceAddressSpaceOnInit ) {
537+ HWTEST_F (Wddm20InstrumentationTest, WhenConfiguringDeviceAddressSpaceThenTrueIsReturned ) {
537538 SYSTEM_INFO sysInfo = {};
538539 WddmMock::getSystemInfo (&sysInfo);
539540
@@ -554,7 +555,7 @@ HWTEST_F(Wddm20InstrumentationTest, configureDeviceAddressSpaceOnInit) {
554555 wddm->init ();
555556}
556557
557- TEST_F (Wddm20InstrumentationTest, configureDeviceAddressSpaceNoAdapter ) {
558+ TEST_F (Wddm20InstrumentationTest, GivenNoAdapterWhenConfiguringDeviceAddressSpaceThenFalseIsReturned ) {
558559 auto gdi = std::make_unique<Gdi>();
559560 wddm->resetGdi (gdi.release ());
560561 EXPECT_CALL (*gmmMem,
@@ -565,7 +566,7 @@ TEST_F(Wddm20InstrumentationTest, configureDeviceAddressSpaceNoAdapter) {
565566 EXPECT_FALSE (ret);
566567}
567568
568- TEST_F (Wddm20InstrumentationTest, configureDeviceAddressSpaceNoDevice ) {
569+ TEST_F (Wddm20InstrumentationTest, GivenNoDeviceWhenConfiguringDeviceAddressSpaceThenFalseIsReturned ) {
569570 wddm->device = static_cast <D3DKMT_HANDLE>(0 );
570571 EXPECT_CALL (*gmmMem,
571572 configureDeviceAddressSpace (::testing::_, static_cast <D3DKMT_HANDLE>(0 ), ::testing::_, ::testing::_, ::testing::_))
@@ -575,7 +576,7 @@ TEST_F(Wddm20InstrumentationTest, configureDeviceAddressSpaceNoDevice) {
575576 EXPECT_FALSE (ret);
576577}
577578
578- TEST_F (Wddm20InstrumentationTest, configureDeviceAddressSpaceNoEscFunc ) {
579+ TEST_F (Wddm20InstrumentationTest, GivenNoEscFuncWhenConfiguringDeviceAddressSpaceThenFalseIsReturned ) {
579580 wddm->getGdi ()->escape = static_cast <PFND3DKMT_ESCAPE>(nullptr );
580581 EXPECT_CALL (*gmmMem, configureDeviceAddressSpace (::testing::_, ::testing::_, static_cast <PFND3DKMT_ESCAPE>(nullptr ), ::testing::_,
581582 ::testing::_))
@@ -585,7 +586,7 @@ TEST_F(Wddm20InstrumentationTest, configureDeviceAddressSpaceNoEscFunc) {
585586 EXPECT_FALSE (ret);
586587}
587588
588- TEST_F (Wddm20Tests, getMaxApplicationAddress ) {
589+ TEST_F (Wddm20Tests, WhenGettingMaxApplicationAddressThen32Or64BitIsCorrectlyReturned ) {
589590 uint64_t maxAddr = wddm->getMaxApplicationAddress ();
590591 if (is32bit) {
591592 EXPECT_EQ (maxAddr, MemoryConstants::max32BitAppAddress);
@@ -652,7 +653,7 @@ TEST(DebugFlagTest, givenDebugManagerWhenGetForUseNoRingFlushesKmdModeIsCalledTh
652653 EXPECT_TRUE (DebugManager.flags .UseNoRingFlushesKmdMode .get ());
653654}
654655
655- TEST_F (Wddm20Tests, makeResidentMultipleHandles ) {
656+ TEST_F (Wddm20Tests, GivenMultipleHandlesWhenMakingResidentThenAllocationListIsCorrect ) {
656657 D3DKMT_HANDLE handles[2 ] = {ALLOCATION_HANDLE, ALLOCATION_HANDLE};
657658 gdi->getMakeResidentArg ().NumAllocations = 0 ;
658659 gdi->getMakeResidentArg ().AllocationList = nullptr ;
@@ -664,7 +665,7 @@ TEST_F(Wddm20Tests, makeResidentMultipleHandles) {
664665 EXPECT_EQ (handles, gdi->getMakeResidentArg ().AllocationList );
665666}
666667
667- TEST_F (Wddm20Tests, makeResidentMultipleHandlesWithReturnBytesToTrim ) {
668+ TEST_F (Wddm20Tests, GivenMultipleHandlesWhenMakingResidentThenBytesToTrimIsCorrect ) {
668669 D3DKMT_HANDLE handles[2 ] = {ALLOCATION_HANDLE, ALLOCATION_HANDLE};
669670
670671 gdi->getMakeResidentArg ().NumAllocations = 0 ;
@@ -678,7 +679,7 @@ TEST_F(Wddm20Tests, makeResidentMultipleHandlesWithReturnBytesToTrim) {
678679 EXPECT_EQ (gdi->getMakeResidentArg ().NumBytesToTrim , bytesToTrim);
679680}
680681
681- TEST_F (Wddm20Tests, makeNonResidentCallsEvict ) {
682+ TEST_F (Wddm20Tests, WhenMakingNonResidentThenEvictIsCalled ) {
682683 D3DKMT_HANDLE handle = (D3DKMT_HANDLE)0x1234 ;
683684
684685 gdi->getEvictArg ().AllocationList = nullptr ;
@@ -768,7 +769,7 @@ TEST_F(Wddm20Tests, WhenLastFenceGreaterThanMonitoredThenWaitFromCpuIsCalled) {
768769 EXPECT_NE (nullptr , gdi->getWaitFromCpuArg ().ObjectHandleArray );
769770}
770771
771- TEST_F (Wddm20Tests, createMonitoredFenceIsInitializedWithFenceValueZeroAndCurrentFenceValueIsSetToOne ) {
772+ TEST_F (Wddm20Tests, WhenCreatingMonitoredFenceThenItIsInitializedWithFenceValueZeroAndCurrentFenceValueIsSetToOne ) {
772773 gdi->createSynchronizationObject2 = gdi->createSynchronizationObject2Mock ;
773774
774775 gdi->getCreateSynchronizationObject2Arg ().Info .MonitoredFence .InitialFenceValue = 300 ;
@@ -887,20 +888,24 @@ TEST_F(WddmLockWithMakeResidentTests, givenAllocationThatDoesntNeedMakeResidentB
887888 EXPECT_EQ (0u , wddm->makeResidentResult .called );
888889 wddm->unlockResource (ALLOCATION_HANDLE);
889890}
891+
890892TEST_F (WddmLockWithMakeResidentTests, givenAllocationThatNeedsMakeResidentBeforeLockWhenLockThenCallBlockingMakeResident) {
891893 wddm->lockResource (ALLOCATION_HANDLE, true , 0x1000 );
892894 EXPECT_EQ (1u , mockTemporaryResources->makeResidentResult .called );
893895}
896+
894897TEST_F (WddmLockWithMakeResidentTests, givenAllocationWhenApplyBlockingMakeResidentThenAcquireUniqueLock) {
895898 wddm->temporaryResources ->makeResidentResource (ALLOCATION_HANDLE, 0x1000 );
896899 EXPECT_EQ (1u , mockTemporaryResources->acquireLockResult .called );
897900 EXPECT_EQ (reinterpret_cast <uint64_t >(&mockTemporaryResources->resourcesLock ), mockTemporaryResources->acquireLockResult .uint64ParamPassed );
898901}
902+
899903TEST_F (WddmLockWithMakeResidentTests, givenAllocationWhenApplyBlockingMakeResidentThenCallMakeResidentAndStoreAllocation) {
900904 wddm->temporaryResources ->makeResidentResource (ALLOCATION_HANDLE, 0x1000 );
901905 EXPECT_EQ (1u , wddm->makeResidentResult .called );
902906 EXPECT_EQ (ALLOCATION_HANDLE, mockTemporaryResources->resourceHandles .back ());
903907}
908+
904909TEST_F (WddmLockWithMakeResidentTests, givenAllocationWhenApplyBlockingMakeResidentThenWaitForCurrentPagingFenceValue) {
905910 wddm->mockPagingFence = 0u ;
906911 wddm->temporaryResources ->makeResidentResource (ALLOCATION_HANDLE, 0x1000 );
@@ -909,6 +914,7 @@ TEST_F(WddmLockWithMakeResidentTests, givenAllocationWhenApplyBlockingMakeReside
909914 EXPECT_EQ (MockGdi::pagingFenceReturnValue + 1 , wddm->mockPagingFence );
910915 EXPECT_EQ (expectedCallNumber, wddm->getPagingFenceAddressResult .called );
911916}
917+
912918TEST_F (WddmLockWithMakeResidentTests, givenAllocationWhenApplyBlockingMakeResidentAndMakeResidentCallFailsThenEvictTemporaryResourcesAndRetry) {
913919 MockWddmAllocation allocation;
914920 allocation.handle = 0x3 ;
@@ -918,6 +924,7 @@ TEST_F(WddmLockWithMakeResidentTests, givenAllocationWhenApplyBlockingMakeReside
918924 gmockWddm.temporaryResources ->makeResidentResource (allocation.handle , 0x1000 );
919925 EXPECT_EQ (1u , mockTemporaryResources->evictAllResourcesResult .called );
920926}
927+
921928TEST_F (WddmLockWithMakeResidentTests, whenApplyBlockingMakeResidentAndTemporaryResourcesAreEvictedSuccessfullyThenCallMakeResidentOneMoreTime) {
922929 MockWddmAllocation allocation;
923930 allocation.handle = 0x3 ;
@@ -929,6 +936,7 @@ TEST_F(WddmLockWithMakeResidentTests, whenApplyBlockingMakeResidentAndTemporaryR
929936 gmockWddm.temporaryResources ->makeResidentResource (allocation.handle , 0x1000 );
930937 EXPECT_EQ (2u , mockTemporaryResources->evictAllResourcesResult .called );
931938}
939+
932940TEST_F (WddmLockWithMakeResidentTests, whenApplyBlockingMakeResidentAndMakeResidentStillFailsThenDontStoreTemporaryResource) {
933941 MockWddmAllocation allocation;
934942 allocation.handle = 0x2 ;
@@ -941,6 +949,7 @@ TEST_F(WddmLockWithMakeResidentTests, whenApplyBlockingMakeResidentAndMakeReside
941949 gmockWddm.temporaryResources ->makeResidentResource (allocation.handle , 0x1000 );
942950 EXPECT_EQ (0u , mockTemporaryResources->resourceHandles .size ());
943951}
952+
944953TEST_F (WddmLockWithMakeResidentTests, whenApplyBlockingMakeResidentAndMakeResidentPassesAfterEvictThenStoreTemporaryResource) {
945954 MockWddmAllocation allocation;
946955 allocation.handle = 0x2 ;
@@ -954,6 +963,7 @@ TEST_F(WddmLockWithMakeResidentTests, whenApplyBlockingMakeResidentAndMakeReside
954963 EXPECT_EQ (1u , mockTemporaryResources->resourceHandles .size ());
955964 EXPECT_EQ (0x2 , mockTemporaryResources->resourceHandles .back ());
956965}
966+
957967TEST_F (WddmLockWithMakeResidentTests, whenApplyBlockingMakeResidentAndMakeResidentPassesThenStoreTemporaryResource) {
958968 MockWddmAllocation allocation;
959969 allocation.handle = 0x2 ;
@@ -965,15 +975,18 @@ TEST_F(WddmLockWithMakeResidentTests, whenApplyBlockingMakeResidentAndMakeReside
965975 EXPECT_EQ (2u , mockTemporaryResources->resourceHandles .size ());
966976 EXPECT_EQ (0x2 , mockTemporaryResources->resourceHandles .back ());
967977}
978+
968979TEST_F (WddmLockWithMakeResidentTests, givenNoTemporaryResourcesWhenEvictingAllTemporaryResourcesThenEvictionIsNotApplied) {
969980 wddm->getTemporaryResourcesContainer ()->evictAllResources ();
970981 EXPECT_EQ (MemoryOperationsStatus::MEMORY_NOT_FOUND, mockTemporaryResources->evictAllResourcesResult .operationSuccess );
971982}
983+
972984TEST_F (WddmLockWithMakeResidentTests, whenEvictingAllTemporaryResourcesThenAcquireTemporaryResourcesLock) {
973985 wddm->getTemporaryResourcesContainer ()->evictAllResources ();
974986 EXPECT_EQ (1u , mockTemporaryResources->acquireLockResult .called );
975987 EXPECT_EQ (reinterpret_cast <uint64_t >(&mockTemporaryResources->resourcesLock ), mockTemporaryResources->acquireLockResult .uint64ParamPassed );
976988}
989+
977990TEST_F (WddmLockWithMakeResidentTests, whenEvictingAllTemporaryResourcesAndAllEvictionsSucceedThenReturnSuccess) {
978991 MockWddmAllocation allocation;
979992 GmockWddm gmockWddm (*executionEnvironment->rootDeviceEnvironments [0 ]);
@@ -984,6 +997,7 @@ TEST_F(WddmLockWithMakeResidentTests, whenEvictingAllTemporaryResourcesAndAllEvi
984997 EXPECT_EQ (1u , mockTemporaryResources->evictAllResourcesResult .called );
985998 EXPECT_EQ (MemoryOperationsStatus::SUCCESS, mockTemporaryResources->evictAllResourcesResult .operationSuccess );
986999}
1000+
9871001TEST_F (WddmLockWithMakeResidentTests, givenThreeAllocationsWhenEvictingAllTemporaryResourcesThenCallEvictForEachAllocationAndCleanList) {
9881002 GmockWddm gmockWddm (*executionEnvironment->rootDeviceEnvironments [0 ]);
9891003 auto mockTemporaryResources = reinterpret_cast <MockWddmResidentAllocationsContainer *>(gmockWddm.temporaryResources .get ());
@@ -995,6 +1009,7 @@ TEST_F(WddmLockWithMakeResidentTests, givenThreeAllocationsWhenEvictingAllTempor
9951009 gmockWddm.getTemporaryResourcesContainer ()->evictAllResources ();
9961010 EXPECT_TRUE (mockTemporaryResources->resourceHandles .empty ());
9971011}
1012+
9981013TEST_F (WddmLockWithMakeResidentTests, givenThreeAllocationsWhenEvictingAllTemporaryResourcesAndOneOfThemFailsThenReturnFail) {
9991014 GmockWddm gmockWddm (*executionEnvironment->rootDeviceEnvironments [0 ].get ());
10001015 auto mockTemporaryResources = reinterpret_cast <MockWddmResidentAllocationsContainer *>(gmockWddm.temporaryResources .get ());
@@ -1006,22 +1021,26 @@ TEST_F(WddmLockWithMakeResidentTests, givenThreeAllocationsWhenEvictingAllTempor
10061021 gmockWddm.getTemporaryResourcesContainer ()->evictAllResources ();
10071022 EXPECT_EQ (MemoryOperationsStatus::FAILED, mockTemporaryResources->evictAllResourcesResult .operationSuccess );
10081023}
1024+
10091025TEST_F (WddmLockWithMakeResidentTests, givenNoTemporaryResourcesWhenEvictingTemporaryResourceThenEvictionIsNotApplied) {
10101026 wddm->getTemporaryResourcesContainer ()->evictResource (ALLOCATION_HANDLE);
10111027 EXPECT_EQ (MemoryOperationsStatus::MEMORY_NOT_FOUND, mockTemporaryResources->evictResourceResult .operationSuccess );
10121028}
1029+
10131030TEST_F (WddmLockWithMakeResidentTests, whenEvictingTemporaryResourceThenAcquireTemporaryResourcesLock) {
10141031 wddm->getTemporaryResourcesContainer ()->evictResource (ALLOCATION_HANDLE);
10151032 EXPECT_EQ (1u , mockTemporaryResources->acquireLockResult .called );
10161033 EXPECT_EQ (reinterpret_cast <uint64_t >(&mockTemporaryResources->resourcesLock ), mockTemporaryResources->acquireLockResult .uint64ParamPassed );
10171034}
1035+
10181036TEST_F (WddmLockWithMakeResidentTests, whenEvictingNonExistingTemporaryResourceThenEvictIsNotAppliedAndTemporaryResourcesAreRestored) {
10191037 mockTemporaryResources->resourceHandles .push_back (ALLOCATION_HANDLE);
10201038 EXPECT_FALSE (mockTemporaryResources->resourceHandles .empty ());
10211039 wddm->getTemporaryResourcesContainer ()->evictResource (ALLOCATION_HANDLE + 1 );
10221040 EXPECT_FALSE (mockTemporaryResources->resourceHandles .empty ());
10231041 EXPECT_EQ (MemoryOperationsStatus::MEMORY_NOT_FOUND, mockTemporaryResources->evictResourceResult .operationSuccess );
10241042}
1043+
10251044TEST_F (WddmLockWithMakeResidentTests, whenEvictingTemporaryResourceAndEvictFailsThenReturnFail) {
10261045 GmockWddm gmockWddm (*executionEnvironment->rootDeviceEnvironments [0 ]);
10271046 auto mockTemporaryResources = reinterpret_cast <MockWddmResidentAllocationsContainer *>(gmockWddm.temporaryResources .get ());
@@ -1031,6 +1050,7 @@ TEST_F(WddmLockWithMakeResidentTests, whenEvictingTemporaryResourceAndEvictFails
10311050 EXPECT_TRUE (mockTemporaryResources->resourceHandles .empty ());
10321051 EXPECT_EQ (MemoryOperationsStatus::FAILED, mockTemporaryResources->evictResourceResult .operationSuccess );
10331052}
1053+
10341054TEST_F (WddmLockWithMakeResidentTests, whenEvictingTemporaryResourceAndEvictSucceedThenReturnSuccess) {
10351055 GmockWddm gmockWddm (*executionEnvironment->rootDeviceEnvironments [0 ]);
10361056 auto mockTemporaryResources = reinterpret_cast <MockWddmResidentAllocationsContainer *>(gmockWddm.temporaryResources .get ());
@@ -1040,6 +1060,7 @@ TEST_F(WddmLockWithMakeResidentTests, whenEvictingTemporaryResourceAndEvictSucce
10401060 EXPECT_TRUE (mockTemporaryResources->resourceHandles .empty ());
10411061 EXPECT_EQ (MemoryOperationsStatus::SUCCESS, mockTemporaryResources->evictResourceResult .operationSuccess );
10421062}
1063+
10431064TEST_F (WddmLockWithMakeResidentTests, whenEvictingTemporaryResourceThenOtherResourcesRemainOnTheList) {
10441065 mockTemporaryResources->resourceHandles .push_back (0x1 );
10451066 mockTemporaryResources->resourceHandles .push_back (0x2 );
@@ -1069,7 +1090,7 @@ TEST_F(WddmLockWithMakeResidentTests, whenAlllocationNeedsBlockingMakeResidentBe
10691090}
10701091using WddmGfxPartitionTest = Wddm20Tests;
10711092
1072- TEST_F (WddmGfxPartitionTest, initGfxPartition ) {
1093+ TEST_F (WddmGfxPartitionTest, WhenInitializingGfxPartitionThenAllHeapsAreInitialized ) {
10731094 MockGfxPartition gfxPartition;
10741095
10751096 for (auto heap : MockGfxPartition::allHeapNames) {
@@ -1087,7 +1108,7 @@ TEST_F(WddmGfxPartitionTest, initGfxPartition) {
10871108 }
10881109}
10891110
1090- TEST (WddmGfxPartitionTests, initGfxPartitionHeapStandard64KBSplit ) {
1111+ TEST (WddmGfxPartitionTests, WhenInitializingGfxPartitionThen64KBHeapsAreUsed ) {
10911112 struct MockWddm : public Wddm {
10921113 using Wddm::gfxPartition;
10931114
@@ -1158,6 +1179,7 @@ TEST_F(Wddm20WithMockGdiDllTests, WhenDestroyingSeparateMonitorFenceThenExpectGd
11581179
11591180 EXPECT_EQ (monitorFence.fenceHandle , getDestroySynchronizationObjectDataFcn ()->hSyncObject );
11601181}
1182+
11611183namespace NEO {
11621184long __stdcall notifyAubCapture (void *csrHandle, uint64_t gfxAddress, size_t gfxSize, bool allocate);
11631185}
0 commit comments