Hi guys,
Here is the patch generated.

Thanks
Himanshu
From ae597305822f734d36ed678b15cfb353962fbd2c Mon Sep 17 00:00:00 2001
From: Himanshu40 <himanshuwindows...@gmail.com>
Date: Fri, 16 Nov 2018 03:25:41 +0530
Subject: [PATCH] Add psxtmthreadattr01 timing test suite(GCI 2018)

---
 testsuites/psxtmtests/psxtmtests_plan.csv     |  8 ++++---
 .../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 5bfb56d711..25beefbc4b 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 811f973ba1..68b7d7d38d 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",
-- 
2.17.2

_______________________________________________
devel mailing list
devel@rtems.org
http://lists.rtems.org/mailman/listinfo/devel

Reply via email to