From 6f986272c0231b895d698a9d6939248f2b384a38 Mon Sep 17 00:00:00 2001 From: Nirhar Date: Wed, 25 May 2022 08:51:12 +0530 Subject: [PATCH] Modified the dump function to print a more readable output. Previously the dump function printed the code immediately after "The code is" which made the actual code less readable. Now a '\n' character has been added after "The code is" so that the actual code starts from a new line, making it more readable. This patch fixes #377 --- include/clad/Differentiator/Differentiator.h | 2 +- test/Misc/RunDemos.C | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/include/clad/Differentiator/Differentiator.h b/include/clad/Differentiator/Differentiator.h index 247e15412..04b0da055 100644 --- a/include/clad/Differentiator/Differentiator.h +++ b/include/clad/Differentiator/Differentiator.h @@ -219,7 +219,7 @@ namespace clad { } void dump() const { - printf("The code is: %s\n", getCode()); + printf("The code is: \n%s\n", getCode()); } /// Set object pointed by the functor as the default object for diff --git a/test/Misc/RunDemos.C b/test/Misc/RunDemos.C index 6c6d3980b..28beb3bf5 100644 --- a/test/Misc/RunDemos.C +++ b/test/Misc/RunDemos.C @@ -152,7 +152,8 @@ // RUN: ./CustomModelTest.out | FileCheck -check-prefix CHECK_CUSTOM_MODEL_EXEC %s // CHECK_CUSTOM_MODEL_EXEC-NOT:{{.*error|warning|note:.*}} -// CHECK_CUSTOM_MODEL_EXEC: The code is: void func_grad(float x, float y, clad::array_ref _d_x, clad::array_ref _d_y, double &_final_error) { +// CHECK_CUSTOM_MODEL_EXEC: The code is: +// CHECK_CUSTOM_MODEL_EXEC-NEXT: void func_grad(float x, float y, clad::array_ref _d_x, clad::array_ref _d_y, double &_final_error) { // CHECK_CUSTOM_MODEL_EXEC-NEXT: float _d_z = 0; // CHECK_CUSTOM_MODEL_EXEC-NEXT: double _delta_z = 0; // CHECK_CUSTOM_MODEL_EXEC-NEXT: float _EERepl_z0;