40 +#include <iostream> 41 #include <assert.h> 42 43 namespace mt = mir::test; 44 @@ -45,7 +46,11 @@ 45 mir_display_output_id_invalid}; 46 47 auto surface = mir_connection_create_surface_sync(connection, &surface_params); 48 - assert(mir_surface_is_valid(surface)); 49 + if (!mir_surface_is_valid(surface)) 50 + { 51 + std::cerr << "Surface creation failed: " << mir_surface_get_error_message(surface) << std::endl; 52 + exit(1); 53 + } 54 55 return surface; 56 } 57 @@ -93,7 +98,11 @@ 58 void TouchMeasuringClient::run(std::string const& connect_string) 59 { 60 auto connection = mir_connect_sync(connect_string.c_str(), "frame-uniformity-test"); 61 - assert(mir_connection_is_valid(connection)); 62 + if (!mir_connection_is_valid(connection)) 63 + { 64 + std::cerr << "Connection to Mir failed: " << mir_connection_get_error_message(connection) << std::endl; 65 + exit(1); 66 + }
wouldn't "#undef NDEBUG" before including <cassert> be simpler and clearer?
« Back to merge proposal
40 +#include <iostream> output_ id_invalid} ; create_ surface_ sync(connection , &surface_params); mir_surface_ is_valid( surface) ); is_valid( surface) ) get_error_ message( surface) << std::endl; lient:: run(std: :string const& connect_string) sync(connect_ string. c_str() , "frame- uniformity- test"); mir_connection_ is_valid( connection) ); n_is_valid( connection) ) get_error_ message( connection) << std::endl;
41 #include <assert.h>
42
43 namespace mt = mir::test;
44 @@ -45,7 +46,11 @@
45 mir_display_
46
47 auto surface = mir_connection_
48 - assert(
49 + if (!mir_surface_
50 + {
51 + std::cerr << "Surface creation failed: " << mir_surface_
52 + exit(1);
53 + }
54
55 return surface;
56 }
57 @@ -93,7 +98,11 @@
58 void TouchMeasuringC
59 {
60 auto connection = mir_connect_
61 - assert(
62 + if (!mir_connectio
63 + {
64 + std::cerr << "Connection to Mir failed: " << mir_connection_
65 + exit(1);
66 + }
wouldn't "#undef NDEBUG" before including <cassert> be simpler and clearer?