[rtems commit] psxtmthreadattr01: Correct mistakes in previous merge ( GCI 2018)

Joel Sherrill joel at rtems.org
Thu Nov 15 22:41:17 UTC 2018


Module:    rtems
Branch:    master
Commit:    841b54ee6a0669615aa55e3f94b2f72266f87a5f
Changeset: http://git.rtems.org/rtems/commit/?id=841b54ee6a0669615aa55e3f94b2f72266f87a5f

Author:    Himanshu40 <himanshuwindows8.1 at gmail.com>
Date:      Thu Nov 15 16:31:21 2018 -0600

psxtmthreadattr01: Correct mistakes in previous merge (GCI 2018)

Joel admits to grabbing one iteration too early of the patch. :(

---

 testsuites/psxtmtests/psxtmtests_plan.csv      |  8 +++++---
 testsuites/psxtmtests/psxtmthreadattr01/init.c | 22 +++++++++++-----------
 2 files changed, 16 insertions(+), 14 deletions(-)

diff --git a/testsuites/psxtmtests/psxtmtests_plan.csv b/testsuites/psxtmtests/psxtmtests_plan.csv
index 5bfb56d..25beefb 100644
--- a/testsuites/psxtmtests/psxtmtests_plan.csv
+++ b/testsuites/psxtmtests/psxtmtests_plan.csv
@@ -28,8 +28,9 @@
 
 "pthread_create: no preempt","psxtmthread01","psxtmtest_single","Yes"
 "pthread_create: preempt","psxtmthread02","psxtmtest_single","Yes"
-"pthread_attr_init: only case", "psxtmthreadattr01", "psxtmtest_single","Yes"
-"pthread_attr_destroy: only case", "psxtmthreadattr01", "psxtmtest_single","Yes"
+
+"pthread_attr_init: only case", "psxtmthreadattr01", "psxtmtest_init_destroy","Yes"
+"pthread_attr_destroy: only case", "psxtmthreadattr01", "psxtmtest_init_destroy","Yes"
 "pthread_attr_getdetachstate: only case", "psxtmthreadattr01", "psxtmtest_single","Yes"
 "pthread_attr_getguardsize: only case", "psxtmthreadattr01", "psxtmtest_single","Yes"
 "pthread_attr_getinheritsched: only case", "psxtmthreadattr01", "psxtmtest_single","Yes"
@@ -37,7 +38,7 @@
 "pthread_attr_getschedpolicy: only case", "psxtmthreadattr01", "psxtmtest_single","Yes"
 "pthread_attr_getscope: only case", "psxtmthreadattr01", "psxtmtest_single","Yes"
 "pthread_attr_getstack: only case", "psxtmthreadattr01", "psxtmtest_single","Yes"
-"pthread_attr_getstacksize: only case", "psxtmthreadattr01", "psxtmtest_single","Yes"
+"pthread_attr_getstacksize: only case", "psxtmthreadattr01", "psxtmtest_single","yes"
 "pthread_attr_setdetachstate: only case", "psxtmthreadattr01", "psxtmtest_single","Yes"
 "pthread_attr_setguardsize: only case", "psxtmthreadattr01", "psxtmtest_single","Yes"
 "pthread_attr_setinheritsched: only case", "psxtmthreadattr01", "psxtmtest_single","Yes"
@@ -46,6 +47,7 @@
 "pthread_attr_setscope: only case", "psxtmthreadattr01", "psxtmtest_single","Yes"
 "pthread_attr_setstack: only case", "psxtmthreadattr01", "psxtmtest_single","Yes"
 
+
 "pthread_join"
 "pthread_detach"
 "pthread_exit"
diff --git a/testsuites/psxtmtests/psxtmthreadattr01/init.c b/testsuites/psxtmtests/psxtmthreadattr01/init.c
index 811f973..68b7d7d 100644
--- a/testsuites/psxtmtests/psxtmthreadattr01/init.c
+++ b/testsuites/psxtmtests/psxtmthreadattr01/init.c
@@ -25,6 +25,7 @@
 #include <pthread.h>
 #include <timesys.h>
 #include <sched.h>
+
 #define GUARDSIZE_TEST_VALUE 512
 #define STACKSIZE_TEST_VALUE 1024
 
@@ -37,7 +38,6 @@ static pthread_attr_t attr;
 static size_t guardsize = GUARDSIZE_TEST_VALUE;
 static size_t stacksize = STACKSIZE_TEST_VALUE;
 static struct sched_param param;
-static int var = 2;
 static void *stackaddr;
 
 static void benchmark_create_pthread_attr(void)
@@ -84,13 +84,13 @@ static void benchmark_pthread_attr_getdetachstate(void)
 {
   benchmark_timer_t end_time;
   int  status;
-  int tmp_var;
+  int detachstate;
 
   benchmark_timer_initialize();
-  status = pthread_attr_getdetachstate(&attr, &tmp_var);
+  status = pthread_attr_getdetachstate(&attr, &detachstate);
   end_time = benchmark_timer_read();
   rtems_test_assert( status == 0 );
-  rtems_test_assert( tmp_var == PTHREAD_CREATE_DETACHED );
+  rtems_test_assert( detachstate == PTHREAD_CREATE_DETACHED );
 
   put_time(
     "pthread_attr_getdetachstate: only case",
@@ -168,13 +168,13 @@ static void benchmark_pthread_attr_getinheritsched(void)
 {
   benchmark_timer_t end_time;
   int  status;
-  int tmp_var;
+  int inheritsched;
 
   benchmark_timer_initialize();
-  status = pthread_attr_getinheritsched(&attr, &tmp_var);
+  status = pthread_attr_getinheritsched(&attr, &inheritsched);
   end_time = benchmark_timer_read();
   rtems_test_assert( status == 0 );
-  rtems_test_assert( tmp_var == PTHREAD_EXPLICIT_SCHED );
+  rtems_test_assert( inheritsched == PTHREAD_EXPLICIT_SCHED );
 
   put_time(
     "pthread_attr_getinheritsched: only case",
@@ -240,7 +240,7 @@ static void benchmark_pthread_attr_setschedpolicy(void)
   int  status;
 
   benchmark_timer_initialize();
-  status = pthread_attr_setschedpolicy(&attr, var);
+  status = pthread_attr_setschedpolicy(&attr, SCHED_RR);
   end_time = benchmark_timer_read();
   rtems_test_assert( status == 0 );
 
@@ -258,13 +258,13 @@ static void benchmark_pthread_attr_getschedpolicy(void)
 {
   benchmark_timer_t end_time;
   int  status;
-  int tmp_var;
+  int policy;
 
   benchmark_timer_initialize();
-  status = pthread_attr_getschedpolicy(&attr, &tmp_var);
+  status = pthread_attr_getschedpolicy(&attr, &policy);
   end_time = benchmark_timer_read();
   rtems_test_assert( status == 0 );
-  rtems_test_assert( tmp_var == var );
+  rtems_test_assert( policy == SCHED_RR );
 
   put_time(
     "pthread_attr_getschedpolicy: only case",




More information about the vc mailing list