gnome-keyring r1003 - in trunk: . common/tests library/tests



Author: nnielsen
Date: Fri Jan 11 16:05:58 2008
New Revision: 1003
URL: http://svn.gnome.org/viewvc/gnome-keyring?rev=1003&view=rev

Log:
	* common/tests/unit-test-secmem.c:
	* library/tests/unit-test-memory.c: Fix memory tests so they can 
	operate in 32K of lockable memory.


Modified:
   trunk/ChangeLog
   trunk/common/tests/unit-test-secmem.c
   trunk/library/tests/unit-test-memory.c

Modified: trunk/common/tests/unit-test-secmem.c
==============================================================================
--- trunk/common/tests/unit-test-secmem.c	(original)
+++ trunk/common/tests/unit-test-secmem.c	Fri Jan 11 16:05:58 2008
@@ -79,14 +79,14 @@
 	gpointer p, p2;
 	
 	/* Tiny allocation */
-	p = gkr_secure_realloc_full (NULL, 88, 0);
+	p = gkr_secure_realloc_full (NULL, 1088, 0);
 	CuAssertPtrNotNull (cu, p);
-	CuAssertIntEquals (cu, IS_ZERO, find_non_zero (p, 88));
+	CuAssertIntEquals (cu, IS_ZERO, find_non_zero (p, 1088));
 
 	/* Reallocate to a large one, will have to have changed blocks */	
-	p2 = gkr_secure_realloc_full (p, 64000, 0);
+	p2 = gkr_secure_realloc_full (p, 16200, 0);
 	CuAssertPtrNotNull (cu, p2);
-	CuAssertIntEquals (cu, IS_ZERO, find_non_zero (p2, 64000));
+	CuAssertIntEquals (cu, IS_ZERO, find_non_zero (p2, 16200));
 }
 
 void unit_test_secmem_alloc_two (CuTest* cu)
@@ -100,11 +100,11 @@
 
 	memset (p2, 0x67, 4);
 	
-	p = gkr_secure_alloc_full (64536, 0);
+	p = gkr_secure_alloc_full (16200, 0);
 	CuAssertPtrNotNull (cu, p);
-	CuAssertIntEquals (cu, IS_ZERO, find_non_zero (p, 64536));
+	CuAssertIntEquals (cu, IS_ZERO, find_non_zero (p, 16200));
 
-	memset (p, 0x67, 64536);
+	memset (p, 0x67, 16200);
 	
 	ret = gkr_secure_check (p);
 	CuAssertIntEquals (cu, ret, TRUE);

Modified: trunk/library/tests/unit-test-memory.c
==============================================================================
--- trunk/library/tests/unit-test-memory.c	(original)
+++ trunk/library/tests/unit-test-memory.c	Fri Jan 11 16:05:58 2008
@@ -85,11 +85,11 @@
 	
 	memset (p2, 0x67, 4);
 	
-	p = gnome_keyring_memory_alloc (64536);
+	p = gnome_keyring_memory_alloc (16200);
 	CuAssertPtrNotNull (cu, p);
-	CuAssertIntEquals (cu, IS_ZERO, find_non_zero (p, 64536));
+	CuAssertIntEquals (cu, IS_ZERO, find_non_zero (p, 16200));
 
-	memset (p, 0x67, 64536);
+	memset (p, 0x67, 16200);
 	
 	ret = gnome_keyring_memory_is_secure (p);
 	CuAssertIntEquals (cu, ret, TRUE);
@@ -128,14 +128,14 @@
 	gpointer p, p2;
 	
 	/* Tiny allocation */
-	p = gnome_keyring_memory_realloc (NULL, 88);
+	p = gnome_keyring_memory_realloc (NULL, 1088);
 	CuAssertPtrNotNull (cu, p);
-	CuAssertIntEquals (cu, IS_ZERO, find_non_zero (p, 88));
+	CuAssertIntEquals (cu, IS_ZERO, find_non_zero (p, 1088));
 
 	/* Reallocate to a large one, will have to have changed blocks */	
-	p2 = gnome_keyring_memory_realloc (p, 64000);
+	p2 = gnome_keyring_memory_realloc (p, 16200);
 	CuAssertPtrNotNull (cu, p2);
-	CuAssertIntEquals (cu, IS_ZERO, find_non_zero (p2, 64000));
+	CuAssertIntEquals (cu, IS_ZERO, find_non_zero (p2, 16200));
 	
 	gnome_keyring_memory_free (p2);
 }



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]