Hi guys,
I have added a new test suite for review of psxtmonce02.
Here is the patch file you can find with this email.

Thanks
Himanshu Sekhar Nayak
From cd884f83af461147079ad0bc3aaa41adc8c08a69 Mon Sep 17 00:00:00 2001
From: Himanshu40 <[email protected]>
Date: Fri, 9 Nov 2018 22:09:44 +0530
Subject: [PATCH] Added new test psxtmonce02

---
 testsuites/psxtmtests/psxtmonce01/Makefile.am | 27 -------------------
 testsuites/psxtmtests/psxtmonce01/init.c      | 20 ++++++++++++++
 .../psxtmtests/psxtmonce01/psxtmonce01.doc    |  1 +
 testsuites/psxtmtests/psxtmtests_plan.csv     |  2 +-
 4 files changed, 22 insertions(+), 28 deletions(-)
 delete mode 100644 testsuites/psxtmtests/psxtmonce01/Makefile.am

diff --git a/testsuites/psxtmtests/psxtmonce01/Makefile.am b/testsuites/psxtmtests/psxtmonce01/Makefile.am
deleted file mode 100644
index 242e3937d1..0000000000
--- a/testsuites/psxtmtests/psxtmonce01/Makefile.am
+++ /dev/null
@@ -1,27 +0,0 @@
-MANAGERS = all
-
-rtems_tests_PROGRAMS = psxtmonce01
-psxtmonce01_SOURCES  = init.c
-psxtmonce01_SOURCES += ../../tmtests/include/timesys.h
-psxtmonce01_SOURCES += ../../support/src/tmtests_empty_function.c
-psxtmonce01_SOURCES += ../../support/src/tmtests_support.c
-
-dist_rtems_tests_DATA = psxtmonce01.doc
-
-include $(RTEMS_ROOT)/make/custom/@[email protected]
-include $(top_srcdir)/../automake/compile.am
-include $(top_srcdir)/../automake/leaf.am
-
-OPERATION_COUNT = @OPERATION_COUNT@
-AM_CPPFLAGS += -I$(top_srcdir)/../tmtests/include
-AM_CPPFLAGS += -DOPERATION_COUNT=$(OPERATION_COUNT)
-AM_CPPFLAGS += -I$(top_srcdir)/../support/include
-
-LINK_OBJS = $(psxtmonce01_OBJECTS) $(psxtmonce01_LDADD)
-LINK_LIBS = $(psxtmonce01_LDLIBS)
-
-psxtmonce01$(EXEEXT): $(psxtmonce01_OBJECTS) $(psxtmonce01_DEPENDENCIES)
-	@rm -f psxtmonce01$(EXEEXT)
-	$(make-exe)
-
-include $(top_srcdir)/../automake/local.am
diff --git a/testsuites/psxtmtests/psxtmonce01/init.c b/testsuites/psxtmtests/psxtmonce01/init.c
index d5a8b67f4d..0a18671bef 100644
--- a/testsuites/psxtmtests/psxtmonce01/init.c
+++ b/testsuites/psxtmtests/psxtmonce01/init.c
@@ -51,6 +51,25 @@ static void benchmark_first_time(void)
   );
 }
 
+static void benchmark_second_time(void)
+{
+  long end_time;
+  int  status;
+
+  benchmark_timer_initialize();
+  status = pthread_once( &once_control, initRoutine );
+  end_time = benchmark_timer_read();
+  rtems_test_assert( status == 0 );
+
+  put_time(
+    "pthread_once: second time",
+    end_time,
+    1,
+    0,
+    0
+  );
+}
+
 static void *POSIX_Init(
   void *argument
 )
@@ -58,6 +77,7 @@ static void *POSIX_Init(
 
   TEST_BEGIN();
   benchmark_first_time();
+  benchmark_second_time();
   TEST_END();
 
   rtems_test_exit(0);
diff --git a/testsuites/psxtmtests/psxtmonce01/psxtmonce01.doc b/testsuites/psxtmtests/psxtmonce01/psxtmonce01.doc
index cd7b2eaeb3..38e174de46 100644
--- a/testsuites/psxtmtests/psxtmonce01/psxtmonce01.doc
+++ b/testsuites/psxtmtests/psxtmonce01/psxtmonce01.doc
@@ -16,3 +16,4 @@
 This test benchmarks the following operations:
 
 + pthread_once - first time, empty initialization method
++ pthread_once - second time, empty initialization method
diff --git a/testsuites/psxtmtests/psxtmtests_plan.csv b/testsuites/psxtmtests/psxtmtests_plan.csv
index 4a589d9e7f..e29a8a85c5 100644
--- a/testsuites/psxtmtests/psxtmtests_plan.csv
+++ b/testsuites/psxtmtests/psxtmtests_plan.csv
@@ -38,7 +38,7 @@
 "pthread_setschedparam: raise other priority: preempt","psxtmthread06","psxtmtest_single","Yes"
 
 "pthread_once: first time","psxtmonce01","psxtmtest_single","Yes"
-"pthread_once: second time","psxtmonce02","psxtmtest_single","No"
+"pthread_once: second time","psxtmonce02","psxtmtest_single","Yes"
 
 "pthread_key_create: only case","psxtmkey01","psxtmtest_single","Yes"
 "pthread_setspecific: only case","psxtmkey02","psxtmtest_single","Yes"
-- 
2.17.2

_______________________________________________
devel mailing list
[email protected]
http://lists.rtems.org/mailman/listinfo/devel

Reply via email to