Changeset 2769
- Timestamp:
- Jun 17, 2009 12:36:36 PM (15 years ago)
- Location:
- pjproject/trunk/pjlib/src/pjlib-test
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
pjproject/trunk/pjlib/src/pjlib-test/main_symbian.cpp
r1269 r2769 45 45 46 46 47 // Local Functions48 49 LOCAL_C void MainL()50 {51 //52 // add your program code here, example code below53 //54 test_main();55 56 console->Printf(_L(" [press any key]\n"));57 console->Getch();58 59 CActiveScheduler::Stop();60 }61 62 47 class MyScheduler : public CActiveScheduler 63 48 { … … 74 59 } 75 60 76 class ProgramStarter : public CActive77 {78 public:79 static ProgramStarter *NewL();80 void Start();81 82 protected:83 ProgramStarter();84 void ConstructL();85 virtual void RunL();86 virtual void DoCancel();87 TInt RunError(TInt aError);88 89 private:90 RTimer timer_;91 };92 93 ProgramStarter::ProgramStarter()94 : CActive(EPriorityNormal)95 {96 }97 98 void ProgramStarter::ConstructL()99 {100 timer_.CreateLocal();101 CActiveScheduler::Add(this);102 }103 104 ProgramStarter *ProgramStarter::NewL()105 {106 ProgramStarter *self = new (ELeave) ProgramStarter;107 CleanupStack::PushL(self);108 109 self->ConstructL();110 111 CleanupStack::Pop(self);112 return self;113 }114 115 void ProgramStarter::Start()116 {117 timer_.After(iStatus, 0);118 SetActive();119 }120 121 void ProgramStarter::RunL()122 {123 MainL();124 }125 126 void ProgramStarter::DoCancel()127 {128 }129 130 TInt ProgramStarter::RunError(TInt aError)131 {132 PJ_UNUSED_ARG(aError);133 return KErrNone;134 }135 136 137 61 LOCAL_C void DoStartL() 138 62 { … … 142 66 CActiveScheduler::Install(scheduler); 143 67 144 ProgramStarter *starter = ProgramStarter::NewL(); 145 starter->Start(); 68 test_main(); 146 69 147 CActiveScheduler::Start(); 70 CActiveScheduler::Install(NULL); 71 CleanupStack::Pop(scheduler); 72 delete scheduler; 148 73 } 149 74 75 #define WRITE_TO_DEBUG_CONSOLE 76 77 #ifdef WRITE_TO_DEBUG_CONSOLE 78 #include<e32debug.h> 79 #endif 150 80 151 81 // Global Functions 152 153 82 static void log_writer(int level, const char *buf, int len) 154 83 { 155 wchar_t buf16[PJ_LOG_MAX_SIZE];84 static wchar_t buf16[PJ_LOG_MAX_SIZE]; 156 85 157 86 PJ_UNUSED_ARG(level); 158 87 159 88 pj_ansi_to_unicode(buf, len, buf16, PJ_ARRAY_SIZE(buf16)); 160 89 buf16[len] = 0; 90 buf16[len+1] = 0; 91 161 92 TPtrC16 aBuf((const TUint16*)buf16, (TInt)len); 162 93 console->Write(aBuf); 94 95 #ifdef WRITE_TO_DEBUG_CONSOLE 96 RDebug::Print(aBuf); 97 #endif 163 98 } 164 99 … … 181 116 if (mainError) 182 117 console->Printf(_L(" failed, leave code = %d"), mainError); 118 183 119 console->Printf(_L(" [press any key]\n")); 184 120 console->Getch(); … … 186 122 delete console; 187 123 delete cleanup; 124 125 CloseSTDLIB(); 126 188 127 __UHEAP_MARKEND; 128 189 129 return KErrNone; 190 130 } -
pjproject/trunk/pjlib/src/pjlib-test/string.c
r2394 r2769 66 66 67 67 #define HELLO_WORLD "Hello World" 68 #define HELLO_WORLD_LEN 11 68 69 #define JUST_HELLO "Hello" 70 #define JUST_HELLO_LEN 5 69 71 #define UL_VALUE 3456789012UL 70 72 … … 291 293 int string_test(void) 292 294 { 293 const pj_str_t hello_world = { HELLO_WORLD, strlen(HELLO_WORLD)};294 const pj_str_t just_hello = { JUST_HELLO, strlen(JUST_HELLO)};295 const pj_str_t hello_world = { HELLO_WORLD, HELLO_WORLD_LEN }; 296 const pj_str_t just_hello = { JUST_HELLO, JUST_HELLO_LEN }; 295 297 pj_str_t s1, s2, s3, s4, s5; 296 298 enum { RCOUNT = 10, RLEN = 16 }; -
pjproject/trunk/pjlib/src/pjlib-test/test.c
r2394 r2769 198 198 else 199 199 PJ_LOG(3,("test", "Test completed with error(s)")); 200 201 pj_shutdown(); 202 200 203 return 0; 201 204 }
Note: See TracChangeset
for help on using the changeset viewer.