From 5d4171f7fb548e06ecd2440f57322b3c77f1074e Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Tue, 7 Oct 2003 12:27:49 +0000 Subject: * Synchronise terminology with the ICSE paper (e.g., slice -> closure, fstate -> Nix expression). * Fix src/test.cc. --- src/test.cc | 35 +++++++++++------------------------ 1 file changed, 11 insertions(+), 24 deletions(-) (limited to 'src/test.cc') diff --git a/src/test.cc b/src/test.cc index d640e335ae77..fb1e62eb3802 100644 --- a/src/test.cc +++ b/src/test.cc @@ -13,23 +13,10 @@ void realise(FSId id) { Nest nest(lvlDebug, format("TEST: realising %1%") % (string) id); - realiseSlice(normaliseFState(id)); + realiseClosure(normaliseNixExpr(id)); } -#if 0 -void realiseFail(FState fs) -{ - try { - realiseFState(fs); - abort(); - } catch (Error e) { - cout << "error (expected): " << e.what() << endl; - } -} -#endif - - struct MySink : DumpSink { virtual void operator () (const unsigned char * data, unsigned int len) @@ -115,8 +102,8 @@ void runTests() addToStore("./test-builder-1.sh", builder1fn, builder1id); ATerm fs1 = ATmake( - "Slice([], [(, , [])])", - ((string) builder1id).c_str(), + "Closure([], [(, , [])])", + builder1fn.c_str(), builder1fn.c_str(), ((string) builder1id).c_str()); FSId fs1id = writeTerm(fs1, ""); @@ -125,8 +112,8 @@ void runTests() realise(fs1id); ATerm fs2 = ATmake( - "Slice([], [(, , [])])", - ((string) builder1id).c_str(), + "Closure([], [(, , [])])", + (builder1fn + "_bla").c_str(), (builder1fn + "_bla").c_str(), ((string) builder1id).c_str()); FSId fs2id = writeTerm(fs2, ""); @@ -137,12 +124,12 @@ void runTests() string out1id = hashString("foo"); /* !!! bad */ string out1fn = nixStore + "/" + (string) out1id + "-hello.txt"; ATerm fs3 = ATmake( - "Derive([(, )], [], , , [(\"out\", )])", + "Derive([(, )], [], , , [], [(\"out\", )])", out1fn.c_str(), ((string) out1id).c_str(), ((string) fs1id).c_str(), - ((string) builder1fn).c_str(), thisSystem.c_str(), + ((string) builder1fn).c_str(), out1fn.c_str()); debug(printTerm(fs3)); FSId fs3id = writeTerm(fs3, ""); @@ -156,8 +143,8 @@ void runTests() addToStore("./test-builder-2.sh", builder4fn, builder4id); ATerm fs4 = ATmake( - "Slice([], [(, , [])])", - ((string) builder4id).c_str(), + "Closure([], [(, , [])])", + builder4fn.c_str(), builder4fn.c_str(), ((string) builder4id).c_str()); FSId fs4id = writeTerm(fs4, ""); @@ -167,12 +154,12 @@ void runTests() string out5id = hashString("bar"); /* !!! bad */ string out5fn = nixStore + "/" + (string) out5id + "-hello2"; ATerm fs5 = ATmake( - "Derive([(, )], [], , , [(\"out\", ), (\"builder\", )])", + "Derive([(, )], [], , , [], [(\"out\", ), (\"builder\", )])", out5fn.c_str(), ((string) out5id).c_str(), ((string) fs4id).c_str(), - ((string) builder4fn).c_str(), thisSystem.c_str(), + ((string) builder4fn).c_str(), out5fn.c_str(), ((string) builder4fn).c_str()); debug(printTerm(fs5)); -- cgit 1.4.1