Nux

Merge lp:~brandontschaefer/nux/nux-SRUs into lp:nux/2.0

Proposed by Brandon Schaefer on 2012-07-20
Status: Merged
Approved by: Tim Penhey on 2012-07-23
Approved revision: 622
Merged at revision: 616
Proposed branch: lp:~brandontschaefer/nux/nux-SRUs
Merge into: lp:nux/2.0
Diff against target: 606 lines (+261/-39)
15 files modified
Nux/AnimatedTextureArea.cpp (+2/-2)
Nux/Area.cpp (+1/-0)
Nux/InputMethodIBus.cpp (+5/-0)
Nux/ProgramFramework/TestView.cpp (+7/-0)
Nux/ProgramFramework/TestView.h (+4/-0)
Nux/ScrollView.cpp (+28/-19)
Nux/View.cpp (+7/-2)
NuxGraphics/FontTexture.cpp (+7/-7)
NuxGraphics/GLTextureResourceManager.cpp (+20/-7)
NuxGraphics/GraphicsDisplayX11.cpp (+1/-0)
NuxImage/CairoGraphics.cpp (+4/-1)
tests/Makefile.am (+1/-0)
tests/gtest-nux-scrollview.cpp (+127/-0)
tests/gtest-nux-view.cpp (+46/-0)
tools/unity_support_test.c (+1/-1)
To merge this branch: bzr merge lp:~brandontschaefer/nux/nux-SRUs
Reviewer Review Type Date Requested Status
Jay Taoko (community) 2012-07-20 Approve on 2012-07-20
Review via email: mp+116051@code.launchpad.net

Commit message

SRUs for Nux 2.0 from Nux 3.0 (618, 619, 621, 622, 623, 624, 631).

Description of the change

Back porting some revisions form trunk Nux:
618
619
621
622
623
624
631

(627-629 could not be back ported, it needs 625 but that breaks the api)

Everything compiles, and test pass.

To post a comment you must log in.
Jay Taoko (jaytaoko) wrote :

