]> Cypherpunks repositories - gostls13.git/commitdiff
test: comment the behavior and use of cmplxdivide*
authorRob Pike <r@golang.org>
Wed, 14 Jan 2015 23:43:04 +0000 (10:43 +1100)
committerRob Pike <r@golang.org>
Thu, 15 Jan 2015 00:00:06 +0000 (00:00 +0000)
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>
test/cmplxdivide.c
test/cmplxdivide.go

index 12dc4f1c0c914c3293a5604083c5d4c56c67054f..d65436223ca2c6080533539c0df9578e590a29c0 100644 (file)
@@ -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>
index 40c84486da0aee7e0a6288091a17efeb658e5fed..8e2967258f47229ab2b177df4aea349e8e46ad84 100644 (file)
@@ -5,6 +5,7 @@
 // license that can be found in the LICENSE file.
 
 // Driver for complex division table defined in cmplxdivide1.go
+// For details, see the comment at the top of in cmplxdivide.c.
 
 package main