[glom/glom-1-28] Python tests: Output any unexpected python error message to std::cerr.
- From: Murray Cumming <murrayc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [glom/glom-1-28] Python tests: Output any unexpected python error message to std::cerr.
- Date: Thu, 10 Mar 2016 12:41:09 +0000 (UTC)
commit e023378350c4540b43c4b5e0b56144657eeee811
Author: Murray Cumming <murrayc murrayc com>
Date: Mon Feb 29 13:08:32 2016 +0100
Python tests: Output any unexpected python error message to std::cerr.
tests/python/test_python_execute_func.cc | 5 ++++-
.../test_python_execute_func_change_result_type.cc | 5 ++++-
tests/python/test_python_execute_func_date.cc | 7 +++++++
3 files changed, 15 insertions(+), 2 deletions(-)
---
diff --git a/tests/python/test_python_execute_func.cc b/tests/python/test_python_execute_func.cc
index b13f89e..2952f06 100644
--- a/tests/python/test_python_execute_func.cc
+++ b/tests/python/test_python_execute_func.cc
@@ -39,7 +39,10 @@ int main()
//std::cout << "type=" << g_type_name(value.get_value_type()) << std::endl;
//Check that there was no python error:
- g_assert(error_message.empty());
+ if(!error_message.empty()) {
+ std::cerr << "Unexpected error message: " << error_message << "\n";
+ return EXIT_FAILURE;
+ }
//Check that the return value is of the expected type:
g_assert(value.get_value_type() == GDA_TYPE_NUMERIC);
diff --git a/tests/python/test_python_execute_func_change_result_type.cc
b/tests/python/test_python_execute_func_change_result_type.cc
index 2aa4ba4..70db4de 100644
--- a/tests/python/test_python_execute_func_change_result_type.cc
+++ b/tests/python/test_python_execute_func_change_result_type.cc
@@ -40,7 +40,10 @@ int main()
//std::cout << "type=" << g_type_name(value.get_value_type()) << std::endl;
//Check that there was no python error:
- g_assert(error_message.empty());
+ if(!error_message.empty()) {
+ std::cerr << "Unexpected error message: " << error_message << "\n";
+ return EXIT_FAILURE;
+ }
//Check that the return value is of the expected type:
g_assert(Glom::Field::get_glom_type_for_gda_type(value.get_value_type()) == result_type);
diff --git a/tests/python/test_python_execute_func_date.cc b/tests/python/test_python_execute_func_date.cc
index 68b8954..db83738 100644
--- a/tests/python/test_python_execute_func_date.cc
+++ b/tests/python/test_python_execute_func_date.cc
@@ -7,6 +7,7 @@
#include <glom/libglom/init.h>
#include <glom/python_embed/glom_python.h>
#include <libglom/data_structure/glomconversions.h>
+#include <iostream>
void execute_func_with_date_return_value()
{
@@ -26,6 +27,9 @@ void execute_func_with_date_return_value()
//std::cout << "type=" << g_type_name(value.get_value_type()) << std::endl;
//Check that there was no python error:
+ if(!error_message.empty()) {
+ std::cerr << "Unexpected error message: " << error_message << "\n";
+ }
g_assert(error_message.empty());
//Check that the return value is of the expected type:
@@ -61,6 +65,9 @@ void execute_func_with_date_input_value()
//std::cout << "type=" << g_type_name(value.get_value_type()) << std::endl;
//Check that there was no python error:
+ if(!error_message.empty()) {
+ std::cerr << "Unexpected error message: " << error_message << "\n";
+ }
g_assert(error_message.empty());
//Check that the return value is of the expected type:
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]