This is the mail archive of the ecos-patches@sourceware.org mailing list for the eCos project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Fix bug 1000637


Index: ChangeLog
===================================================================
RCS file: /cvs/ecos/ecos/packages/kernel/current/ChangeLog,v
retrieving revision 1.147
diff -u -5 -p -r1.147 ChangeLog
--- ChangeLog	14 Nov 2008 14:26:09 -0000	1.147
+++ ChangeLog	18 Nov 2008 14:04:27 -0000
@@ -1,5 +1,11 @@
+2008-11-18  Sergei Gavrikov  <sergei.gavrikov@gmail.com>
+
+	* tests/tm_basic.cxx (max): Actually the meaning was right before,
+	it was just the name that was wrong. So revert below, and change 
+	name to min.
+
 2008-11-14  Jonathan Larmour  <jifl@eCosCentric.com>
 
 	* tests/tm_basic.cxx (max): Was wrong way round. Resolves issue
 	1000636.
 
Index: tests/tm_basic.cxx
===================================================================
RCS file: /cvs/ecos/ecos/packages/kernel/current/tests/tm_basic.cxx,v
retrieving revision 1.25
diff -u -5 -p -r1.25 tm_basic.cxx
--- tests/tm_basic.cxx	14 Nov 2008 14:26:09 -0000	1.25
+++ tests/tm_basic.cxx	18 Nov 2008 14:04:27 -0000
@@ -207,12 +207,12 @@ void run_semaphore_tests(void);
 void run_semaphore_circuit_test(void);
 void run_counter_tests(void);
 void run_flag_tests(void);
 void run_alarm_tests(void);
 
-#ifndef max
-#define max(n,m) ((m) > (n) ? (m) : (n))
+#ifndef min
+#define min(X,Y) ((X) < (Y) ? (X) : (Y))
 #endif
 
 // Wait until a clock tick [real time clock] has passed.  This should keep it
 // from happening again during a measurement, thus minimizing any fluctuations
 void
@@ -1823,24 +1823,24 @@ void tm_basic_main( void )
         nalarms = NALARMS;
     }
 
     // Sanity
 #ifdef WORKHORSE_TEST
-    ntest_threads = max(512, ntest_threads);
-    nmutexes = max(1024, nmutexes);
-    nsemaphores = max(1024, nsemaphores);
-    nmboxes = max(1024, nmboxes);
-    ncounters = max(1024, ncounters);
-    nalarms = max(1024, nalarms);
+    ntest_threads = min(512, ntest_threads);
+    nmutexes = min(1024, nmutexes);
+    nsemaphores = min(1024, nsemaphores);
+    nmboxes = min(1024, nmboxes);
+    ncounters = min(1024, ncounters);
+    nalarms = min(1024, nalarms);
 #else
-    ntest_threads = max(64, ntest_threads);
-    nmutexes = max(32, nmutexes);
-    nsemaphores = max(32, nsemaphores);
-    nmboxes = max(32, nmboxes);
-    ncounters = max(32, ncounters);
-    nflags = max(32, nflags);
-    nalarms = max(32, nalarms);
+    ntest_threads = min(64, ntest_threads);
+    nmutexes = min(32, nmutexes);
+    nsemaphores = min(32, nsemaphores);
+    nmboxes = min(32, nmboxes);
+    ncounters = min(32, ncounters);
+    nflags = min(32, nflags);
+    nalarms = min(32, nalarms);
 #endif
 
     new_thread(run_all_tests, 0);
     
     Cyg_Scheduler::scheduler.start();


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]