Index: runtime/bin/fuchsia_test.cc |
diff --git a/runtime/bin/fuchsia_test.cc b/runtime/bin/fuchsia_test.cc |
index 802ff31fabaa8c5628ab8a483900e7a57b271489..e92014089d56e40cc25de3ba8d8f80e4c610f576 100644 |
--- a/runtime/bin/fuchsia_test.cc |
+++ b/runtime/bin/fuchsia_test.cc |
@@ -7,16 +7,18 @@ |
#include <dart_api.h> |
-int main(void) { |
- fprintf(stderr, "Calling Dart_SetVMFlags\n"); |
- fflush(stderr); |
+#include "bin/log.h" |
+ |
+namespace dart { |
+namespace bin { |
+ |
+int Main() { |
+ Log::Print("Calling Dart_SetVMFlags\n"); |
if (!Dart_SetVMFlags(0, NULL)) { |
- fprintf(stderr, "Failed to set flags\n"); |
- fflush(stderr); |
+ Log::PrintErr("Failed to set flags\n"); |
return -1; |
} |
- fprintf(stderr, "Calling Dart_Initialize\n"); |
- fflush(stderr); |
+ Log::Print("Calling Dart_Initialize\n"); |
char* error = Dart_Initialize( |
NULL, NULL, NULL, |
NULL, NULL, NULL, NULL, |
@@ -28,12 +30,26 @@ int main(void) { |
NULL, |
NULL); |
if (error != NULL) { |
- fprintf(stderr, "VM initialization failed: %s\n", error); |
- fflush(stderr); |
+ Log::PrintErr("VM initialization failed: %s\n", error); |
free(error); |
return -1; |
} |
- fprintf(stderr, "Success!\n"); |
- fflush(stderr); |
+ |
+ Log::Print("Calling Dart_Cleanup\n"); |
+ error = Dart_Cleanup(); |
+ if (error != NULL) { |
+ Log::PrintErr("VM Cleanup failed: %s\n", error); |
+ free(error); |
+ return -1; |
+ } |
+ |
+ Log::Print("Success!\n"); |
return 0; |
} |
+ |
+} // namespace bin |
+} // namespace dart |
+ |
+int main(void) { |
+ return dart::bin::Main(); |
+} |