From: liang_mike Date: Sat, 12 Jul 2008 06:44:55 +0000 (+0000) Subject: Fix the problem where MicaZ failed the test X-Git-Tag: release_tinyos_2_1_0_0~77 X-Git-Url: https://oss.titaniummirror.com/gitweb/?p=tinyos-2.x.git;a=commitdiff_plain;h=b86dd7c3938e3090708b2d69f1c2e96310c46eac Fix the problem where MicaZ failed the test --- diff --git a/apps/tosthreads/apps/TestBlockStorage/Makefile b/apps/tosthreads/apps/TestBlockStorage/Makefile index f4a0d1d3..6861fb76 100644 --- a/apps/tosthreads/apps/TestBlockStorage/Makefile +++ b/apps/tosthreads/apps/TestBlockStorage/Makefile @@ -1,3 +1,10 @@ COMPONENT=TestBlockStorageAppC +ifneq ($(filter telosb,$(MAKECMDGOALS)),) + CFLAGS+=-DUSE_STM25P +endif +ifneq ($(filter micaz,$(MAKECMDGOALS)),) + CFLAGS+=-DUSE_AT45DB +endif + include $(MAKERULES) diff --git a/apps/tosthreads/apps/TestBlockStorage/TestBlockStorageP.nc b/apps/tosthreads/apps/TestBlockStorage/TestBlockStorageP.nc index 75721279..316cbece 100644 --- a/apps/tosthreads/apps/TestBlockStorage/TestBlockStorageP.nc +++ b/apps/tosthreads/apps/TestBlockStorage/TestBlockStorageP.nc @@ -47,10 +47,15 @@ implementation { int i; error_t error; +#if defined USE_AT45DB + storage_len_t expectedVolumeSize = 262144; +#elif defined USE_STM25P + storage_len_t expectedVolumeSize = 1048576; +#endif call Leds.set(1); - if (call BlockingBlock1.getSize() != 1048576) { + if (call BlockingBlock1.getSize() != expectedVolumeSize) { call Leds.set(7); return; } @@ -61,7 +66,7 @@ implementation return; } - for (i = 0; i < 20; i++) { + for (i = 0; i < 50; i++) { storage_addr_t writeAddr = call Random.rand32() % (call BlockingBlock1.getSize() - sizeof(storage_addr_t)); storage_len_t len = sizeof(storage_addr_t); storage_addr_t readBuf;