javamanager/javacaptain/tsrc/test_runner/src/rtccommsrtc1test.cpp
branchRCL_3
changeset 14 04becd199f91
equal deleted inserted replaced
13:f5050f1da672 14:04becd199f91
       
     1 /*
       
     2 * Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies).
       
     3 * All rights reserved.
       
     4 * This component and the accompanying materials are made available
       
     5 * under the terms of "Eclipse Public License v1.0"
       
     6 * which accompanies this distribution, and is available
       
     7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     8 *
       
     9 * Initial Contributors:
       
    10 * Nokia Corporation - initial contribution.
       
    11 *
       
    12 * Contributors:
       
    13 *
       
    14 * Description:  RtcCommsRtc1
       
    15 *
       
    16 */
       
    17 
       
    18 #include "TestHarness.h"
       
    19 
       
    20 #include <unistd.h>
       
    21 
       
    22 #include "testuids.h"
       
    23 
       
    24 #include "rtccommshelpers.h"
       
    25 
       
    26 TEST_GROUP(RtcCommsRtc1)
       
    27 {
       
    28     TEST_SETUP()
       
    29     {
       
    30     }
       
    31 
       
    32     TEST_TEARDOWN()
       
    33     {
       
    34     }
       
    35 };
       
    36 
       
    37 TEST(RtcCommsRtc1, RTCS14_LaunchSyncTerminateSyncPrematureExit3)
       
    38 {
       
    39     launch(uid_premature_exit3, syncOn, "test1");
       
    40     terminate(uid_premature_exit3, syncOn);
       
    41 }
       
    42 
       
    43 TEST(RtcCommsRtc1, RTCS13_LaunchSyncTerminateSyncPrematureExit2)
       
    44 {
       
    45     launch(uid_premature_exit2, syncOn, "test1");
       
    46     terminate(uid_premature_exit2, syncOn);
       
    47 }
       
    48 
       
    49 TEST(RtcCommsRtc1, RTCS12_LaunchSyncTerminateSyncPrematureExit1)
       
    50 {
       
    51     launch(uid_premature_exit1, syncOn, "test1", RTC_LAUNCH_TYPE_NORMAL_C, true);
       
    52     terminate(uid_premature_exit1, syncOn);
       
    53 }
       
    54 
       
    55 TEST(RtcCommsRtc1, RTCS11_LaunchSyncTerminateSyncWontTerminate2)
       
    56 {
       
    57     launch(uid_wont_terminate2, syncOn, "test1");
       
    58     terminate(uid_wont_terminate2, syncOn);
       
    59 }
       
    60 
       
    61 TEST(RtcCommsRtc1, RTCS10_05LaunchASyncSleep1sTerminateASyncSleep1sWontTerminate1)
       
    62 {
       
    63     launch(uid_wont_terminate1, syncOff, "test1");
       
    64     sleep(1);
       
    65     terminate(uid_wont_terminate1, syncOff);
       
    66     sleep(1);
       
    67 }
       
    68 
       
    69 TEST(RtcCommsRtc1, RTCS10_04LaunchASyncSleep2sTerminateSyncWontTerminate1)
       
    70 {
       
    71     launch(uid_wont_terminate1, syncOff, "test1");
       
    72     sleep(2);
       
    73     terminate(uid_wont_terminate1, syncOn);
       
    74 }
       
    75 
       
    76 TEST(RtcCommsRtc1, RTCS10_03LaunchASyncSleep1sTerminateSyncWontTerminate1)
       
    77 {
       
    78     launch(uid_wont_terminate1, syncOff, "test1");
       
    79     sleep(1);
       
    80     terminate(uid_wont_terminate1, syncOn);
       
    81 }
       
    82 
       
    83 TEST(RtcCommsRtc1, RTCS10_02LaunchASyncTerminateSyncWontTerminate1)
       
    84 {
       
    85     launch(uid_wont_terminate1, syncOff, "test1");
       
    86     terminate(uid_wont_terminate1, syncOn);
       
    87 }
       
    88 
       
    89 TEST(RtcCommsRtc1, RTCS10_01LaunchSyncTerminateSyncWontTerminate1)
       
    90 {
       
    91     launch(uid_wont_terminate1, syncOn, "test1");
       
    92     terminate(uid_wont_terminate1, syncOn);
       
    93 }
       
    94 
       
    95 TEST(RtcCommsRtc1, RTCS04_07LaunchASyncTerminateSyncNormal4)
       
    96 {
       
    97     launch(uid_normal1, syncOff, "test1");
       
    98     terminate(uid_normal1, syncOn);
       
    99 }
       
   100 
       
   101 TEST(RtcCommsRtc1, RTCS04_06_LaunchPushSyncx2TerminateSyncNormal4)
       
   102 {
       
   103     launch(uid_normal4, syncOn, "test1", RTC_LAUNCH_TYPE_PUSH_C);
       
   104     launch(uid_normal4, syncOn, "test1", RTC_LAUNCH_TYPE_PUSH_C);
       
   105     terminate(uid_normal4, syncOn);
       
   106 }
       
   107 
       
   108 TEST(RtcCommsRtc1, RTCS04_05_LaunchPushSyncx2TerminateSyncNormal1)
       
   109 {
       
   110     launch(uid_normal1, syncOn, "test1", RTC_LAUNCH_TYPE_PUSH_C);
       
   111     launch(uid_normal1, syncOn, "test1", RTC_LAUNCH_TYPE_PUSH_C);
       
   112     terminate(uid_normal1, syncOn);
       
   113 }
       
   114 
       
   115 TEST(RtcCommsRtc1, RTCS04_04_LaunchPushAsyncx2TerminateSyncNormal4)
       
   116 {
       
   117     launch(uid_normal4, syncOff, "test1", RTC_LAUNCH_TYPE_PUSH_C);
       
   118     launch(uid_normal4, syncOff, "test1", RTC_LAUNCH_TYPE_PUSH_C);
       
   119     terminate(uid_normal4, syncOn);
       
   120 }
       
   121 
       
   122 TEST(RtcCommsRtc1, RTCS04_03_LaunchPushAsyncx2TerminateSyncNormal1)
       
   123 {
       
   124     launch(uid_normal1, syncOff, "test1", RTC_LAUNCH_TYPE_PUSH_C);
       
   125     launch(uid_normal1, syncOff, "test1", RTC_LAUNCH_TYPE_PUSH_C);
       
   126     terminate(uid_normal1, syncOn);
       
   127 }
       
   128 
       
   129 TEST(RtcCommsRtc1, RTCS04_02_LaunchPushAsyncLaunchSyncTerminateSyncNormal4)
       
   130 {
       
   131     launch(uid_normal4, syncOff, "test1", RTC_LAUNCH_TYPE_PUSH_C);
       
   132     launch(uid_normal4, syncOn, "test1");
       
   133     terminate(uid_normal4, syncOn);
       
   134 }
       
   135 
       
   136 TEST(RtcCommsRtc1, RTCS04_01_LaunchPushAsyncLaunchSyncTerminateSyncNormal1)
       
   137 {
       
   138     launch(uid_normal1, syncOff, "test1", RTC_LAUNCH_TYPE_PUSH_C);
       
   139     launch(uid_normal1, syncOn, "test1");
       
   140     terminate(uid_normal1, syncOn);
       
   141 }
       
   142 
       
   143 TEST(RtcCommsRtc1, RTCS03_LaunchSyncTerminateSyncNormal3)
       
   144 {
       
   145     launch(uid_normal3, syncOn, "test1");
       
   146     terminate(uid_normal3, syncOn);
       
   147 }
       
   148 
       
   149 TEST(RtcCommsRtc1, RTCS02_07LaunchAsyncSyncTerminateAsyncSyncNormal2)
       
   150 {
       
   151     launch(uid_normal2, syncOff, "test1");
       
   152     launch(uid_normal2, syncOn, "test1");
       
   153     terminate(uid_normal2, syncOff);
       
   154     terminate(uid_normal2, syncOn);
       
   155 }
       
   156 
       
   157 TEST(RtcCommsRtc1, RTCS02_06LaunchSyncx2TerminateSyncx2Normal2)
       
   158 {
       
   159     launch(uid_normal2, syncOn, "test1");
       
   160     launch(uid_normal2, syncOn, "test1");
       
   161     terminate(uid_normal2, syncOn);
       
   162     terminate(uid_normal2, syncOn);
       
   163 }
       
   164 
       
   165 TEST(RtcCommsRtc1, RTCS02_05LaunchASyncSleep1sTerminateASyncSleep1sNormal2)
       
   166 {
       
   167     launch(uid_normal2, syncOff, "test1");
       
   168     sleep(1);
       
   169     terminate(uid_normal2, syncOff);
       
   170     sleep(1);
       
   171 }
       
   172 
       
   173 TEST(RtcCommsRtc1, RTCS02_04LaunchASyncSleep2sTerminateSyncNormal2)
       
   174 {
       
   175     launch(uid_normal2, syncOff, "test1");
       
   176     sleep(2);
       
   177     terminate(uid_normal2, syncOn);
       
   178 }
       
   179 
       
   180 TEST(RtcCommsRtc1, RTCS02_03LaunchASyncSleep1sTerminateSyncNormal2)
       
   181 {
       
   182     launch(uid_normal2, syncOff, "test1");
       
   183     sleep(1);
       
   184     terminate(uid_normal2, syncOn);
       
   185 }
       
   186 
       
   187 TEST(RtcCommsRtc1, RTCS02_02LaunchASyncTerminateSyncNormal2)
       
   188 {
       
   189     launch(uid_normal2, syncOff, "test1");
       
   190     terminate(uid_normal2, syncOn);
       
   191 }
       
   192 
       
   193 TEST(RtcCommsRtc1, RTCS02_01LaunchSyncTerminateSyncNormal2)
       
   194 {
       
   195     launch(uid_normal2, syncOn, "test1");
       
   196     terminate(uid_normal2, syncOn);
       
   197 }
       
   198 
       
   199 // RTC01 launching normal1 which is an ideal runtime
       
   200 TEST(RtcCommsRtc1, RTCS01_07LaunchAsyncSyncTerminateAsyncSyncNormal1)
       
   201 {
       
   202     launch(uid_normal1, syncOff, "test1");
       
   203     launch(uid_normal1, syncOn, "test1");
       
   204     terminate(uid_normal1, syncOff);
       
   205     terminate(uid_normal1, syncOn);
       
   206 }
       
   207 
       
   208 TEST(RtcCommsRtc1, RTCS01_06LaunchSyncx2TerminateSyncx2Normal1)
       
   209 {
       
   210     launch(uid_normal1, syncOn, "test1");
       
   211     launch(uid_normal1, syncOn, "test1");
       
   212     terminate(uid_normal1, syncOn);
       
   213     terminate(uid_normal1, syncOn);
       
   214 }
       
   215 
       
   216 TEST(RtcCommsRtc1, RTCS01_05LaunchASyncSleep1sTerminateASyncSleep1sNormal1)
       
   217 {
       
   218     launch(uid_normal1, syncOff, "test1");
       
   219     sleep(1);
       
   220     terminate(uid_normal1, syncOff);
       
   221     sleep(1);
       
   222 }
       
   223 
       
   224 TEST(RtcCommsRtc1, RTCS01_04LaunchASyncSleep2sTerminateSyncNormal1)
       
   225 {
       
   226     launch(uid_normal1, syncOff, "test1");
       
   227     sleep(2);
       
   228     terminate(uid_normal1, syncOn);
       
   229 }
       
   230 
       
   231 TEST(RtcCommsRtc1, RTCS01_03LaunchASyncSleep1sTerminateSyncNormal1)
       
   232 {
       
   233     launch(uid_normal1, syncOff, "test1");
       
   234     sleep(1);
       
   235     terminate(uid_normal1, syncOn);
       
   236 }
       
   237 
       
   238 TEST(RtcCommsRtc1, RTCS01_02LaunchASyncTerminateSyncNormal1)
       
   239 {
       
   240     launch(uid_normal1, syncOff, "test1");
       
   241     terminate(uid_normal1, syncOn);
       
   242 }
       
   243 
       
   244 TEST(RtcCommsRtc1, RTCS01_01LaunchSyncTerminateSyncNormal1)
       
   245 {
       
   246     launch(uid_normal1, syncOn, "test1");
       
   247     terminate(uid_normal1, syncOn);
       
   248 }