Changeset 36033
- Timestamp:
- 11/29/09 20:09:03 (3 years ago)
- Location:
- lang/objective-cplusplus/i3/trunk
- Files:
-
- 1 removed
- 10 modified
-
src/CompletionWindow.h (modified) (1 diff)
-
src/Delegate.h (modified) (1 diff)
-
src/InputWindow.h (modified) (1 diff)
-
src/Mediator.cpp (modified) (3 diffs)
-
src/OutputWindow.h (modified) (1 diff)
-
src/ShellManager.h (modified) (1 diff)
-
src/Tester.cpp (modified) (6 diffs)
-
src/Tester.h (modified) (3 diffs)
-
src/gui-windows/Gui.cpp (modified) (1 diff)
-
windows/fakecygpty.exe.xz (deleted)
-
windows/i3_test.vcproj (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
lang/objective-cplusplus/i3/trunk/src/CompletionWindow.h
r34909 r36033 17 17 CompletionWindow(Mediator& mediator); 18 18 ~CompletionWindow(); 19 template <typename T> 20 void execute(T& event); 19 20 template <typename T> void execute(T& event); 21 template <typename T> void beforeExecute(T& event) {} 22 template <typename T> void afterExecute(T& event) {} 21 23 22 24 protected: -
lang/objective-cplusplus/i3/trunk/src/Delegate.h
r35428 r36033 17 17 ~Delegate(); 18 18 void run(); 19 template <typename T> 20 void execute(T& event); 19 20 template <typename T> void execute(T& event); 21 template <typename T> void beforeExecute(T& event) {} 22 template <typename T> void afterExecute(T& event) {} 21 23 22 24 protected: -
lang/objective-cplusplus/i3/trunk/src/InputWindow.h
r34947 r36033 18 18 mil::DoubleBuffer<std::vector<TCHAR> > input_cache; 19 19 20 template <typename T> 21 void execute(T& event); 20 template <typename T> void execute(T& event); 21 template <typename T> void beforeExecute(T& event) {} 22 template <typename T> void afterExecute(T& event) {} 23 22 24 std::vector<TCHAR> local_input_cache; 23 25 -
lang/objective-cplusplus/i3/trunk/src/Mediator.cpp
r36013 r36033 17 17 18 18 exit_status Mediator::start() { 19 #ifdef I3_TEST 20 tester.setMediator(*this); 21 #endif 19 22 #if !defined(MIL_GUI_COCOA) || defined(__APPLE__) 20 23 // threaded 21 inputWindow.createUI();24 //inputWindow.createUI(); 22 25 completionWindow.start(); 23 26 outputWindow.start(); … … 26 29 #ifdef I3_TEST 27 30 inputWindow.start(); 28 Tester tester(*this);29 31 tester.run(); 30 32 #else … … 43 45 44 46 #ifdef I3_TEST 45 Tester tester(*this);46 47 tester.start(); 47 48 #endif -
lang/objective-cplusplus/i3/trunk/src/OutputWindow.h
r35976 r36033 21 21 void createUI(); 22 22 void run(); 23 template <typename T> 24 void execute(T& event); 23 24 template <typename T> void execute(T& event); 25 template <typename T> void beforeExecute(T& event) {} 26 template <typename T> void afterExecute(T& event) {} 25 27 }; 26 28 -
lang/objective-cplusplus/i3/trunk/src/ShellManager.h
r35428 r36033 17 17 ~ShellManager(); 18 18 void run(); 19 template <typename T> 20 void execute(T& event); 19 20 template <typename T> void execute(T& event); 21 template <typename T> void beforeExecute(T& event) {} 22 template <typename T> void afterExecute(T& event) {} 23 21 24 Pty pty; 22 25 -
lang/objective-cplusplus/i3/trunk/src/Tester.cpp
r36013 r36033 6 6 namespace i3 { 7 7 8 Tester::Tester(Mediator& mediator) : mediator(mediator), passed(true), index(0) { 8 Tester tester; 9 #define CHECK_VALID { if (!valid) { throw std::logic_error("Tester " __FUNCTION__); }} 10 11 Tester::Tester() : valid(false), mediator(Mediator()), passed(true), index(0) { 12 } 13 14 Tester::setMediator(Mediator& mediator_) { 15 mediator = mediator_; 16 valid = true; 9 17 } 10 18 11 19 std::string Tester::getName() { 20 CHECK_VALID; 12 21 synchronized (mutex) { 13 22 if (passed) { … … 21 30 22 31 void Tester::pass() { 32 CHECK_VALID; 23 33 synchronized (mutex) { 24 34 passed = true; … … 27 37 28 38 void Tester::next(std::string& name_) { 39 CHECK_VALID; 29 40 synchronized (mutex) { 30 41 name = name_; … … 35 46 36 47 void Tester::run() { 48 CHECK_VALID; 37 49 for (;;) { 38 50 for (int i = 0; i < 100 && this->execute_front(); i++) { … … 41 53 42 54 synchronized (mutex) { 43 if (!startNext()) { 44 break; 55 if (pased) { 56 if (!startNext()) { 57 break; 58 } 45 59 } 46 60 } … … 48 62 } 49 63 64 struct SimplePing { 65 }; 66 67 template <> 68 void InputWindow::beforeExecute(SimplePing& e) { 69 if (tester.getName() == "simple ping") { 70 QT_CHECK(true); 71 tester.pass(); 72 } 73 } 74 75 template <> 76 void InputWindow::execute(SimplePing& e) {} 77 50 78 bool Tester::startNext() { 79 CHECK_VALID; 80 81 if (index == 1) { 82 next("simple ping"); 83 mediator.getInputWindow(); 84 } 51 85 return false; 52 86 } -
lang/objective-cplusplus/i3/trunk/src/Tester.h
r36013 r36033 7 7 namespace i3 { 8 8 class Tester : public mil::Module<Tester> { 9 bool valid; 9 10 Mediator& mediator; 10 11 bool passed; … … 14 15 bool startNext(); 15 16 public: 16 Tester(Mediator& mediator); 17 Tester(); 18 void setMediator(Mediator& mediator); 17 19 std::string getName(); 18 20 void pass(); … … 21 23 }; 22 24 25 extern Tester tester; 26 23 27 } 24 28 -
lang/objective-cplusplus/i3/trunk/src/gui-windows/Gui.cpp
r35311 r36033 21 21 } 22 22 void alert(string message) { 23 MessageBox(NULL, message.c_str(), _(" alert"), MB_OK);23 MessageBox(NULL, message.c_str(), _("info"), MB_OK); 24 24 } 25 25 -
lang/objective-cplusplus/i3/trunk/windows/i3_test.vcproj
r36013 r36033 638 638 </File> 639 639 <File 640 RelativePath="..\src\gui-windows\OutputWindowPlatform.cpp" 641 > 642 </File> 643 <File 640 644 RelativePath="..\src\os-windows\Pty.cpp" 641 645 > … … 680 684 /> 681 685 </FileConfiguration> 686 </File> 687 <File 688 RelativePath="..\src\Test1.cpp" 689 > 690 </File> 691 <File 692 RelativePath="..\src\Test2.cpp" 693 > 694 </File> 695 <File 696 RelativePath="..\src\Test3.cpp" 697 > 698 </File> 699 <File 700 RelativePath="..\src\Test4.cpp" 701 > 682 702 </File> 683 703 <File … … 838 858 </File> 839 859 </Filter> 840 <File841 RelativePath="..\src\gui-windows\OutputWindowPlatform.cpp"842 >843 </File>844 860 </Files> 845 861 <Globals>
![(please configure the [header_logo] section in trac.ini)](/share/chrome/site/your_project_logo.png)