aboutsummaryrefslogtreecommitdiff
path: root/test/cmplxdivide.c
diff options
context:
space:
mode:
authorRob Pike <r@golang.org>2015-01-15 10:43:04 +1100
committerRob Pike <r@golang.org>2015-01-15 00:00:06 +0000
commit3b63b69d2f16be676d4fdc4f4ac697ed92abf523 (patch)
tree3ed146f6dcb159bddeb62fca4995c37d2b752eff /test/cmplxdivide.c
parent636de7afb61d3afc354949fb6290afd9554dd5a5 (diff)
downloadgo-3b63b69d2f16be676d4fdc4f4ac697ed92abf523.tar.gz
go-3b63b69d2f16be676d4fdc4f4ac697ed92abf523.zip
test: comment the behavior and use of cmplxdivide*
The various files are confusingly named and their operation not easy to see. Add a comment to cmplxdivide.c, one of the few C files that will endure in the repository, to explain how to build and run the test. Change-Id: I1fd5c564a14217e1b9815b09bc24cc43c54c096f Reviewed-on: https://go-review.googlesource.com/2850 Reviewed-by: Russ Cox <rsc@golang.org>
Diffstat (limited to 'test/cmplxdivide.c')
-rw-r--r--test/cmplxdivide.c13
1 files changed, 12 insertions, 1 deletions
diff --git a/test/cmplxdivide.c b/test/cmplxdivide.c
index 12dc4f1c0c..d65436223c 100644
--- a/test/cmplxdivide.c
+++ b/test/cmplxdivide.c
@@ -2,7 +2,18 @@
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
-// gcc '-std=c99' cmplxdivide.c && a.out >cmplxdivide1.go
+// This C program generates the file cmplxdivide1.go. It uses the
+// output of the operations by C99 as the reference to check
+// the implementation of complex numbers in Go.
+// The generated file, cmplxdivide1.go, is compiled along
+// with the driver cmplxdivide.go (the names are confusing
+// and unimaginative) to run the actual test. This is done by
+// the usual test runner.
+//
+// The file cmplxdivide1.go is checked in to the repository, but
+// if it needs to be regenerated, compile and run this C program
+// like this:
+// gcc '-std=c99' cmplxdivide.c && a.out >cmplxdivide1.go
#include <complex.h>
#include <math.h>