summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorGreg Hackmann <ghackmann@google.com>2013-06-19 13:31:21 -0700
committerGreg Hackmann <ghackmann@google.com>2013-06-25 13:34:32 -0700
commitbe30c7a78a1cf4adc8ec9bbdf17e85186fdb05b2 (patch)
treee4606a51f2c48d8b06079995309456beb96e7770 /tests
parentd5276422ca9f1f4d45e91c189a1655521e91962d (diff)
downloadbionic-be30c7a78a1cf4adc8ec9bbdf17e85186fdb05b2.zip
bionic-be30c7a78a1cf4adc8ec9bbdf17e85186fdb05b2.tar.gz
bionic-be30c7a78a1cf4adc8ec9bbdf17e85186fdb05b2.tar.bz2
bionic: revert to a single (larger) property area
d329697 is too complicated. Change the multiple property pages back to a single 128K property area that's mapped in entirely at initialization (the memory will not get allocated until the pages are touched). d329697 has other changes useful for testing (moving property area initialization inside bionic and adding __system_property_set_filename) so undo the change manually rather than with git revert. Change-Id: Icd137669a4f8bc248e9dd2c1e8cc54e9193c9a6d Signed-off-by: Greg Hackmann <ghackmann@google.com>
Diffstat (limited to 'tests')
-rw-r--r--tests/property_benchmark.cpp14
-rw-r--r--tests/system_properties_test.cpp14
2 files changed, 10 insertions, 18 deletions
diff --git a/tests/property_benchmark.cpp b/tests/property_benchmark.cpp
index 7266bd0..d10be91 100644
--- a/tests/property_benchmark.cpp
+++ b/tests/property_benchmark.cpp
@@ -23,7 +23,7 @@
#include <vector>
#include <string>
-extern void *__system_property_regions__[PA_REGION_COUNT];
+extern void *__system_property_area__;
#define TEST_NUM_PROPS \
Arg(1)->Arg(4)->Arg(16)->Arg(64)->Arg(128)->Arg(256)->Arg(512)->Arg(1024)
@@ -39,10 +39,8 @@ struct LocalPropertyTestState {
return;
}
- for (size_t i = 0; i < PA_REGION_COUNT; i++) {
- old_pa[i] = __system_property_regions__[i];
- __system_property_regions__[i] = NULL;
- }
+ old_pa = __system_property_area__;
+ __system_property_area__ = NULL;
pa_dirname = dirname;
pa_filename = pa_dirname + "/__properties__";
@@ -79,9 +77,7 @@ struct LocalPropertyTestState {
if (!valid)
return;
- for (size_t i = 0; i < PA_REGION_COUNT; i++) {
- __system_property_regions__[i] = old_pa[i];
- }
+ __system_property_area__ = old_pa;
__system_property_set_filename(PROP_FILENAME);
unlink(pa_filename.c_str());
@@ -107,7 +103,7 @@ public:
private:
std::string pa_dirname;
std::string pa_filename;
- void *old_pa[PA_REGION_COUNT];
+ void *old_pa;
};
static void BM_property_get(int iters, int nprops)
diff --git a/tests/system_properties_test.cpp b/tests/system_properties_test.cpp
index bafd2c3..b9256c6 100644
--- a/tests/system_properties_test.cpp
+++ b/tests/system_properties_test.cpp
@@ -24,7 +24,7 @@
#define _REALLY_INCLUDE_SYS__SYSTEM_PROPERTIES_H_
#include <sys/_system_properties.h>
-extern void *__system_property_regions__[PA_REGION_COUNT];
+extern void *__system_property_area__;
struct LocalPropertyTestState {
LocalPropertyTestState() : valid(false) {
@@ -35,10 +35,8 @@ struct LocalPropertyTestState {
return;
}
- for (size_t i = 0; i < PA_REGION_COUNT; i++) {
- old_pa[i] = __system_property_regions__[i];
- __system_property_regions__[i] = NULL;
- }
+ old_pa = __system_property_area__;
+ __system_property_area__ = NULL;
pa_dirname = dirname;
pa_filename = pa_dirname + "/__properties__";
@@ -52,9 +50,7 @@ struct LocalPropertyTestState {
if (!valid)
return;
- for (size_t i = 0; i < PA_REGION_COUNT; i++) {
- __system_property_regions__[i] = old_pa[i];
- }
+ __system_property_area__ = old_pa;
__system_property_set_filename(PROP_FILENAME);
unlink(pa_filename.c_str());
@@ -65,7 +61,7 @@ public:
private:
std::string pa_dirname;
std::string pa_filename;
- void *old_pa[PA_REGION_COUNT];
+ void *old_pa;
};
TEST(properties, add) {