Compile and works with Unity 5.0 SRU

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'Nux/AnimatedTextureArea.cpp'
2--- Nux/AnimatedTextureArea.cpp 2011-10-17 20:57:35 +0000
3+++ Nux/AnimatedTextureArea.cpp 2012-07-20 18:35:21 +0000
4@@ -71,9 +71,9 @@
5
6 }
7
8- void AnimatedTextureArea::SetTexture(TextureFrameAnimation *Texture)
9+ void AnimatedTextureArea::SetTexture(TextureFrameAnimation *t)
10 {
11- m_UserTexture = Texture;
12+ m_UserTexture = t;
13
14 if (m_UserTexture)
15 {
16
17=== modified file 'Nux/Area.cpp'
18--- Nux/Area.cpp 2012-03-12 21:45:30 +0000
19+++ Nux/Area.cpp 2012-07-20 18:35:21 +0000
20@@ -39,6 +39,7 @@
21 , geometry_(0, 0, DEFAULT_WIDGET_WIDTH, DEFAULT_WIDGET_HEIGHT)
22 , min_size_(AREA_MIN_WIDTH, AREA_MIN_HEIGHT)
23 , max_size_(AREA_MAX_WIDTH, AREA_MAX_HEIGHT)
24+ , layout_done_(true)
25 {
26 window_thread_ = GetWindowThread();
27 visible_ = true;
28
29=== modified file 'Nux/InputMethodIBus.cpp'
30--- Nux/InputMethodIBus.cpp 2012-04-19 22:57:27 +0000
31+++ Nux/InputMethodIBus.cpp 2012-07-20 18:35:21 +0000
32@@ -278,6 +278,11 @@
33 pango_attr->end_index = g_utf8_offset_to_pointer (text->text, attr->end_index) - text->text;
34 pango_attr_list_insert (preedit_attrs, pango_attr);
35 }
36+ if (text_entry_->preedit_attrs_)
37+ {
38+ pango_attr_list_unref(text_entry_->preedit_attrs_);
39+ text_entry_->preedit_attrs_ = NULL;
40+ }
41 text_entry_->preedit_attrs_ = preedit_attrs;
42 }
43 if (text->text)
44
45=== modified file 'Nux/ProgramFramework/TestView.cpp'
46--- Nux/ProgramFramework/TestView.cpp 2012-03-02 02:48:48 +0000
47+++ Nux/ProgramFramework/TestView.cpp 2012-07-20 18:35:21 +0000
48@@ -32,6 +32,7 @@
49 TestView::TestView(NUX_FILE_LINE_DECL)
50 : nux::View(NUX_FILE_LINE_PARAM)
51 , can_focus_(true)
52+, calls_to_queue_draw_(0)
53 {
54 ResetEvents();
55 ResetKeyFocusEvents();
56@@ -92,6 +93,12 @@
57 registered_end_keynav_focus_ = false;
58 }
59
60+void TestView::QueueDraw()
61+{
62+ ++calls_to_queue_draw_;
63+ nux::View::QueueDraw();
64+}
65+
66 nux::Color TestView::GetColor() const
67 {
68 return current_color_;
69
70=== modified file 'Nux/ProgramFramework/TestView.h'
71--- Nux/ProgramFramework/TestView.h 2012-03-02 02:48:48 +0000
72+++ Nux/ProgramFramework/TestView.h 2012-07-20 18:35:21 +0000
73@@ -37,6 +37,8 @@
74 void ResetEvents();
75 void ResetKeyFocusEvents();
76
77+ void QueueDraw();
78+
79 bool can_focus_;
80
81 bool has_focus_;
82@@ -53,6 +55,8 @@
83 bool registered_begin_keynav_focus_;
84 bool registered_end_keynav_focus_;
85
86+ unsigned int calls_to_queue_draw_;
87+
88 nux::KeyNavDirection key_nav_direction_; //!< The key nav direction received when the view obtained the focus.
89
90 protected:
91
92=== modified file 'Nux/ScrollView.cpp'
93--- Nux/ScrollView.cpp 2011-12-13 08:20:18 +0000
94+++ Nux/ScrollView.cpp 2012-07-20 18:35:21 +0000
95@@ -799,48 +799,58 @@
96
97 void ScrollView::ScrollUp(float stepy, int mousedy)
98 {
99+ if (m_ViewContentHeight <= m_ViewHeight)
100+ return;
101+
102 if (view_layout_)
103 {
104- _delta_y += (float) stepy * (float) mousedy;
105+ int last_delta_y = _delta_y;
106+ _delta_y += stepy * mousedy;
107
108 if (_delta_y > 0)
109 {
110 _delta_y = 0;
111 }
112+
113+ if (last_delta_y != _delta_y)
114+ {
115+ QueueDraw();
116+ _vscrollbar->QueueDraw();
117+ }
118+
119 view_layout_->Set2DTranslation(_delta_x, _delta_y, 0);
120+ _vscrollbar->SetContentOffset(_delta_x, _delta_y);
121+
122 scrolling.emit(_delta_x, _delta_y);
123 }
124-
125- if (view_layout_)
126- {
127- _vscrollbar->SetContentOffset(_delta_x, _delta_y);
128- _vscrollbar->QueueDraw();
129- }
130-
131- QueueDraw();
132 }
133
134 void ScrollView::ScrollDown(float stepy, int mousedy)
135 {
136+ if (m_ViewContentHeight <= m_ViewHeight)
137+ return;
138+
139 if (view_layout_)
140 {
141- _delta_y -= (float) stepy * (float) mousedy;
142+ int last_delta_y = _delta_y;
143+ _delta_y -= stepy * mousedy;
144
145 if (m_ViewY + _delta_y + m_ViewContentHeight < m_ViewY + m_ViewHeight)
146 {
147 _delta_y = - (m_ViewContentHeight > m_ViewHeight ? m_ViewContentHeight - m_ViewHeight : 0);
148 }
149+
150+ if (last_delta_y != _delta_y)
151+ {
152+ QueueDraw();
153+ _vscrollbar->QueueDraw();
154+ }
155+
156 view_layout_->Set2DTranslation(_delta_x, _delta_y, 0);
157+ _vscrollbar->SetContentOffset(_delta_x, _delta_y);
158+
159 scrolling.emit(_delta_x, _delta_y);
160 }
161-
162- if (view_layout_)
163- {
164- _vscrollbar->SetContentOffset(_delta_x, _delta_y);
165- _vscrollbar->QueueDraw();
166- }
167-
168- QueueDraw();
169 }
170
171 void ScrollView::SetSizeMatchContent(bool b)
172@@ -930,7 +940,6 @@
173 {
174 ScrollUp(abs(wheel_delta / NUX_MOUSEWHEEL_DELTA), m_MouseWheelScrollSize);
175 }
176- QueueDraw();
177 }
178
179 bool ScrollView::AcceptKeyNavFocus()
180
181=== modified file 'Nux/View.cpp'
182--- Nux/View.cpp 2012-02-26 01:57:06 +0000
183+++ Nux/View.cpp 2012-07-20 18:35:21 +0000
184@@ -216,6 +216,9 @@
185
186 void View::QueueDraw()
187 {
188+ if (draw_cmd_queued_)
189+ return;
190+
191 //GetWindowCompositor()..AddToDrawList(this);
192 WindowThread* application = GetWindowThread();
193 if (application)
194@@ -409,12 +412,14 @@
195
196 void View::GeometryChangePending()
197 {
198- QueueDraw();
199+ if (IsLayoutDone())
200+ QueueDraw();
201 }
202
203 void View::GeometryChanged()
204 {
205- QueueDraw();
206+ if (IsLayoutDone())
207+ QueueDraw();
208 }
209
210 Area* View::FindAreaUnderMouse(const Point& mouse_position, NuxEventType event_type)
211
212=== modified file 'NuxGraphics/FontTexture.cpp'
213--- NuxGraphics/FontTexture.cpp 2011-10-19 20:32:38 +0000
214+++ NuxGraphics/FontTexture.cpp 2012-07-20 18:35:21 +0000
215@@ -147,11 +147,11 @@
216
217 unsigned int line_size = (unsigned int) Line.length();
218 char *tc = new char[line_size+1];
219- const char *Stream = tc;
220+ const char *stream = tc;
221 Memcpy(tc, Line.c_str(), line_size + 1);
222 tc[line_size] = 0;
223
224- if ( ParseCommand(&Stream, "common") /*Read == "common"*/)
225+ if ( ParseCommand(&stream, "common") /*Read == "common"*/)
226 {
227 Parse_bool(tc, "Bold=", m_Charset.bold);
228 Parse_bool(tc, "Italic=", m_Charset.italic);
229@@ -169,7 +169,7 @@
230 // Constant for now... Should be read from the font file
231 m_Charset.NumChar = 256;
232 }
233- else if (ParseCommand(&Stream, "char"))
234+ else if (ParseCommand(&stream, "char"))
235 {
236
237 unsigned short CharID = 0;
238@@ -187,14 +187,14 @@
239 Parse_s16(tc, "abcC=", m_Charset.Chars[CharID].abcC);
240 Parse_u16(tc, "page=", m_Charset.Chars[CharID].page);
241 }
242- else if ( ParseCommand(&Stream, "Kerning"))
243+ else if ( ParseCommand(&stream, "Kerning"))
244 {
245 Parse_u16(tc, "count=", m_Charset.NumKerningPairs);
246
247 if (m_Charset.NumKerningPairs > 0)
248 m_Charset.Kerning = new KerningPair[m_Charset.NumKerningPairs];
249 }
250- else if ( ParseCommand(&Stream, "KerningPair"))
251+ else if ( ParseCommand(&stream, "KerningPair"))
252 {
253 if (KerningIndex < m_Charset.NumKerningPairs)
254 {
255@@ -204,11 +204,11 @@
256 KerningIndex++;
257 }
258 }
259- else if ( ParseCommand(&Stream, "Texture"))
260+ else if ( ParseCommand(&stream, "Texture"))
261 {
262 char texture[256];
263
264- if (ParseLine(&Stream, texture, 256))
265+ if (ParseLine(&stream, texture, 256))
266 {
267 // FilePath FontPath;
268 // FontPath.AddSearchPath(""); // for case where fully qualified path is given
269
270=== modified file 'NuxGraphics/GLTextureResourceManager.cpp'
271--- NuxGraphics/GLTextureResourceManager.cpp 2012-02-18 21:32:06 +0000
272+++ NuxGraphics/GLTextureResourceManager.cpp 2012-07-20 18:35:21 +0000
273@@ -83,28 +83,36 @@
274 unsigned char* pixels_u8 = gdk_pixbuf_get_pixels(pixbuf);
275 unsigned int* pixels_u32 = reinterpret_cast<unsigned int*> (pixels_u8);
276
277+ unsigned char* dest_u8 = surface.GetPtrRawData ();
278+ const int pitch = surface.GetPitch ();
279+
280 if (premultiply == true)
281 {
282 // Copy from pixbuf(RGBA) to surface(premultiplied RGBA).
283 for (unsigned int i = 0; i < height; i++)
284 {
285+ unsigned int* dest_u32 = reinterpret_cast<unsigned int*>(dest_u8);
286 for (unsigned int j = 0; j < width; j++)
287 {
288 const unsigned int pixel = pixels_u32[j];
289 const unsigned int a = pixel >> 24;
290 if (a == 0)
291- surface.Write32b(j, i, 0);
292+ {
293+ dest_u32[j] = 0;
294+ }
295 else
296 {
297 const unsigned int b = (((pixel >> 16) & 0xff) * a) / 255;
298 const unsigned int g = (((pixel >> 8) & 0xff) * a) / 255;
299 const unsigned int r = ((pixel & 0xff) * a) / 255;
300 const unsigned int p = a << 24 | b << 16 | g << 8 | r;
301- surface.Write32b(j, i, p);
302+
303+ dest_u32[j] = p;
304 }
305 }
306 pixels_u8 += rowstride;
307 pixels_u32 = reinterpret_cast<unsigned int*> (pixels_u8);
308+ dest_u8 += pitch;
309 }
310 }
311 else
312@@ -112,10 +120,9 @@
313 // Copy from pixbuf(RGBA) to surface(RGBA).
314 for (unsigned int i = 0; i < height; i++)
315 {
316- for (unsigned int j = 0; j < width; j++)
317- surface.Write32b(j, i, pixels_u32[j]);
318+ Memcpy (dest_u8, pixels_u8, width * 4);
319 pixels_u8 += rowstride;
320- pixels_u32 = reinterpret_cast<unsigned int*> (pixels_u8);
321+ dest_u8 += pitch;
322 }
323 }
324 }
325@@ -123,16 +130,22 @@
326 {
327 // Copy from pixbuf(RGB) to surface(RGBA).
328 unsigned char* pixels = gdk_pixbuf_get_pixels(pixbuf);
329+ unsigned char* dest_u8 = surface.GetPtrRawData();
330+ const int pitch = surface.GetPitch();
331+
332 for (unsigned int i = 0; i < height; i++)
333 {
334+ unsigned int* dest_u32 = reinterpret_cast<unsigned int*>(dest_u8);
335 for (unsigned int j = 0; j < width; j++)
336 {
337 const unsigned char r = pixels[j*3];
338 const unsigned char g = pixels[j*3+1];
339 const unsigned char b = pixels[j*3+2];
340- surface.Write(j, i, r, g, b, 0xff);
341+ const unsigned int p = 0xff000000 | b << 16 | g << 8 | r;
342+ dest_u32[j] = p;
343 }
344 pixels += rowstride;
345+ dest_u8 += pitch;
346 }
347 }
348
349@@ -828,7 +841,7 @@
350 return ret;
351 }
352
353- void TextureVolume::GetData(void* Buffer, int MipIndex, int StrideY, int slice)
354+ void TextureVolume::GetData(void* Buffer, int MipIndex, int StrideY, int face)
355 {
356 BYTE *Dest = (BYTE *) Buffer;
357 // const BYTE* Src = _image.GetSurface(MipIndex, slice).GetPtrRawData();
358
359=== modified file 'NuxGraphics/GraphicsDisplayX11.cpp'
360--- NuxGraphics/GraphicsDisplayX11.cpp 2012-03-03 11:53:24 +0000
361+++ NuxGraphics/GraphicsDisplayX11.cpp 2012-07-20 18:35:21 +0000
362@@ -76,6 +76,7 @@
363 , _drag_display(NULL)
364 , _drag_drop_timestamp(0)
365 , _dnd_source_data(NULL)
366+ , _dnd_source_window(0)
367 , _global_pointer_grab_data(0)
368 , _global_pointer_grab_active(false)
369 , _global_pointer_grab_callback(0)
370
371=== modified file 'NuxImage/CairoGraphics.cpp'
372--- NuxImage/CairoGraphics.cpp 2012-02-18 21:32:06 +0000
373+++ NuxImage/CairoGraphics.cpp 2012-07-20 18:35:21 +0000
374@@ -164,9 +164,12 @@
375 }
376 else
377 {
378+ unsigned char* dest_u8 = bitmap_data->GetSurface(0).GetPtrRawData();
379+ const int pitch = bitmap_data->GetSurface(0).GetPitch();
380+
381 for (int j = 0; j < _height; j++)
382 {
383- Memcpy(bitmap_data->GetSurface(0).GetPtrRawData() + j * bitmap_data->GetSurface(0).GetPitch(),
384+ Memcpy(dest_u8 + j * pitch,
385 (const void *) (&ptr[j * stride]),
386 _width * GPixelFormats[bitmap_format].NumComponents);
387 }
388
389=== modified file 'tests/Makefile.am'
390--- tests/Makefile.am 2012-03-28 18:29:23 +0000
391+++ tests/Makefile.am 2012-07-20 18:35:21 +0000
392@@ -69,6 +69,7 @@
393 gtest-nux-emmetrics.cpp \
394 gtest-nux-main.cpp \
395 gtest-nux-statictext.cpp \
396+ gtest-nux-scrollview.cpp \
397 gtest-nux-textentry.cpp \
398 gtest-nux-view.cpp \
399 gtest-nux-windowcompositor.cpp \
400
401=== added file 'tests/gtest-nux-scrollview.cpp'
402--- tests/gtest-nux-scrollview.cpp 1970-01-01 00:00:00 +0000
403+++ tests/gtest-nux-scrollview.cpp 2012-07-20 18:35:21 +0000
404@@ -0,0 +1,127 @@
405+// -*- Mode: C++; indent-tabs-mode: nil; tab-width: 2 -*-
406+/*
407+ * Copyright 2012 Inalogic® Inc.
408+ *
409+ * This program is free software: you can redistribute it and/or modify it
410+ * under the terms of the GNU Lesser General Public License, as
411+ * published by the Free Software Foundation; either version 2.1 or 3.0
412+ * of the License.
413+ *
414+ * This program is distributed in the hope that it will be useful, but
415+ * WITHOUT ANY WARRANTY; without even the implied warranties of
416+ * MERCHANTABILITY, SATISFACTORY QUALITY or FITNESS FOR A PARTICULAR
417+ * PURPOSE. See the applicable version of the GNU Lesser General Public
418+ * License for more details.
419+ *
420+ * You should have received a copy of both the GNU Lesser General Public
421+ * License along with this program. If not, see <http://www.gnu.org/licenses/>
422+ *
423+ * Authored by: Andrea Azzarone <azzaronea@gmail.com>
424+ *
425+ */
426+
427+#include <gmock/gmock.h>
428+
429+#include "Nux/Nux.h"
430+#include "Nux/ScrollView.h"
431+#include "Nux/VLayout.h"
432+
433+using namespace testing;
434+
435+namespace {
436+
437+class MockScrollView : public nux::ScrollView
438+{
439+public:
440+ MOCK_METHOD0(QueueDraw, void());
441+
442+ void FakeMouseWheelSignal(int x, int y, int wheel_delta, unsigned long mouse_button_state, unsigned long special_keys_state)
443+ {
444+ EmitMouseWheelSignal(x, y, wheel_delta, mouse_button_state, special_keys_state);
445+ }
446+};
447+
448+class TestScrollView : public ::testing::Test
449+{
450+public:
451+ virtual void SetUp()
452+ {
453+ nux::NuxInitialize(0);
454+ wnd_thread.reset(nux::CreateNuxWindow("ScrollView test", 300, 200, nux::WINDOWSTYLE_NORMAL, NULL, false, NULL, NULL));
455+
456+ scrollview.Adopt(new MockScrollView());
457+ scrollview->SetLayout(new nux::VLayout());
458+ }
459+
460+ std::unique_ptr<nux::WindowThread> wnd_thread;
461+ nux::ObjectPtr<MockScrollView> scrollview;
462+};
463+
464+TEST_F(TestScrollView, TestQueueDrawScrollDownNoScrollbars)
465+{
466+ EXPECT_CALL(*scrollview, QueueDraw())
467+ .Times(0);
468+
469+ scrollview->FakeMouseWheelSignal(0, 0, -NUX_MOUSEWHEEL_DELTA, 0, 0);
470+}
471+
472+
473+TEST_F(TestScrollView, TestQueueDrawScrollUpNoScrollbars)
474+{
475+ EXPECT_CALL(*scrollview, QueueDraw())
476+ .Times(0);
477+
478+ scrollview->FakeMouseWheelSignal(0, 0, NUX_MOUSEWHEEL_DELTA, 0, 0);
479+}
480+
481+
482+TEST_F(TestScrollView, TestQueueDrawScrollDown)
483+{
484+ scrollview->m_ViewContentHeight = 500;
485+ scrollview->m_ViewHeight = 400;
486+
487+ EXPECT_CALL(*scrollview, QueueDraw())
488+ .Times(1);
489+
490+ scrollview->FakeMouseWheelSignal(0, 0, -NUX_MOUSEWHEEL_DELTA, 0, 0);
491+}
492+
493+
494+TEST_F(TestScrollView, TestQueueDrawScrollUp)
495+{
496+ scrollview->m_ViewContentHeight = 500;
497+ scrollview->m_ViewHeight = 400;
498+ scrollview->ScrollDown(1, 10);
499+
500+ EXPECT_CALL(*scrollview, QueueDraw())
501+ .Times(1);
502+
503+ scrollview->FakeMouseWheelSignal(0, 0, NUX_MOUSEWHEEL_DELTA, 0, 0);
504+}
505+
506+
507+TEST_F(TestScrollView, TestQueueDrawScrollDownEnd)
508+{
509+ scrollview->m_ViewContentHeight = 500;
510+ scrollview->m_ViewHeight = 400;
511+ scrollview->ScrollDown(1, 100);
512+
513+ EXPECT_CALL(*scrollview, QueueDraw())
514+ .Times(0);
515+
516+ scrollview->FakeMouseWheelSignal(0, 0, -NUX_MOUSEWHEEL_DELTA, 0, 0);
517+}
518+
519+
520+TEST_F(TestScrollView, TestQueueDrawScrollUpStart)
521+{
522+ scrollview->m_ViewContentHeight = 500;
523+ scrollview->m_ViewHeight = 400;
524+
525+ EXPECT_CALL(*scrollview, QueueDraw())
526+ .Times(0);
527+
528+ scrollview->FakeMouseWheelSignal(0, 0, NUX_MOUSEWHEEL_DELTA, 0, 0);
529+}
530+
531+}
532
533=== modified file 'tests/gtest-nux-view.cpp'
534--- tests/gtest-nux-view.cpp 2012-02-26 01:57:06 +0000
535+++ tests/gtest-nux-view.cpp 2012-07-20 18:35:21 +0000
536@@ -7,6 +7,7 @@
537 #include <glib.h>
538
539 #include "Nux/Nux.h"
540+#include "Nux/HLayout.h"
541 #include "Nux/StaticText.h"
542 #include "Nux/ProgramFramework/TestView.h"
543
544@@ -34,4 +35,49 @@
545 delete wnd_thread;
546 }
547
548+TEST(TestView, TestQueueDraw)
549+{
550+ nux::NuxInitialize(0);
551+ nux::WindowThread *wnd_thread = nux::CreateNuxWindow("View Test", 300, 200,
552+ nux::WINDOWSTYLE_NORMAL, NULL, false, NULL, NULL);
553+
554+ nux::TestView* main_view = new nux::TestView("");
555+
556+ nux::HLayout* hlayout = new nux::HLayout("");
557+ main_view->SetLayout(hlayout);
558+
559+ nux::TestView* test_view1 = new nux::TestView("");
560+ hlayout->AddView(test_view1);
561+ nux::TestView* test_view2 = new nux::TestView("");
562+ hlayout->AddView(test_view2);
563+ nux::TestView* test_view3 = new nux::TestView("");
564+ hlayout->AddView(test_view3);
565+
566+ hlayout->ComputeContentSize();
567+ EXPECT_EQ(main_view->calls_to_queue_draw_, 0);
568+ EXPECT_EQ(test_view1->calls_to_queue_draw_, 0);
569+ EXPECT_EQ(test_view2->calls_to_queue_draw_, 0);
570+ EXPECT_EQ(test_view3->calls_to_queue_draw_, 0);
571+
572+ main_view->QueueDraw();
573+ EXPECT_EQ(main_view->calls_to_queue_draw_, 1);
574+ EXPECT_EQ(test_view1->calls_to_queue_draw_, 1);
575+ EXPECT_EQ(test_view2->calls_to_queue_draw_, 1);
576+ EXPECT_EQ(test_view3->calls_to_queue_draw_, 1);
577+
578+ int old_size = wnd_thread->GetDrawList().size();
579+ main_view->QueueDraw();
580+ test_view2->QueueDraw();
581+ int new_size = wnd_thread->GetDrawList().size();
582+ EXPECT_EQ(old_size, new_size); // LP: #1014610
583+
584+ EXPECT_EQ(main_view->calls_to_queue_draw_, 2);
585+ EXPECT_EQ(test_view1->calls_to_queue_draw_, 1);
586+ EXPECT_EQ(test_view2->calls_to_queue_draw_, 2);
587+ EXPECT_EQ(test_view3->calls_to_queue_draw_, 1);
588+
589+ main_view->UnReference();
590+ delete wnd_thread;
591+}
592+
593 }
594
595=== modified file 'tools/unity_support_test.c'
596--- tools/unity_support_test.c 2012-01-05 16:56:56 +0000
597+++ tools/unity_support_test.c 2012-07-20 18:35:21 +0000
598@@ -845,7 +845,7 @@
599
600 // drop result file
601 if (results.result != 5) {
602- sprintf(resultfilename, "/tmp/unity_support_test.%i", results.result);
603+ snprintf(resultfilename, sizeof(resultfilename), "/tmp/unity_support_test.%i", results.result);
604 resultfile = open(resultfilename, O_CREAT|O_WRONLY|O_EXCL, 0666);
605 if (resultfile > 0)
606 close(resultfile);

Subscribers

People subscribed via source and target branches

to all changes: